I'm trying to route just specific traffic (a specific domain) on my Mac over my company VPN. This seems to be the most recommended way to do it,

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

#!/bin/sh /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.

...but I don't understand how to determine the SUBNET value. Do I need to create a subnet? Is the subnet name for the VPN in network preferences somewhere? I really don't have a good idea of what a subnet even is, so I'm not following how to implement the solution above.

  • this belongs on SuperUser I think as per the question the OP links to.
    – Stu Wilson
    Jun 16, 2012 at 10:07
  • 1
    @StuWilson Assuming OP is using a Mac, this is on topic here. It's also on topic for SU, so if it doesn't get attention here we can try migrating it (if OP wants). Jun 16, 2012 at 15:46
  • OSX by default doesn't send all traffic once you connect a VPN, it mosty just adds you to the network with the optional DNS and search domains that you set in the VPN gui. Just leave unchecked "Send all traffic over VPN connection" in the Advanced > Options dialogue. i would recommend accepting the answer, below as well, which gives a really easy, succinct answer of what a subnet is (from the ip address perspective, i.e. if you still think it is necessary, just take the ip address you need to route, and apply it to what Matt says below.) Oct 5, 2016 at 21:33

1 Answer 1


You don't need to create a new subnet, you just need to figure out what subnet (or subnets) your company's network uses. For example, if the IP addresses on your company's network are in the ranges to, then you can use the subnet mask "". If the range is to, then you can use the broader range "". You can search for "subnet calculator" to find some tools that can help you figure out the notation for the subnet range you want to capture.

Make sure your local network doesn't overlap with the range, though. Your home network should use a different subnet (like for example) that won't conflict with your office's network.

You must log in to answer this question.

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