Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I am trying to route traffic only for a specific domain over a VPN. I found what seems to be the answer in another question:

Create the file /etc/ppp/ip-up with following content:

/sbin/route add SUBNET $5
replacing SUBNET with subnet, you want to route through VPN (for ex.

execute as root:

chmod 0755 /etc/ppp/ip-up
This file will be executed each time you connect to VPN.

I know how to create / save the file, where I am having trouble is determining the value for SUBNET. I don't know if I have to just pick up the value of the subnet from either my ethernet or VPN network preference panels, or I need to create a subnet somehow to define it as being only applicable to a certain domain.

share|improve this question

SUBNET in this case should be the range of hosts that you wish to route through the VPN.

For example, say that you want to route traffic to these hosts via VPN:

You could either route them individually, by adding one line for each IP:

/sbin/route add $5

/sbin/route add $5

/sbin/route add $5

Or you could route the entire 192.168.1.x subnet through the tunnel:

/sbin/route add $5

If you need help on determining the number after the /, try experimenting on websites such as

share|improve this answer

You must log in to answer this question.

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