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.


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 http://www.subnet-calculator.com

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.