You are not logged in.

#1 2022-01-08 18:37:26

Northsoft
Member
Registered: 2021-12-25
Posts: 1

Server on PC with VPN and behind router's NAT

I used to host some apps on my home PC which is behind router with port forwarding set up. After Roskomnadzor's ban on github I've signed up to ExpressVPN and faced that after connecting to VPN (via its app) I'm no longer available to accept connections coming from router. Is there any way to fix this without modifying router's firmware? 5.15.13-arch1-1, router is wnr612v2.

Offline

#2 2022-01-11 13:10:44

qupfer
Member
Registered: 2014-04-02
Posts: 13

Re: Server on PC with VPN and behind router's NAT

You have ExprressVPN installed on the computer, which is hosting the apps?
I think the problem is, that the connection are acceptet, but the answer are routed through the VPN and that breaks the connection.

For testing purpose, I would try:
Assuming your PC have this IP: 192.168.100.10/24 on eth0, your router 192.168.100.1

# add new IP and remove old
ip addr add 192.168.100.11/24 dev eth0
ip addr del 192.168.100.10/24 dev  eth0

# start VPN

#add forwared IP again
ip addr add 192.168.100.10/24 dev eth0

# mark old ip address
ip rule add from 192.168.100.10/24 table 255 

#route old ip addr
ip route add 0.0.0.0/0 via 192.168.100.1 dev eth0 table 255

#make some tests
ping -c 1 192.168.100.1 #should fail, because this goes through VPN
ping -c 1 -I 192.168.100.11 #should fail, because this goes through VPN
ping -c 1 -I 192.168.100.10 #should work, because this goes not through VPN


Everything: untestet and may be wrong :-)

Offline

Board footer

Powered by FluxBB