Wireguard peer lost dns resolution after adblock installaion

Hi,

yesterday i installed adblock, then all my configured peer lost dns resolution.
The peer are still able to establish a tunnel but not able to surf.

Then i removed adblock & rebooted the router and the problem persist.
I asked a friend to install adblock and check he wireguard suff, same problem for him.
I have done a force install of dnsmasq and reinstalled wiregard reconfigured the peer with the same ip & key same problem (reboot router o n each step.

Then on a smartphone peer i created a new wiregard interface pointing to the same router (with the same router public key) with a new peer key & ip, the peer is able to surf using the new interface.

Is there somewhere a dnscache for the peer ?
I clearend android chrome dns cache.

here my config:
cat /etc/config/dhcp


config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option localservice '1'
        option logqueries '1'

config dhcp 'lan'
        option interface 'lan'
        option limit '150'
        option leasetime '12h'
        option start '210'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

root@OpenWrt:/etc/config# cat network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd92:5fa7:b98d::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.2.1'
        option mtu '9000'

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr '34:ce:00:65:2e:30'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'pppoe'
        option password 'pass'
        option ipv6 'auto'
        option username 'user'
        option peerdns '0'
        list dns '1.1.1.1'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 3 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 6t'

config interface 'modem'
        option ifname 'eth0.2'
        option proto 'static'
        option netmask '255.255.255.0'
        option broadcast '192.168.1.255'
        option ipaddr '192.168.1.2'
        option gateway '192.168.1.1'

config wireguard_wg0
        option description 'peer1'
        list allowed_ips '10.200.200.3/24'
        option route_allowed_ips '1'
        option persistent_keepalive '25'
        option public_key 'peer1 '

config interface 'wg0'
        option proto 'wireguard'
        option private_key 'router pub key'
        option listen_port '51820'
        list addresses '10.200.200.1/24'

config wireguard_wg0
        option route_allowed_ips '1'
        option persistent_keepalive '25'
        list allowed_ips '10.200.200.5/24'
        option description 'peer2'
        option public_key 'peer2 public key'

config wireguard_wg0 
        option description 'peer3'
        option public_key 'peer3 public key'
        option route_allowed_ips '1'
        option persistent_keepalive '25'
        list allowed_ips '10.200.200.2/24'

root@OpenWrt:/etc/config# cat firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option flow_offloading '1'
        option flow_offloading_hw '1'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan wg0'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        option network 'wan wan6 modem'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

config redirect
        option target 'DNAT'
        option name 'WireGuard'
        option src 'wan'
        option dest 'lan'
        option dest_ip '192.168.2.1'
        list proto 'tcp'
        list proto 'udp'
        list proto 'icmp'
        option src_dport '51820'
        option dest_port '51820'

really?

This creates a wan_6 interface automatically, so there might be a conflict with the wan6 interface. Change from auto to 1, or delete wan6.

Delete that.

change to /32
Do the same to the other peers too.

Delete this.
Create a rule:

uci -q delete firewall.@redirect[0]
uci -q delete firewall.wg
uci set firewall.wg="rule"
uci set firewall.wg.name="Allow-WireGuard"
uci set firewall.wg.src="wan"
uci set firewall.wg.dest_port=51820
uci set firewall.wg.proto="udp"
uci set firewall.wg.target="ACCEPT"
uci commit firewall
/etc/init.d/firewall restart

Post also the following:
ls -l /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

4 Likes

thanks for the help.
i have do all your request change and it's working.
here the partialy anomized return of

ubus call system board; uci export network; uci export dhcp; uci export firewall; \
head -n -0 /etc/firewall.user; iptables-save -c; ip -4 addr ; ip -4 ro li tab all ; ip -4 ru; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
{
        "kernel": "4.14.167",
        "hostname": "OpenWrt",
        "system": "MediaTek MT7621 ver:1 eco:3",
        "model": "Xiaomi Mi Router 3G",
        "board_name": "xiaomi,mir3g",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.1",
                "revision": "r10911-c155900f66",
                "target": "ramips/mt7621",
                "description": "OpenWrt 19.07.1 r10911-c155900f66"
        }
}
package network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd92:5fa7:b98d::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.2.1'
        option mtu '1500'

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr '34:ce:00:65:2e:30'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'pppoe'
        option password 'pass'
        option ipv6 '1'
        option username 'user'
        option peerdns '0'
        list dns '1.1.1.1'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 3 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 6t'

