0

I have found plenty of hints on the web to create permanent static routes to a particular gateway IP address, but I unfortunately I did not find a way to create a permanent static route to an interface.

I have a VPN connection which itself offers access to further private networks. The VPN, when connected, is available on the virtual interface utun1.

I have no problems to gain access to the further private networks when manually adding a route:

route -nv add 192.168.0.0/16 -interface utun1

However, this command is not persistent. Clearly, I could permanently add static routes, but the following command does not allow me to specify the interface.

    Usage: networksetup -setadditionalroutes <networkservice> [ <dest> <mask> 
<gateway> ]*
    Set additional IPv4 routes associated with <networkservice>
    by specifying one or more [ <dest> <mask> <gateway> ] tuples.
    Remove additional routes by specifying no arguments.
    If <gateway> is "", the route is direct to the interface 

When specifying the gateway as "", I may only address my en0 interface, but not the unet1 interface.

Furthermore, this route should only be created once the VPN connection is enabled that makes the interface unet1 available.

It would be great if someone could give me some guidance as how to further go on.

Best regards, Peter

  • Which program do you use to establish the VPN? - Usually these programs have configuration for setting additional routes. – jksoegaard Jul 11 at 16:23
  • It is the VPN tool that ships with macOS 10.13 High Sierra. I use the option "Cisco IPSec". I did not find an option to configure additional routes in there. This is the reason why I need to manually add a route. – Peter Jul 12 at 18:36

You must log in to answer this question.

Browse other questions tagged .