admin@RT-N66U:/tmp/home/root# iptables -nvL -t nat
Chain PREROUTING (policy ACCEPT 59 packets, 3046 bytes)
pkts bytes target prot opt in out source destination
1 57 DNSFILTER udp -- * * 192.168.66.0/24 0.0.0.0/0 udp dpt:53
0 0 DNSFILTER tcp -- * * 192.168.66.0/24 0.0.0.0/0 tcp dpt:53
...
Chain DNSFILTER (2 references)
pkts bytes target prot opt in out source destination
1 57 DNAT all -- * * 0.0.0.0/0 0.0.0.0/0 to:192.168.66.1
It's interesting to note the subtle difference between No Filtering and Router. "No Filtering will disable/bypass the filter, and Router will force clients to use the DNS provided by the router's DHCP server (or, the router itself if it's not defined)." So with "Router" clients are forced to use the routers DNS settings, with No Filtering it's possible for clients to ignore the settings and specify their own DNS.
Are you saying there is a bug in the GUI when "Global Filter Mode: Router" is selected?The DNS filter web page is a configuration tool for iptables rules, it does not rely on dhcp serving of dns servers which is easily ignored by clients. On my system N66U with merlin 378.51 the global setting to "router" does not work as described above. The links to the DNSFILTER chain are created, but the chain itself is empty. If I set the global filter to custom 1 and put the router lan ip address in the custom 1 box the DNSFILTER chain is correctly populated:-
Code:admin@RT-N66U:/tmp/home/root# iptables -nvL -t nat Chain PREROUTING (policy ACCEPT 59 packets, 3046 bytes) pkts bytes target prot opt in out source destination 0 0 VSERVER all -- * * 0.0.0.0/0 82.13.252.157 1 57 DNSFILTER udp -- * * 192.168.66.0/24 0.0.0.0/0 udp dpt:53 0 0 DNSFILTER tcp -- * * 192.168.66.0/24 0.0.0.0/0 tcp dpt:53 ... Chain DNSFILTER (2 references) pkts bytes target prot opt in out source destination 1 57 DNAT all -- * * 0.0.0.0/0 0.0.0.0/0 to:192.168.66.1
relevant source-code seems to be
https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/rc/firewall.c#L5246
so it appears on my system at least the default line is not added when web gui global filter mode set to router.
There is a bug in my attempted use at least - it may depend other settings - I have dhcp wan and have blank entries for gateway and dns in lan dhcp - so router is specified to clients. I allow router to use my ISP dns servers but I also add additional servers via dnsmasq extra config. I intend all clients to use the router, but checking using "namebench" made it clear the router divert was not working
I have walked through the source code - my problem may be that the nvram var "dhcp_dns1_x" is blank in my setup
https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/rc/services.c#L6849
You don't actually need to enter anything in custom1, it defaults to the router lan address because of the check in above code #L6868
I agree that this is a bug.....another workaround is to enter the router address as the DNS server under LAN/DHCP Servers
So it's a bug in the basic firmware independent of model or personalised settings, in which case implement one the 2 suggested workarounds?
That's my opinion....will let Merlin make the final comment.
Just as an FYI for any users of my 374 based fork who may be reading this thread....the fork does not have this bug.
Ah, thanks for explaining that. I've recently started using your fork so hadn't realised that this bug existed.Just as an FYI for any users of my 374 based fork who may be reading this thread....the fork does not have this bug.
I *think* you may be able to see it this way....John, is there a simple test we could do (not looking into code!) if we wanted, by, for example, trying to access a certain resource, with specific settings (temporarily) entered, to see - for interest's sake - whether this bug affects us?
I see that RMerlin said to you earlier "That setting is only valid for individual entries". With all due respect, that is incorrect. It can also be applied to the Global Filter Mode.
I *think* you may be able to see it this way....
- Set a Global Filter mode to use one of the services, like OpenDNS home
- Set a specific client to use 'Router' as the filter mode
I think you will see that the client you want to use the Router DNS servers will still be using the OpenDNS server.
I agree that this is a bug.....another workaround is to enter the router address as the DNS server under LAN/DHCP Servers
Awesome, thanks RMerlin.Thanks - should be taken care of with this commit.
admin@RTAC68U:/tmp/home/root# iptables -nvL -t nat
Chain PREROUTING (policy ACCEPT 143 packets, 10048 bytes)
pkts bytes target prot opt in out source destination
24 3133 VSERVER all -- * * 0.0.0.0/0 <WAN IP>
138 8883 DNSFILTER udp -- * * 10.0.0.0/24 0.0.0.0/0 udp dpt:53
4 240 DNSFILTER tcp -- * * 10.0.0.0/24 0.0.0.0/0 tcp dpt:53
Chain INPUT (policy ACCEPT 51 packets, 4496 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 12 packets, 1587 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 12 packets, 1587 bytes)
pkts bytes target prot opt in out source destination
872 95341 MASQUERADE all -- * eth0 !<WAN IP> 0.0.0.0/0
0 0 MASQUERADE all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0xb400
Chain DNSFILTER (2 references)
pkts bytes target prot opt in out source destination
99 6320 DNAT all -- * * 0.0.0.0/0 0.0.0.0/0 MAC <ROKU MAC> to:123.123.123.123
43 2803 DNAT all -- * * 0.0.0.0/0 0.0.0.0/0 to:10.0.0.1
Chain LOCALSRV (0 references)
pkts bytes target prot opt in out source destination
Chain PCREDIRECT (0 references)
pkts bytes target prot opt in out source destination
Chain VSERVER (1 references)
pkts bytes target prot opt in out source destination
24 3133 VUPNP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain VUPNP (1 references)
pkts bytes target prot opt in out source destination
0 0 DNAT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:54019 to:10.0.0.X:54019
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!