config wireguard_wg0
        option description 'peer1'
        list allowed_ips '10.200.200.3/32'
        option route_allowed_ips '1'
        option persistent_keepalive '25'
        option public_key '***********************='

config interface 'wg0'
        option proto 'wireguard'
        option private_key '*********************='
        option listen_port '51820'
        list addresses '10.200.200.1/24'

config wireguard_wg0
        option route_allowed_ips '1'
        option persistent_keepalive '25'
        list allowed_ips '10.200.200.5/32'
        option description 'peer2'
        option public_key '************************='

config wireguard_wg0
        option description 'peer3'
        option public_key '************************='
        option route_allowed_ips '1'
        option persistent_keepalive '25'
        list allowed_ips '10.200.200.2/32'

package dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        list address '/h.mydomain.com/192.168.2.210'
        list address '/o.mydomain.com/192.168.2.1'
        list address '/m.mydomain.com/192.168.2.200'
        list address '/p.mydomain.com/192.168.2.200'
        list address '/pr$.mydomain.com/192.168.2.200'
        list address '/b.mydomain.com/192.168.2.200'
        list address '/bw.mydomain.com/192.168.2.200'
        list address '/r.mydomain.com/192.168.2.200'
        list address '/p.mydomain.com/192.168.2.200'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option localservice '1'
        option logqueries '1'

config dhcp 'lan'
        option interface 'lan'
        option limit '150'
        option leasetime '12h'
        option start '210'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config host
        option name 'ilo'
        option dns '1'
        option mac '34:64:A9:9A:34:BA'
        option ip '192.168.2.201'

config host
        option name 'microserver'
        option dns '1'
        option mac '34:64:A9:9A:34:B9'
        option ip '192.168.2.200'

config host
        option name 'pi'
        option dns '1'
        option mac '02:81:1B:1A:2E:09'
        option ip '192.168.2.210'

config host
        option name 'maxcube'
        option dns '1'
        option mac '00:1A:22:02:2F:2C'
        option ip '192.168.2.205'

config host
        option dns '1'
        option mac 'A0:0B:BA:89:C5:98'
        option ip '192.168.2.11'
        option name 'tvw'

config host
        option name 'tv'
        option dns '1'
        option mac '8C:C8:CD:4D:FA:EE'
        option ip '192.168.2.10'

config host
        option mac 'AC:D5:64:82:70:7F'
        option dns '1'
        option name 'MFC-L3770CDWW'
        option ip '192.168.2.8'

config host
        option name 'MFC-L3770CDWL'
        option dns '1'
        option mac '3C:2A:F4:D2:00:66'
        option ip '192.168.2.9'

config host
        option name 'orangepipc'
        option dns '1'
        option mac '02:81:6A:58:1B:47'
        option ip '192.168.2.230'

package firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option flow_offloading '1'
        option flow_offloading_hw '1'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan wg0'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        option network 'wan wan6 modem'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

config redirect
        option target 'DNAT'
        option name 'iperf3'
        option src 'wan'
        option src_dport '5201'
        option dest 'lan'
        option dest_ip '192.168.2.1'
        option dest_port '5201'

config nat
        option name 'microserver'
        list proto 'tcp'
        option src 'lan'
        option src_port '80'
        option dest_ip '192.168.2.200'
        option dest_port '5001'
        option target 'MASQUERADE'

config rule 'wg'
        option name 'Allow-WireGuard'
        option src 'wan'
        option dest_port '51820'
        option proto 'udp'
        option target 'ACCEPT'

# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
# Generated by iptables-save v1.8.3 on Sat Feb 27 15:12:48 2021
*nat
:PREROUTING ACCEPT [2546:361404]
:INPUT ACCEPT [536:34026]
:OUTPUT ACCEPT [351:25992]
:POSTROUTING ACCEPT [71:5398]
:postrouting_lan_rule - [0:0]
:postrouting_rule - [0:0]
:postrouting_wan_rule - [0:0]
:prerouting_lan_rule - [0:0]
:prerouting_rule - [0:0]
:prerouting_wan_rule - [0:0]
:zone_lan_postrouting - [0:0]
:zone_lan_prerouting - [0:0]
:zone_wan_postrouting - [0:0]
:zone_wan_prerouting - [0:0]
[2546:361404] -A PREROUTING -m comment --comment "!fw3: Custom prerouting rule chain" -j prerouting_rule
[1964:304761] -A PREROUTING -i br-lan -m comment --comment "!fw3" -j zone_lan_prerouting
[298:19271] -A PREROUTING -i wg0 -m comment --comment "!fw3" -j zone_lan_prerouting
[102:5373] -A PREROUTING -i pppoe-wan -m comment --comment "!fw3" -j zone_wan_prerouting
[182:31999] -A PREROUTING -i eth0.2 -m comment --comment "!fw3" -j zone_wan_prerouting
[1200:171031] -A POSTROUTING -m comment --comment "!fw3: Custom postrouting rule chain" -j postrouting_rule
[49:3900] -A POSTROUTING -o br-lan -m comment --comment "!fw3" -j zone_lan_postrouting
[0:0] -A POSTROUTING -o wg0 -m comment --comment "!fw3" -j zone_lan_postrouting
[1129:165633] -A POSTROUTING -o pppoe-wan -m comment --comment "!fw3" -j zone_wan_postrouting
[0:0] -A POSTROUTING -o eth0.2 -m comment --comment "!fw3" -j zone_wan_postrouting
[49:3900] -A zone_lan_postrouting -m comment --comment "!fw3: Custom lan postrouting rule chain" -j postrouting_lan_rule
[0:0] -A zone_lan_postrouting -s 192.168.2.0/24 -d 192.168.2.1/32 -p tcp -m tcp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j SNAT --to-source 192.168.2.1
[0:0] -A zone_lan_postrouting -s 192.168.2.0/24 -d 192.168.2.1/32 -p udp -m udp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j SNAT --to-source 192.168.2.1
[0:0] -A zone_lan_postrouting -s 10.200.200.0/24 -d 192.168.2.1/32 -p tcp -m tcp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j SNAT --to-source 10.200.200.1
[0:0] -A zone_lan_postrouting -s 10.200.200.0/24 -d 192.168.2.1/32 -p udp -m udp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j SNAT --to-source 10.200.200.1
[0:0] -A zone_lan_postrouting -d 192.168.2.200/32 -p tcp -m tcp --sport 80 --dport 5001 -m comment --comment "!fw3: microserver" -j MASQUERADE
[2262:324032] -A zone_lan_prerouting -m comment --comment "!fw3: Custom lan prerouting rule chain" -j prerouting_lan_rule
[0:0] -A zone_lan_prerouting -s 192.168.2.0/24 -d 109.136.103.143/32 -p tcp -m tcp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j DNAT --to-destination 192.168.2.1:5201
[0:0] -A zone_lan_prerouting -s 192.168.2.0/24 -d 109.136.103.143/32 -p udp -m udp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j DNAT --to-destination 192.168.2.1:5201
[0:0] -A zone_lan_prerouting -s 10.200.200.0/24 -d 109.136.103.143/32 -p tcp -m tcp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j DNAT --to-destination 192.168.2.1:5201
[0:0] -A zone_lan_prerouting -s 10.200.200.0/24 -d 109.136.103.143/32 -p udp -m udp --dport 5201 -m comment --comment "!fw3: iperf3 (reflection)" -j DNAT --to-destination 192.168.2.1:5201
[1129:165633] -A zone_wan_postrouting -m comment --comment "!fw3: Custom wan postrouting rule chain" -j postrouting_wan_rule
[1129:165633] -A zone_wan_postrouting -m comment --comment "!fw3" -j MASQUERADE
[284:37372] -A zone_wan_prerouting -m comment --comment "!fw3: Custom wan prerouting rule chain" -j prerouting_wan_rule
[0:0] -A zone_wan_prerouting -p tcp -m tcp --dport 5201 -m comment --comment "!fw3: iperf3" -j DNAT --to-destination 192.168.2.1:5201
[0:0] -A zone_wan_prerouting -p udp -m udp --dport 5201 -m comment --comment "!fw3: iperf3" -j DNAT --to-destination 192.168.2.1:5201
COMMIT
# Completed on Sat Feb 27 15:12:48 2021
# Generated by iptables-save v1.8.3 on Sat Feb 27 15:12:48 2021
*mangle
:PREROUTING ACCEPT [18994:3415911]
:INPUT ACCEPT [12846:2630639]
:FORWARD ACCEPT [4956:540690]
:OUTPUT ACCEPT [14444:11169362]
:POSTROUTING ACCEPT [19379:11708468]
[608:34640] -A FORWARD -o pppoe-wan -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
[0:0] -A FORWARD -o eth0.2 -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "!fw3: Zone wan MTU fixing" -j TCPMSS --clamp-mss-to-pmtu
COMMIT
# Completed on Sat Feb 27 15:12:48 2021
# Generated by iptables-save v1.8.3 on Sat Feb 27 15:12:48 2021
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
:forwarding_lan_rule - [0:0]
:forwarding_rule - [0:0]
:forwarding_wan_rule - [0:0]
:input_lan_rule - [0:0]
:input_rule - [0:0]
:input_wan_rule - [0:0]
:output_lan_rule - [0:0]
:output_rule - [0:0]
:output_wan_rule - [0:0]
:reject - [0:0]
:syn_flood - [0:0]
:zone_lan_dest_ACCEPT - [0:0]
:zone_lan_forward - [0:0]
:zone_lan_input - [0:0]
:zone_lan_output - [0:0]
:zone_lan_src_ACCEPT - [0:0]
:zone_wan_dest_ACCEPT - [0:0]
:zone_wan_dest_REJECT - [0:0]
:zone_wan_forward - [0:0]
:zone_wan_input - [0:0]
:zone_wan_output - [0:0]
:zone_wan_src_REJECT - [0:0]
[639:58249] -A INPUT -i lo -m comment --comment "!fw3" -j ACCEPT
[12208:2572442] -A INPUT -m comment --comment "!fw3: Custom input rule chain" -j input_rule
[1668:267694] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[265:12712] -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m comment --comment "!fw3" -j syn_flood
[10324:2294496] -A INPUT -i br-lan -m comment --comment "!fw3" -j zone_lan_input
[16:1023] -A INPUT -i wg0 -m comment --comment "!fw3" -j zone_lan_input
[192:8973] -A INPUT -i pppoe-wan -m comment --comment "!fw3" -j zone_wan_input
[8:256] -A INPUT -i eth0.2 -m comment --comment "!fw3" -j zone_wan_input
[4956:540690] -A FORWARD -m comment --comment "!fw3: Custom forwarding rule chain" -j forwarding_rule
[4176:397535] -A FORWARD -m comment --comment "!fw3: Traffic offloading" -m conntrack --ctstate RELATED,ESTABLISHED -j FLOWOFFLOAD --hw
[4176:397535] -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[498:124907] -A FORWARD -i br-lan -m comment --comment "!fw3" -j zone_lan_forward
[282:18248] -A FORWARD -i wg0 -m comment --comment "!fw3" -j zone_lan_forward
[0:0] -A FORWARD -i pppoe-wan -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -i eth0.2 -m comment --comment "!fw3" -j zone_wan_forward
[0:0] -A FORWARD -m comment --comment "!fw3" -j reject
[639:58249] -A OUTPUT -o lo -m comment --comment "!fw3" -j ACCEPT
[13806:11111821] -A OUTPUT -m comment --comment "!fw3: Custom output rule chain" -j output_rule
[1987:1136364] -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "!fw3" -j ACCEPT
[11472:9950931] -A OUTPUT -o br-lan -m comment --comment "!fw3" -j zone_lan_output
[0:0] -A OUTPUT -o wg0 -m comment --comment "!fw3" -j zone_lan_output
[347:24526] -A OUTPUT -o pppoe-wan -m comment --comment "!fw3" -j zone_wan_output
[0:0] -A OUTPUT -o eth0.2 -m comment --comment "!fw3" -j zone_wan_output
[185:7440] -A reject -p tcp -m comment --comment "!fw3" -j REJECT --reject-with tcp-reset
[7:1533] -A reject -m comment --comment "!fw3" -j REJECT --reject-with icmp-port-unreachable
[265:12712] -A syn_flood -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 25/sec --limit-burst 50 -m comment --comment "!fw3" -j RETURN
[0:0] -A syn_flood -m comment --comment "!fw3" -j DROP
[11513:9953391] -A zone_lan_dest_ACCEPT -o br-lan -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_lan_dest_ACCEPT -o wg0 -m comment --comment "!fw3" -j ACCEPT
[780:143155] -A zone_lan_forward -m comment --comment "!fw3: Custom lan forwarding rule chain" -j forwarding_lan_rule
[780:143155] -A zone_lan_forward -m comment --comment "!fw3: Zone lan to wan forwarding policy" -j zone_wan_dest_ACCEPT
[0:0] -A zone_lan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[41:2460] -A zone_lan_forward -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[10340:2295519] -A zone_lan_input -m comment --comment "!fw3: Custom lan input rule chain" -j input_lan_rule
[0:0] -A zone_lan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[10340:2295519] -A zone_lan_input -m comment --comment "!fw3" -j zone_lan_src_ACCEPT
[11472:9950931] -A zone_lan_output -m comment --comment "!fw3: Custom lan output rule chain" -j output_lan_rule
[11472:9950931] -A zone_lan_output -m comment --comment "!fw3" -j zone_lan_dest_ACCEPT
[10324:2294496] -A zone_lan_src_ACCEPT -i br-lan -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[16:1023] -A zone_lan_src_ACCEPT -i wg0 -m conntrack --ctstate NEW,UNTRACKED -m comment --comment "!fw3" -j ACCEPT
[21:1584] -A zone_wan_dest_ACCEPT -o pppoe-wan -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[1065:163637] -A zone_wan_dest_ACCEPT -o pppoe-wan -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_ACCEPT -o eth0.2 -m conntrack --ctstate INVALID -m comment --comment "!fw3: Prevent NAT leakage" -j DROP
[0:0] -A zone_wan_dest_ACCEPT -o eth0.2 -m comment --comment "!fw3" -j ACCEPT
[0:0] -A zone_wan_dest_REJECT -o pppoe-wan -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_dest_REJECT -o eth0.2 -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_forward -m comment --comment "!fw3: Custom wan forwarding rule chain" -j forwarding_wan_rule
[0:0] -A zone_wan_forward -p esp -m comment --comment "!fw3: Allow-IPSec-ESP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -p udp -m udp --dport 500 -m comment --comment "!fw3: Allow-ISAKMP" -j zone_lan_dest_ACCEPT
[0:0] -A zone_wan_forward -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port forwards" -j ACCEPT
[0:0] -A zone_wan_forward -m comment --comment "!fw3" -j zone_wan_dest_REJECT
[200:9229] -A zone_wan_input -m comment --comment "!fw3: Custom wan input rule chain" -j input_wan_rule
[0:0] -A zone_wan_input -p udp -m udp --dport 68 -m comment --comment "!fw3: Allow-DHCP-Renew" -j ACCEPT
[0:0] -A zone_wan_input -p icmp -m icmp --icmp-type 8 -m comment --comment "!fw3: Allow-Ping" -j ACCEPT
[8:256] -A zone_wan_input -p igmp -m comment --comment "!fw3: Allow-IGMP" -j ACCEPT
[0:0] -A zone_wan_input -p udp -m udp --dport 51820 -m comment --comment "!fw3: Allow-WireGuard" -j ACCEPT
[0:0] -A zone_wan_input -m conntrack --ctstate DNAT -m comment --comment "!fw3: Accept port redirections" -j ACCEPT
[192:8973] -A zone_wan_input -m comment --comment "!fw3" -j zone_wan_src_REJECT
[347:24526] -A zone_wan_output -m comment --comment "!fw3: Custom wan output rule chain" -j output_wan_rule
[347:24526] -A zone_wan_output -m comment --comment "!fw3" -j zone_wan_dest_ACCEPT
[192:8973] -A zone_wan_src_REJECT -i pppoe-wan -m comment --comment "!fw3" -j reject
[0:0] -A zone_wan_src_REJECT -i eth0.2 -m comment --comment "!fw3" -j reject
COMMIT
# Completed on Sat Feb 27 15:12:48 2021
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
5: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.2.1/24 brd 192.168.2.255 scope global br-lan
       valid_lft forever preferred_lft forever
