2

When I'm connected to my windows dedicated server and connect to a vpn server I would get disconnected from the dedicated server since its ip address would change. I found a way to overcome this by using

route add 80.237.246.185 192.168.0.1

Where 80.237.246.185 is the IP of my home PC, and 192.168.0.1 is the IP of the main gateway on the dedicated server.

I would like to switch to a Linux server but I want to make sure I can overcome this issue on Linux as well. What would be equivalent of route add 80.237.246.185 192.168.0.1 on Linux?

1 Answer 1

2

The following command routes 80.237.246.185 through gateway 192.168.0.1:

ip route add 80.237.246.185 via 192.168.0.1

An equivalent using the route command:

route add 80.237.246.185 gw 192.168.0.1

You did not mention which VPN software you are using. OpenVPN for example has a route option that automatically adds a route when the VPN is connected (255.255.255.255 matches exactly 80.237.246.185, an alternative notation is 80.237.246.185/32):

route 80.237.246.185 255.255.255.255 192.168.0.1

You can find more about these commands on their manual pages:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .