Connecting Mac to office VPN loses internet connection
I'm using a MacBook Pro. I've set up the VPN using settings that were on my Windows laptop.
I can connect to the VPN and see everything on the office network (ping IP addresses, view intranet sites by IP address, among others). However, nothing is accessible on the Internet. I can't even ping google.com.
I've tried sending all traffic over VPN and turning that option off. Nothing seems to work.
Does anybody have an answer for this?
EDIT:
I'm using the default VPN client on OS X, PPTP.
Your VPN server has not enabled split tunnelling, therefore all traffic is redirected through the tunnel. When the VPN client connects, it changes the default route of your machine.
The solution is to remove the rogue default route and add back your original default gateway.
To discover the IP address of your default gateway:
- disconnect from the VPN
- go to System Preferences -> select your network connection -> click Advanced -> TCP/IP
- look under 'Router'
Assuming that:
- you use your VPN tunnel to access the subnet 192.168.108.0/24
- your default gateway is 192.168.0.1
then you must:
- first connect to the VPN
- then use the route command to change the default gateway back to the original value
- and add a static route to the VPN subnet
The last two steps translate into these commands:
sudo route -nv add -net 192.168.108 -interface utun0
sudo route change default 192.168.0.1
If you can ping public IPs, but you can't resolve hostnames, it means the VPN client also replaced your DNS servers.
Go to System Preferences -> select the VPN connection -> click Advanced -> manually enter the IPs of your DNS servers there, to override the ones sent by the VPN server.