Hey everyone! I am here with a problem which has been driving me nuts the past few weeks. My setup looks as following:
- ISP-provided router which has direct internet access
- Behind that router is my OpenWrt router
- all my local devices connect to the OpenWrt router either via lan or wifi
- it runs an OpenVPN client routing all my traffic though it (this has been working fine for years)
- it also runs a web server serving a nextcloud instance which also works fine
- now I want to add a wireguard server to connect to my network from outside
What already works:
- connecting to the wireguard server when associated to the openwrt router, using its local ip as end point
- handshake works for multiple clients and all traffic goes through the wireguard server
- connecting to the wireguard server when associated to the ISP-provided internet facing router, using the lan ip provided by the isp router as end point
- same as above, works perfectly
- this tells me that wireguard is at least correctly set up
What is the problem:
- connecting to the wireguard server from the internet does not work
- I connect via a dyndns provider
- this works fine for my web server
- port forwards from the ISP-provided router to the OpenWrt router are set up and working
- a scan via nmap shows that the ports for the webserver are open while the udp port for wireguard is open|filtered
- using tcpdump on the wireguard port I see incoming traffic from the internet but for some reason my OpenWrt router does not answer when the connection comes from the internet
My conclusion so far is that something with my firewall settings is not correct. I've gone through all of it a dozen times but I cannot find the error. Here are my configs:
- firewall: https://pastebin.com/2pB86K3i
- network: https://pastebin.com/HH6vwc2a
- vpn-policy-routing: https://pastebin.com/z6Cpd1QL
vpn-policy-routing is required as the default route would otherwise go via the vpc client. This works fine for my webserver. I've mostly followed this tutorial to set up the firewall and vpn policy rules: https://github.com/stangri/openwrt_packages/blob/master/vpn-policy-routing/files/README.md#local-wireguard-server--wireguard-client-scenario-1
A few notes about the setup:
- at 192.168.1.177 is my webserver as well as a dns server (pihole)
- the wireguard server runs on port 5892
- 192.168.178.1 is the ip of the isp router
- the openvpn client and the wireguard server have their own firewall zones (vpn_zone and wg_server)
Thank you everyone for any help!