Hi all. My first post, and I am new to openwrt configuration so apologies up front for any newbie mistakes. I am looking for setup help on my newly configured routers and Wireguard site to site tunnel.
I am running 2x AC1200 routers with openwrt, in an attempt to create a VPN site to site tunnel to a friend's home network from my home network. I want my friend (site b) to be able to connect to my network shares and traverse through my internet (site a) from any site b endpoint as a test. I have laptops connected to each of the lan ports on the site routers. Each router's WAN port is using a non-routable IP connected to the ISP's router, with an Internet routable IP and wireguard port forwarded in the ISP router to the openwrt router.
I used the instructions provided here to configure openwrt: https://openwrt.org/docs/guide-user/services/vpn/wireguard/site-to-site
I also received an error on this setup, similar to what was experienced here: Problem with Script Automated WireGuard site-to-site VPN
so I manually added the forwarding configuration as described in the solution to above.
In addition to above, I added IP addresses as recommended in another post to each end of the tunnel as a good practice.
The vpn tunnel successfully established, and I am able to ping the site a router from the site b endpoint, and I am able to ping the site b router from the site a endpoint. I have enabled ping on the windows endpoint firewall settings and I am able to ping the endpoints from their respective routers (ie. I can ping endpoint A from site A router). Both endpoints have internet access through their respective gateways (currently not traversing the VPN).
I am unable to ping the site a lan endpoint from the site b lan endpoint or vice versa. I have also tried RDP to initiate a different type of traffic. I do not seem to have any endpoint to endpoint connectivity.
As a first step to troubleshoot, when I use tcpdump and testing ping from endpoints, I see the ICMP request on the lan interfaces, but no response from the endpoint on the lan interfaces. I am not sure where to go next to isolate the issue. I am very keen to learn why a fix is recommended also to understand wireguard and openwrt more deeply.
Here is my configuration with MAC addresses, the two internet routable IPs and the VPN passwords obfuscated..
Site A network and firewall settings..
root@wg_site2site_a:~# uci export network
package network
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 'fdff:ffff:ffff::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan'
config device
option name 'lan'
option macaddr 'xx'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '172.16.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'wan'
option macaddr 'xx'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
config interface 'wg_s2s_a'
option proto 'wireguard'
option private_key 'xx'
option listen_port '51830'
list addresses '10.0.1.1'
config wireguard_wg_s2s_a 's2s_vpn_site_b'
option public_key 'xx'
option preshared_key 'xx'
option description 'Site B, xx'
list allowed_ips '172.16.2.0/24'
list allowed_ips 'fdee:eeee:eeee::/48'
option route_allowed_ips '1'
option persistent_keepalive '25'
option endpoint_host 'yy'
option endpoint_port '51830'
root@wg_site2site_a:~# uci export firewall
package firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
list network 'wg_s2s_a'
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
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 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 rule 'wg_s2s_51830'
option name 'Allow-WireGuard-51830'
option src 'wan'
option dest_port '51830'
option proto 'udp'
option target 'ACCEPT'
root@wg_site2site_a:~# ip -4 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
4: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 192.168.200.10/24 brd 192.168.200.255 scope global wan
valid_lft forever preferred_lft forever
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 172.16.1.1/24 brd 172.16.1.255 scope global br-lan
valid_lft forever preferred_lft forever
9: wg_s2s_a: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN qlen 1000
inet 10.0.1.1/32 brd 255.255.255.255 scope global wg_s2s_a
valid_lft forever preferred_lft forever
root@wg_site2site_a:~# ip -4 ro li tab all
default via 192.168.200.1 dev wan src 192.168.200.10
[INTERNET IP1] via 192.168.200.1 dev wan
172.16.1.0/24 dev br-lan scope link src 172.16.1.1
172.16.2.0/24 dev wg_s2s_a scope link
192.168.200.0/24 dev wan scope link src 192.168.200.10
local 10.0.1.1 dev wg_s2s_a table local scope host src 10.0.1.1
local 127.0.0.0/8 dev lo table local scope host src 127.0.0.1
local 127.0.0.1 dev lo table local scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link src 127.0.0.1
local 172.16.1.1 dev br-lan table local scope host src 172.16.1.1
broadcast 172.16.1.255 dev br-lan table local scope link src 172.16.1.1
local 192.168.200.10 dev wan table local scope host src 192.168.200.10
broadcast 192.168.200.255 dev wan table local scope link src 192.168.200.10
root@wg_site2site_a:~# ip -4 ru
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
Site B network and firewall settings:
root@wg_site2site_b:~# uci export network
package network
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 'fdee:eeee:eeee::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan'
config device
option name 'lan'
option macaddr 'yy'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '172.16.2.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'wan'
option macaddr 'yy'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
config interface 'wg_s2s_b'
option proto 'wireguard'
option private_key 'yy'
option listen_port '51830'
list addresses '10.0.1.2'
config wireguard_wg_s2s_b 's2s_vpn_site_a'
option public_key 'yy'
option preshared_key 'yy'
option description 'Site A, yy'
list allowed_ips '172.16.1.0/24'
list allowed_ips 'fdff:ffff:ffff::/48'
option route_allowed_ips '1'
option persistent_keepalive '25'
option endpoint_host 'yy'
option endpoint_port '51830'
root@wg_site2site_b:~# uci export firewall
package firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
list network 'wg_s2s_b'
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
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 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 rule 'wg_s2s_51830'
option name 'Allow-WireGuard-51830'
option src 'wan'
option dest_port '51830'
option proto 'udp'
option target 'ACCEPT'
root@wg_site2site_b:~# ip -4 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
4: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 192.168.2.139/24 brd 192.168.2.255 scope global wan
valid_lft forever preferred_lft forever
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 172.16.2.1/24 brd 172.16.2.255 scope global br-lan
valid_lft forever preferred_lft forever
9: wg_s2s_b: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN qlen 1000
inet 10.0.1.2/32 brd 255.255.255.255 scope global wg_s2s_b
valid_lft forever preferred_lft forever
root@wg_site2site_b:~# ip -4 ro li tab all
default via 192.168.2.1 dev wan src 192.168.2.139
172.16.1.0/24 dev wg_s2s_b scope link
172.16.2.0/24 dev br-lan scope link src 172.16.2.1
[INTERNET IP2] via 192.168.2.1 dev wan
192.168.2.0/24 dev wan scope link src 192.168.2.139
local 10.0.1.2 dev wg_s2s_b table local scope host src 10.0.1.2
local 127.0.0.0/8 dev lo table local scope host src 127.0.0.1
local 127.0.0.1 dev lo table local scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link src 127.0.0.1
local 172.16.2.1 dev br-lan table local scope host src 172.16.2.1
broadcast 172.16.2.255 dev br-lan table local scope link src 172.16.2.1
local 192.168.2.139 dev wan table local scope host src 192.168.2.139
broadcast 192.168.2.255 dev wan table local scope link src 192.168.2.139
root@wg_site2site_b:~# ip -4 ru
0: from all lookup local
32766: from all lookup main
32767: from all lookup default