Hi all,
I'm running OpenWRT (23.04.2) on a Proxmox (8.1.4) container and have successfully configured an OpenVPN client connection to PIA. I have a number of other Proxmox containers that connect to the internet via the OpenVPN connection.
I'm currently trying to migrate from OpenVPN to Wireguard. I have installed luci-proto-wireguard and have configured a Wireguard interface.
tun0 is the OpenVPN connection and wg0 is the Wireguard connection.
I can ping servers on the internet from OpenWRT on both tun0 and wg0.
I have also tested the Wireguard interfce using nslookup and traceroute by adding the following route:
# ip route add 8.8.8.8/32 via 10.8.218.218
Then running:
# nslookup bbc.com 8.8.8.8
# traceroute 8.8.8.8
At this stage. I'm fairly certain the Wireguard connection is working.
root@openwrt:/# cat /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 interface 'wan'
option proto 'dhcp'
option device 'eth0'
config interface 'wan6'
option proto 'dhcpv6'
option device 'eth0'
config interface 'lan'
option proto 'static'
option device 'eth1'
option ipaddr '10.50.50.1'
option netmask '255.255.255.0'
config interface 'wg0'
option proto 'wireguard'
option private_key 'XXXXXX'
list addresses '10.8.218.218'
list dns '10.0.0.243'
list dns '10.0.0.242'
config wireguard_wg0
option description 'Imported peer configuration'
option public_key 'YYYYYY'
list allowed_ips '0.0.0.0/0'
option persistent_keepalive '25'
option endpoint_host '154.16.81.227'
option endpoint_port '1337'
config interface 'tun0'
option proto 'dhcp'
option device 'tun0'
The issue I is when I convert my existing working firewall rules over to Wireguard, any client containers lose internet access.
Here's my existing working firewall config (sorry, can only post one image)
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'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'tun0'
list network 'wan'
list network 'wan6'
list network 'wg0'
config zone
option name 'vpn'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'tun0'
config forwarding
option src 'lan'
option dest 'vpn'
However, when I change the covered networks setting in the vpn zone to wg0, internet connectivity ceases and ping reports that "Destination Port Unreachable". However, this only starts happening if I restart the ping command after making the zone change. If I leave ping running it will continue to work. Only new connections will fail.
config zone
option name 'vpn'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'wg0'
Can anyone offer any insights into what I'm doing wrong?
Thanks