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 188.8.131.52/24 – as the server I needed to connect to had the internal IP of 184.108.40.206
- 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 220.127.116.11/24 $IPREMOTE
You will need to adjust the 18.104.22.168/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.