Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Where is the IP of my home PC, and 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 on Linux?

share|improve this question
up vote 2 down vote accepted

The following command routes through gateway

ip route add via

An equivalent using the route command:

route add gw

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 ( matches exactly, an alternative notation is


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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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