03 Oct 2019
Tags: Linux Ssh OpenVpn




Couple ip rules and you can connect to ssh while openvpn runs!

Why?

When you run openvpn all ssh sessions get disconnected and you can’t connect anymore.

Solution

ip rule add from x.x.x.x table 128

ip route add table 128 to y.y.y.y/y dev ethX

ip route add table 128 default via z.z.z.z

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

Source | Archive