Hi everybody,
I am trying to get ipset running according to thencein's howto in Blocking websites on your router.
I replaced the dnsmsq package by dnsmsq-full and installed additional packages (ipset, ipset-dns, kmod-ipt-ipset, libipset13). The goal is to block a lot of websites on the wifi interface (in my configs it is called wlan with a firewall zone wlan_fw_kn).
Unfortunately it is still possible to reach the below example websites like youtube.com from the wifi zone.
My /etc/config/firewall
config ipset
option name 'IP-Bereiche'
option match 'dest_ip'
option family 'ipv4'
option storage 'hash'
option enabled '1'
config rule
option target 'REJECT'
list proto 'all'
option src 'wlan_fw_kn'
option name 'Sammelregel'
option ipset 'IP-Bereiche'
option dest 'wan'
Navigate to LuCI → Network → Firewall → Traffic Rules → Filter-IPset-DNS-Forward to manage firewall rules.
Navigate to LuCI → Network → DHCP and DNS → General Settings → DNS forwardings to manage domains.
Anyhow, does anybody of you have an idea where the problem is or how I can investigate further?
THX a lot!
ipv6 is not configured in my network, therefore I didnt configure it here neither
pre-resolve I didn't configure due to lack of understanding...
Regarding ipset-dns I added in my /etc/config/ipset-dns the following: option ipset 'IP-Bereiche'
Then I reduced the number of blocked domains in /etc/config/dhcp to list ipset '/youtube.com/IP-Bereiche'
Butipset list gives me
Name: IP-Bereiche
Type: hash:ip
Revision: 4
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 216
References: 1
Number of entries: 4
Members:
172.217.16.78
216.58.213.238
216.58.213.246
172.217.19.78
Those IPs are actually not pingable from within the wifi zone.
So I ask myself how OpenWRT is translating youtube.com (mentioned in my dhcp config) into all these IPs ?
When I do nslookup from within the wifi zone I get the following:
Does the youtube website load in your browser when connecting from a wifi device? I've never really paid attention to whether pings are successful or not as I was satisfied enough simply knowing the website and app were virtually broken/unusable thanks to the ipset firewall rules.
No, both youtube and play.google dont load in the browser from within the wifi zone.
All IPs from ipset list are not pingable from within the wifi zone.
due to a minimal change in the configs I get more members in my ipset
~#ipset list
Name: IP-Bereiche
Type: hash:ip
Revision: 4
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 256
References: 1
Number of entries: 5
Members:
172.217.16.78
216.58.213.238
216.58.213.246
172.217.19.78
216.58.213.206 <---this one is new
This is strange because I still one single line in my /etc/config/dhcp : list ipset '/youtube.com/IP-Bereiche'
So blocking of domains is working but I have to live with the mechanism of dnsmasq which resolves these domains into IPs - maybe it is not dnsmasq "fault" that youtube.com includes the IP of play.google.com (which I didnt want to block).
Maybe the notation in the second line is not correct but the same warning comes with only the first option iprange, too.
Unfortunately I didn'T find out how to get iprange running.
For reference/information, dnsmasq-full has, for some years now, had full ipset support built in, including the functionality of ipset-dns. (I think it was added around the time of Barrier Breaker .. not sure)
This means that installing ipset-dns is superfluous ie. it does nothing.
It should be deprecated as a package I think, and the various Wiki pages updated....
This should not exist and will not be used.
Perhaps you meant /etc/dnsmasq.conf. This is not used either.
The dnsmasq init.d script creates a dnsmasq.conf.cfgxxxxxx file in /tmp/etc/ at startup using the contents of /etc/config/dhcp
The ipset-dns package "provides" web interface to manage IP set domains, and I believe this is important for many users.
I'm happy to update the docs when the ipset dnsmasq option has web interface support.
If you look at the detail of /etc/init.d/dnsmasq it looks like dnsmasq is started using only the generated config file in /tmp/etc
I have done a few quick tests here and anything in /etc/dnsmasq.conf seems to be ignored.
If it does read /etc/dnsmasq.conf, it must be hard coded somewhere and a quick look at the source code did not show it up.
Which special options have you set there?
2327 dnsmasq 1464 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
2329 root 1460 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
And, when checking:
root@...~# cat /var/etc/dnsmasq.conf.cfg01411c
Comment: auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
....
My (customized) /etc/dnsmasq.contains few special config options, i.e.
no-resolv
no-poll
cache-size=1000
.....
Ah! You mean ipset-dns is supported by Luci! This all seems to be a bit of an unfinished and then forgotten work in progress. I wonder if there are any conflicts between dnsmasq-full and ipset-dns?
I might do a few tests....