I am having a weird issue with a site-to-site wireward tunnel, where traffic flows in both directions, but only for traffic initiated from one of the sites.
Let's say I have site called SERVER and site called CLIENT.
Site SERVER has several LAN networks, all within the 192.168.0.0/17 range, a public IP address, and a DDNS domain name; site CLIENT has several LAN networks, all within the 192.168.128.0/17 range, and sits behind a CGNAT.
This is the configuration on SERVER:
config interface 'wg_s2s_a'
option proto 'wireguard'
option private_key '[REDACTED]'
option listen_port '51820'
config wireguard_wg_s2s_a 's2s_vpn_site_b'
option public_key '[REDACTED]'
option preshared_key '[REDACTED]'
list allowed_ips '192.168.128.0/17'
list allowed_ips 'fdb1:f846:87e0::/48'
option route_allowed_ips '1'
option persistent_keepalive '25'
And this is the configuration con CLIENT:
config interface 'wg_s2s_b'
option proto 'wireguard'
option private_key '[REDACTED]'
option listen_port '51820'
config wireguard_wg_s2s_b 's2s_vpn_site_a'
option public_key '[REDACTED]'
option preshared_key '[REDACTED]'
option endpoint_host '[REDACTED]'
option endpoint_port '51820'
list allowed_ips '192.168.0.0/17'
list allowed_ips 'fdaf:5160:5d0f::/48'
option route_allowed_ips '1'
option persistent_keepalive '25'
The tunnel seems to be working OK on SERVER:
interface: wg_s2s_a
public key: [REDACTED]
private key: (hidden)
listening port: 51820
peer: [REDACTED]
preshared key: (hidden)
endpoint: [REDACTED]:56245
allowed ips: 192.168.128.0/17, fdb1:f846:87e0::/48
latest handshake: 1 minute ago
transfer: 71.21 KiB received, 73.57 KiB sent
persistent keepalive: every 25 seconds
The tunnel seems to be working OK on CLIENT:
interface: wg_s2s_b
public key: [REDACTED]
private key: (hidden)
listening port: 51820
peer: [REDACTED]
preshared key: (hidden)
endpoint: [REDACTED]:51820
allowed ips: 192.168.0.0/17, fdaf:5160:5d0f::/48
latest handshake: 3 seconds ago
transfer: 125.69 KiB received, 284.06 KiB sent
persistent keepalive: every 25 seconds
The routing on SERVER is also OK:
Destination Gateway Genmask Flags Metric Ref Use Iface
[REDACTED]
192.168.1.0 * 255.255.255.0 U 0 0 0 br_lan
192.168.4.0 * 255.255.255.0 U 0 0 0 br_iot
192.168.5.0 * 255.255.255.0 U 0 0 0 br_kid
192.168.7.0 * 255.255.255.0 U 0 0 0 br_ext
192.168.128.0 * 255.255.128.0 U 0 0 0 wg_s2s_a
The routing on CLIENT is also OK:
Destination Gateway Genmask Flags Metric Ref Use Iface
[REDACTED]
192.168.0.0 * 255.255.128.0 U 0 0 0 wg_s2s_b
192.168.129.0 * 255.255.255.0 U 0 0 0 br-lan
192.168.132.0 * 255.255.255.0 U 0 0 0 br-iot
192.168.135.0 * 255.255.255.0 U 0 0 0 br-ext
And now comes the fun part...
I can connect from any device (including the router) on SERVER's LAN to any device (including the router) on CLIENT's LAN. But I cannot connect from the router at CLIENT to the router at SERVER. I have tried to use tcpdump
on SERVER, and I see the packets reaching the WAN interface, but I cannot see them on the wireguard interface, it looks like wireguard is rejecting or dropping those packets.
Any idea of what can be happening here, please?