Basically I'm using Linux Centos 7 Server.

I Already Installed Openvpn And Nordvpn Servers which I use to connect my linux to.

After Establishing VPN Connection. Immediately My SSH Access Got Disconnected.

So Could You Please Inform me how to allow SSH Access To The Server While It's connected to VPN Server?

Please Provide me with a solution which gonna work whatever the server rebooted.


FYI: I USED THAT TUTORIAL ON MY SETUP https://nordvpn.com/tutorials/linux/openvpn/


I were able to find a solution for my issue by:

when you connect to the Server by its public IP address, the return packets get routed over the VPN. You need to force these packets to be routed over the public eth0 interface. These route commands should do the trick:

ip rule add from x.x.x.x table 128
ip route add table 128 to y.y.y.y/y dev eth0
ip route add table 128 default via z.z.z.z

Where x.x.x.x is your Server public IP, y.y.y.y/y should be the subnet of your Server public IP address, eth0 should be your Server public Ethernet interface, and z.z.z.z should be the default gateway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.