Network issues

2 minutes to read

I've always had problems with VPNs with OS X. What I'm going to explain next, it might be something that happens on other systems too, but I never had them.

I'm using Network Connect from Juniper Networks and I normally don't turn my mac off when I go anywhere. I always put it in sleep mode (close the lid) and move on... that gives me the extra productivity I need (and always look for).

Probably due to that, sometimes I can't access some websites (like GitHub, or have audio issues with GoToMeeting (like I can connect to the meeting, but can't connect audio). There was a day that this happened twice and I was really pissed, so like always, I decided to investigate why it would do that.

Started by checking my network connections with netstat -rn and the output gave something like:

Destination        Gateway            Flags        Refs      Use   Netif Expire
0&0x68    USc             6        0     en0
127                UCS             0        0     lo0          UH             38    21056     lo0

This basically means that the destination is completely screwed, and I know that it only happens when I use the VPN... If you turn off the wifi or the network you are using and plug it again, it doesn't solve the issue and it is really hard to do a "reset" on the network.

I found a solution that, for now, has always worked for me:

  1. go to your Network (inside System Preferences);
  2. click on the network that you were using when you connected to the VPN (normally I'm using wifi);
  3. click on Advanced button and select TCP/IP tab;
  4. choose Off on the Configure IPv4 setting;
  5. click Ok and then Apply.

Good, now repeat the steps 3 to 5 selecting Using DHCP (or the setting you had before). Confirm now what is the output of your netstat -rn command. It should be something like:

Destination        Gateway            Flags        Refs      Use   Netif Expire
default            <router_ip>        UGSc           xx        0     en1

I hope this will help you and avoid a restart 😅

Feel free to drop a comment if you still see issues or fixed in a different way.