OpenWrt Wireguard server LAN access

I've successfully installed and configured Wireguard server on my Openwrt router and I am able to connect via my Android phone via the Wireguard client but I cannot access my local devices. The only thing I can access is the Openwrt router itself (192.168.0.1). This is an issue because my DNS server (PiHole) is on the LAN 192.168.0.70 which I would like to use.

I've read something about post up scripts. Is this required on the Openwrt router to see local devices? If so, how do I go about adding that to the Wireguard Server configuration.

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/firewall

And your phone’s wireguard config file, too.

/etc/config/network

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

config globals 'globals'

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.0.1'
	option delegate '0'
	list dns '192.168.0.70'
	option device 'br-lan'

config interface 'wan'
	option device 'eth0.2'
	option proto 'pppoe'
	option ipv6 'auto'
	option peerdns '0'
	option username '******'
	option password '******'

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

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

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '5 0t'

config interface 'US_Nordvpn'
	option proto 'none'
	option delegate '0'
	option device 'tun0'

config interface 'MX_NordVPN'
	option proto 'none'
	option auto '1'
	option delegate '0'
	option device 'tun1'

config device
	option name 'eth0.2'
	option ipv6 '0'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth1.1'

config interface 'MG_NordVPN'
	option proto 'none'
	option device 'tun2'
	option delegate '0'

config interface 'wg0'
	option proto 'wireguard'
	option private_key '******'
	option listen_port '58282'
	list addresses '192.168.99.1/24'

config wireguard_wg0
	option description 'My S10 Galaxy'
	option public_key '******'
	list allowed_ips '192.168.99.3/32'
	option persistent_keepalive '25'
	option route_allowed_ips '1'

/etc/config/firewall

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

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

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

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 zone
	option forward 'REJECT'
	option output 'ACCEPT'
	option input 'REJECT'
	option masq '1'
	option mtu_fix '1'
	option name 'US_NordFW'
	list network 'US_Nordvpn'


config forwarding
	option dest 'US_NordFW'
	option src 'lan'

config zone
	option forward 'REJECT'
	option output 'ACCEPT'
	option name 'MX_NordFW'
	option input 'REJECT'
	option mtu_fix '1'
	option masq '1'
	list network 'MX_NordVPN'

config forwarding
	option dest 'MX_NordFW'
	option src 'lan'

config rule
	option name 'Block DNS over TLS'
	option dest_port '853'
	option target 'REJECT'
	option src 'lan'
	option dest 'wan'

config zone
	option name 'MG_NordFW'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'
	list network 'MG_NordVPN'

config forwarding
	option src 'lan'
	option dest 'MG_NordFW'

config include 'miniupnpd'
	option type 'script'
	option path '/usr/share/miniupnpd/firewall.include'
	option family 'any'
	option reload '1'

config include 'bcp38'
	option type 'script'
	option path '/usr/lib/bcp38/run.sh'
	option family 'IPv4'
	option reload '1'

config rule
	option src '*'
	option target 'ACCEPT'
	option proto 'udp'
	option dest_port '58282'
	option name 'Allow-Wireguard-Inbound'
	option family 'ipv4'


Wireguard Android conf

[Interface]
Address = 192.168.99.3/32
DNS = 192.168.0.70
PrivateKey = ***

[Peer]
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = ***:58282
PersistentKeepalive = 25
PublicKey = ***

This looks like it should work. I’d recommend removing the ipv6 allowed ips from the client config since you don’t have ipv6 configured on the router side wireguard peer. But otherwise I am not spotting the problem.

Have you tried pinging devices on your lan by IP address? What about internet (say 8.8.8.8 and google.com)?

If you run a trace route from your phone to those locations, what do you see?

What happens if you change your mobile wg config to use 8.8.8.8 for dns? You obviously won’t get lan-side dns resolution, but does anything else change?

One possible culprit is the OpenVPN connections you have established. You might try disabling those and trying again.

Also, wireguard doesn’t really have up/down scripts. You could run something in the hot plug environment, but that twill run on the interface coming up in general - it doesn’t happen on peer connections.

OK great thanks for confirming that Wireguard is set up correctly.

I can ping 8.8.8.8 but not google.com because I cannot resolve anything since the DNS (pi) isn't reachable.

If i run a traceroute to 192.168.0.70, it gets to 192.168.99.1 (the wg interface) and then just times out.

I'll start mucking with the OpenVPN connections and VPN policy routing to see if thats interfering. Thanks!

Ok that was definitely it.

Disabled all OpenVPN and VPR now it works I can see the other LAN devices but DNS resolving isn't working even though I can hit 192.168.0.70 so I have to research why the Pi isn't helping to resolve.

edit: VPN Policy Routing has an option to ignore interfaces. I've added wg0 to that list and this worked. I can see all local devices.

Now to the Pihole DNS resolving mystery...

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