[关闭]
@haokuixi 2015-03-20T14:40:44.000000Z 字数 668 阅读 2313

Adding a custom route to a VPN in Mac OS X

macos vpn


Me and my colleagues at work were facing a problem. We're using a VPN to access our internal servers and for some reason Mac OS X always uses a 24 bit netmask with the VPN connection (when we need a 16 bit). Of course there's a solution for this.

Open your favourite text editor. Type in the following text (we happen to use the 172.16.0.0/16 network, adjust please):

  1. #!/bin/sh
  2. /sbin/route add -net 172.16 -interface ppp0

Save this file as ip-up without .txt in the end.
Open Terminal and move the file to /etc/ppp with sudo, "sudo mv /Users/username/ip-up /etc/ppp" assuming you saved it in your home folder.
The last step is to add execute permissions to the file: "sudo chmod 755 /etc/ppp/ip-up"
The route should now be added every time you connect with VPN.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注