I am running a VPN on my server with openvpn. When running openvpn I have a shell script that runs afterwards:

ip rule add from table 128
ip route add table 128 to dev enp5s0
ip route add table 128 default via

this allows me to be able to port forward from my hub. I am wondering whether this has completely undermined the point of having a VPN in the first place now? I did this because I needed one port on the machine to be accessible.

1 Answer 1


The VPN will take the route that finds valid at the time when its connection initializes, so it will connect with regard to the current routing settings.

If you alter routes after the VPN is connected, depending on various factors, the VPN may still work or disconnect. If it continues to work, the new routes (set by the scrip loaded after VPN is connected) will also function correctly.

So no, doing this does not defeat the purpose of the VPN.

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.