Hello people,
I have openwrt on my router and I am passing ports 80 and 443 to a raspberry pi4 with nextcloud.
Everything works fine. Also I have a VPN client with a VPN provider. This I have installed and also works great. All devices in my LAN use this VPN client by default.
But as soon as the VPN client is running, the ports 80 and 443 are no longer accessible from the outside. If I turn off the VPN, the Raspberry pi is immediately accessible again.
Maybe someone could point me in the right direction.
firewall:
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
option flow_offloading '1'
option drop_invalid '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
config zone
option name 'wan'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
option input 'REJECT'
config forwarding
option src 'lan'
option dest 'wan'
config zone 'vpn_client'
option name 'vpn_cl'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
list device 'vpn1'
list device 'vpn2'
config forwarding 'vpn_client_forward'
option dest 'vpn_cl'
option src 'lan'
config redirect
option dest_port '80'
option src 'wan'
option name 'pi80'
option src_dport '80'
option dest 'lan'
option dest_ip '192.168.1.10'
option target 'DNAT'
config redirect
option dest_port '443'
option src 'wan'
option name 'pi443'
option src_dport '443'
option dest 'lan'
option dest_ip '192.168.1.10'
option target 'DNAT'
You almost certainly will need policy based routing to achieve this goal. The issue is fairly simple -- when the VPN is enabled, the default gateway (i.e. egress traffic) is via the VPN. This means that traffic entering the router by the normal WAN and port forwarding rules will end up exiting via a path that doesn't have an established connection to the original remote host that had initiated the connection. PBR can be used to solve that.
thank you for your anwer. I installed the extension and played around with it a bit.
Unfortunately without success. Attached is the config to look over.
Maybe someone can find my error.
thank you for your answer.
I have already read the readme and have played around with various settings. Unfortunately without success. My current configuration works partially. After turning on the VPN client I can reach the server for a certain time. The client works during this time, I tested this. After a certain time I can't reach the server again.
No idea why this no longer works after a certain time.
Attached is my current configuration. Maybe someone has another idea.
thank you for your feedback. I am now a few steps further. I have reset the router to factory settings and started again.
The Pi is now reachable when I am connected to the VPN client. Also I now have a VPN server running and I can connect to the home network with my Android for example.
However, there is now another problem.
The router itself has no internet.
opkg update fails and a ping to an address end with: