Fixing a Broken Mac VPN Connection 

I was on a wonky hotel wifi connection that dropped and reconnected a number of times while I was connected to my office VPN. Eventually, Mac OS X said something like “your connection sucks, I’m not going to let you use the VPN anymore, sorry sucker.”

At the time, that was no big deal, since I was heading out of the hotel.

But later, when I actually needed the VPN, it was a big deal.

No matter what I tried, the VPN wouldn’t connect. I googled some solutions and one solution pointed to flushing the network routes, i.e.:

sudo route flush

but that just ended up spinning up my CPU to 100% and seemingly not getting anywhere.

I decided to take a more targeted approach. I grabbed the IP for my VPN. (If you have a domain-based VPN host, you can get the IP by using this command:

dig +short vpn.hostname

(where you plug in your hostname for the vpn.hostname). Then, I ran this command:

sudo route delete 123.123.456.456

(again, where you plug your IP into the command, rather than my fake IP). Sho ’nuff, that fixed my problem. Your particular situation may be different (but hopefully not, and you’ll think I’m really smart).