8: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 10.200.200.1/24 brd 10.200.200.255 scope global wg0
       valid_lft forever preferred_lft forever
9: pppoe-wan: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc fq_codel state UNKNOWN group default qlen 3
    inet 109.136.103.143 peer 10.24.1.40/32 scope global pppoe-wan
       valid_lft forever preferred_lft forever
default via 10.24.1.40 dev pppoe-wan proto static
10.24.1.40 dev pppoe-wan proto kernel scope link src 109.136.103.143
10.200.200.0/24 dev wg0 proto kernel scope link src 10.200.200.1
10.200.200.2 dev wg0 proto static scope link
10.200.200.3 dev wg0 proto static scope link
10.200.200.5 dev wg0 proto static scope link
192.168.2.0/24 dev br-lan proto kernel scope link src 192.168.2.1
broadcast 10.200.200.0 dev wg0 table local proto kernel scope link src 10.200.200.1
local 10.200.200.1 dev wg0 table local proto kernel scope host src 10.200.200.1
broadcast 10.200.200.255 dev wg0 table local proto kernel scope link src 10.200.200.1
local 109.136.103.143 dev pppoe-wan table local proto kernel scope host src 109.136.103.143
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast 192.168.2.0 dev br-lan table local proto kernel scope link src 192.168.2.1
local 192.168.2.1 dev br-lan table local proto kernel scope host src 192.168.2.1
broadcast 192.168.2.255 dev br-lan table local proto kernel scope link src 192.168.2.1
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
ls: /tmp/resolv.*/*: No such file or directory
lrwxrwxrwx    1 root     root            16 Jan 29  2020 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            32 Feb 27 14:51 /tmp/resolv.conf
-rw-r--r--    1 root     root            92 Feb 27 14:55 /tmp/resolv.conf.auto
-rw-r--r--    1 root     root            48 Feb 27 14:51 /tmp/resolv.conf.ppp
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf.auto <==
# Interface wan
nameserver 1.1.1.1
# Interface wan6
nameserver fd0c:e0ef:6457::1
search lan

==> /tmp/resolv.conf.ppp <==
nameserver 195.238.2.22
nameserver 195.238.2.21
head: /tmp/resolv.*/*: No such file or directory

