So my new macbook air ‘out of the box’ wasn’t able to connect to one of my data centres which requires connection via PPTP VPN.
This was very annoying, as a mobile solution for accessing the network was the macbook Air’s primary job in life. Few googles later I found the solution. The OSX vpn client doesn’t automatically create the relevant routes. There is an option to push all traffic through the VPN, or none. What if you just want to push relevant traffic to the VPN? ie. to access intranet or internal VPN services?
The steps I took:
- Create the VPN connection as per normal.
- Leave the ‘route all traffic’ Unchecked. Ensure the VPN connection comes up.
- Work out what subnets you need to route to. For me it was 220.127.116.11/24 – as the server I needed to connect to had the internal IP of 18.104.22.168
- Open up terminal
- Type ifconfig and verify there is a ppp0 connection. (This is the VPN).
- type ‘sudo nano /etc/ppp/ip-up’
- Paste in: #!/bin/sh # /etc/ppp/ip-up route add 22.214.171.124/24 $IPREMOTE
You will need to adjust the 126.96.36.199/24 to suit the subnet you want to connect to.
8. Press Ctrl + X, choose yes.
9. type ‘sudo chmod +x /etc/ppp/ip-up’
10. Disconnect and reconnect your VPN and try ping a server on your network.
Good luck and let me know if you have any problems following my instructions.