Hello everyone,
I have two remote routers connected to a central router through wireguard which has been working flawlessly for the past few years. Last week, one of the remote routers moved from an internet connection that was using pppoe to a provider that uses DHCP - the wan interface was updated accordingly.
All seemed well until I noticed that I had stopped receiving syslog messages from the router with the updated wan configuration. It seems that something that I can't see in the configuration has broken the wireguard route to the central router (where the syslog server lives).
Pings to the central router fail, unless the interface is specified;
root@router1:~# ping 192.168.11.11
PING 192.168.11.11 (192.168.11.11): 56 data bytes
^C
--- 192.168.11.11 ping statistics ---
7 packets transmitted, 0 packets received, 100% packet loss
root@router1:~# ping -I 192.168.21.1 192.168.11.11
PING 192.168.11.11 (192.168.11.11) from 192.168.21.1: 56 data bytes
64 bytes from 192.168.11.11: seq=0 ttl=63 time=5.066 ms
64 bytes from 192.168.11.11: seq=1 ttl=63 time=4.829 ms
64 bytes from 192.168.11.11: seq=2 ttl=63 time=4.734 ms
64 bytes from 192.168.11.11: seq=3 ttl=63 time=5.237 ms
64 bytes from 192.168.11.11: seq=4 ttl=63 time=5.879 ms
64 bytes from 192.168.11.11: seq=5 ttl=63 time=5.239 ms
^C
--- 192.168.11.11 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 4.734/5.164/5.879 ms
Versus;
root@router2:~# ping 192.168.11.11
PING 192.168.11.11 (192.168.11.11): 56 data bytes
64 bytes from 192.168.11.11: seq=0 ttl=63 time=3.001 ms
64 bytes from 192.168.11.11: seq=1 ttl=63 time=2.782 ms
64 bytes from 192.168.11.11: seq=2 ttl=63 time=3.210 ms
64 bytes from 192.168.11.11: seq=3 ttl=63 time=3.203 ms
64 bytes from 192.168.11.11: seq=4 ttl=63 time=3.012 ms
64 bytes from 192.168.11.11: seq=5 ttl=63 time=2.941 ms
^C
--- 192.168.11.11 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 2.782/3.024/3.210 ms
Here is the routing table from the first router (changed from pppoe to DHCP wan);
root@router1:~# ip route show
default via <ISP gateway> dev wan proto static src <ISP network>.255
<vpn endpoint> via <public IP> dev wan proto static
<public IP>/21 dev wan proto kernel scope link src <ISP network>.255
192.168.11.0/24 dev wg0 proto static scope link
192.168.21.0/24 dev br-lan proto kernel scope link src 192.168.21.1
192.168.99.0/24 dev wg0 proto static scope link
And the routing table from the second router;
root@router2:~# ip route show
default via 100.127.224.1 dev pppoe-wan proto static
100.127.224.1 dev pppoe-wan proto kernel scope link src 100.127.238.247
<vpn endpoint> via 100.127.224.1 dev pppoe-wan proto static
192.168.11.0/24 dev wg0 proto static scope link
192.168.12.0/24 dev br-lan proto kernel scope link src 192.168.12.1
192.168.99.0/24 dev wg0 proto static scope link
/etc/config/network from the first router;
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd8e:89f2:ebf7::/48'
option packet_steering '2'
option dhcp_default_duid '00042d9ca702d1e44b439c750f2ec9911d0a'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.12.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'pppoe'
option username <username>
option password '<password>
option ipv6 'auto'
option peerdns '0'
list dns '1.1.1.1'
list dns '1.0.0.1'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
config interface 'wg0'
option proto 'wireguard'
option private_key <privatekey>
option multipath 'off'
config wireguard_wg0
option description 'Central'
option public_key <publickey>
option preshared_key '<psk>
option route_allowed_ips '1'
option endpoint_host <vpn endpoint>
option endpoint_port '51815'
option persistent_keepalive '25'
list allowed_ips '192.168.11.0/24'
list allowed_ips '192.168.99.0/24'
/etc/config/network from the second router;
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd03:3416:2d10::/48'
option packet_steering '2'
option dhcp_default_duid '0004c444135a8b30437aa65600712118cb25'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.21.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'wan'
option macaddr <macaddress>
config interface 'wan'
option proto 'dhcp'
option device 'wan'
option peerdns '0'
list dns '1.1.1.1'
list dns '1.0.0.1'
option multipath 'off'
config interface 'wg0'
option proto 'wireguard'
option private_key <privatekey>
option multipath 'off'
config wireguard_wg0
option description 'Central'
option public_key <publickey>
option preshared_key <psk>
list allowed_ips '192.168.11.0/24'
list allowed_ips '192.168.99.0/24'
option endpoint_host <vpn endpoint>
option endpoint_port '51815'
option persistent_keepalive '25'
option route_allowed_ips '1'
Any guidance provided will be gratefully received !