The modem interface is because my openwrt is connected to my isp routeur, and i need an access to manage the isp routeur.

Please could you check & comment my actual config?

i will now install the adblock to check if there are still an issue

@trendy
I have done some more test on the android smartphone.
The dns leak test show my:
Google in case of no dns specified on the smartphone
Google in case of 192.168.2.1 is specified on the smartphone
cloudfare in case of 1.1.1.1 is specified on the smartphone.

How to force peer to use the router as dns so adblock can filter the query?

Disable DoH/DoT in your mobile browser/OS.

How to do that in android chrome ?

Toggle the switch button next to "Use secure DNS", see the screenshots:

i can only choose between use your current provider , and chose another provider.
so if i set my router 192.168.2.1 the dns resolution will be only available when the tunnel is open.
How to use the tunnel dns when the tunnel is open & use the default one when the tunnel is close?

ok thanks now it use my isp dns.
Where do i need to configure the dns for the wireguard client?
in openwrt dns dhcp tab DNS: forwardings ? dhcp option 6 ?
in lan interface ?
in wan interface?

i have read it must be setup on the wan interface

Mobile client DNS should be configured in the WG client profile, see the screenshots:

2 Likes

I meant to delete the gateway option from the modem interface, not the whole interface.

Android devices use hardcoded google nameservers, regardless of the offered one in dhcp.
Hijack dns to prevent that.

2 Likes

Hijack dns to prevent that.
[/quote]
it's supposed to work even if he secure dns is enable in chrome on android?
i have added the rule to hijack the dns trafic and acivated secure dns in chrome and the leak test still showing google dns.

No, it is using a different port and protocol.

1 Like

is there a way to force an android phone to use the the wiregard tunel dns server,
even if chrome is using secure dns?

Did you try @vgaetera's suggestion?

1 Like

yes changing the chrome browser work.
The fact it's i friend of mine, will filter all the traffic for his child.
And if the child it's smart enough i will find that changing the option on the browser to secure dns will allow him to bypass the parental control.

You can block DoH with banIP:

2 Likes
2 Likes

Many thanks @trendy & @vgaetera .
so the initial problem was solved when i adapted the config as proposed by @trendy .
i am not really sure what was wrong, but i think it's the firewall rule.
Now everything work as expected.
adblock can block all sites.
and i use ban ip to block the https dns (the list are preloaded)

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.