1

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. 192.168.0.0/16)

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 '12 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). – Nathan Greenstein Jun 16 '12 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.) – forgotstackxpassword Oct 5 '16 at 21:33
2

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 10.0.0.1 to 10.0.0.255, then you can use the subnet mask "10.0.0.0/24". If the range is 10.0.0.1 to 10.0.255.255, then you can use the broader range "10.0.0.0/16". 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 192.168.0.0/24 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 .