OSX Networking Problem -After an hour or so my net connection just stops
June 20, 2013 4:19 AM   Subscribe

I have a bug with my networking on OSX Mountain Lion, Put simply after an indeterminate, randomish amount of time (from 30 minutes to 10 hours) my laptop will simply stop loading or fetching new websites. This happens both over wired and wireless networks - In both cases the connection will appear to still be connected,but loading a webpage will just hang on "sending request" and a traceroute to google.com which works fine beforehand, just fails (nothing in terminal after the command). I've struggled but can't find much indication at all about this bug on the internet - can anyone help me fix this problem?

The laptop is an old macbook but otherwise works fine. It must be (I think) a software problem because the classic solution (turning the laptop off and on again) fixes the problem. I tried deleting my internet preference files but that did not seem to solve the issue

It is driving me mad and means I can't play scrolls because the connection drops all the time.
posted by Another Fine Product From The Nonsense Factory to Computers & Internet (23 answers total) 2 users marked this as a favorite
 
Your problem is DNS.

Try changing your primary DNS server to 8.8.8.8 (google's DNS server) and see if that resolves it.
posted by empath at 4:21 AM on June 20, 2013


Yeah I had the same issue a few years back when I was living in NYC (Timewarner). Changing my DNS to the google ones as empath recommended above fixed it instantly.
posted by Captain_Science at 4:26 AM on June 20, 2013


Also, your network adapter could be going to sleep. Not sure how it works in OSX, but there could be a hibernate timeout that is expiring. Been a while since I worked on an Apple, but there should be a setting somewhere if you dig down deep enough that you can switch to "never sleep" or something like that.

It is an understandable setting, especially for mobile users, but fairly worthless. Of all the things that suck battery life, the minor amount of power a network card pulls is minimal compared to other items.

Not a sure fire answer to your problem, but one worth ruling out.
posted by lampshade at 4:45 AM on June 20, 2013


I bet your problem is DHCP.

Next time it happens, you should do the following:
1. ping 8.8.8.8
2. ping (your router ip)

If you get a response, then your ip address has expired and you need it renewed. Turning networking off and on again should fix it. You may be able to fix this by upgrading your home router's firmware.
posted by devnull at 5:07 AM on June 20, 2013


Longshot, but I get that when I run JollysFastVNC.
posted by procrastination at 5:22 AM on June 20, 2013


I tried changing my DNS, a nice idea, but no dice unfortunately... the connection still cuts out.

I don't use JollysFastDNC and it is not my network adapter going to sleep.


I would think it is some obscure bug / dodgy traffic shaping from my network provider.. except I connect via a university wireless/wired connections that work fine for others in the building. Turning networking on and off again or unplugging and replugging the ethernet does nothing to fix the issue.
posted by Another Fine Product From The Nonsense Factory at 5:35 AM on June 20, 2013


what happens when you ping an ip address directly?
posted by empath at 5:50 AM on June 20, 2013


There should be an equivalent of Window's event viewer or *nix's /var/log/messages that could give you a clue as to what is going on.

But yeah, the troubleshooting should be to work up the OSI layers and find out what the problem is. Do you have a physical connection? Are packets flowing? Do you have an IP address? Can you ping 127.0.0.1? Can you ping your own IP address? Can you ping your gateway? Can you ping some other machine further up the chain by IP? Can you ping any other machines via IP? What happens when you do nslookup youruniversity.edu? google.com?

My random-ass guess is that their DHCP server is not working quite right. They are probably recycling IP addresses too quickly and causing IP address conflicts. So their DHCP server gives Computer1 an address, and he uses it and shuts down. Then you turn your computer on get the same address, because they are done with it. Everything works fine until Computer1 turns back on and tries to use the same address as you are using because he still thinks he has a lease on that address.

Another thought is: are you using your own router plugged into their network? Perhaps there is some kind of conflict going on there. Your router could be overlapping IP addresses. It should either be completely transparant, acting just as a switch and wireless access point, or it should be doing everything and handing out IP addresses in its own subnet. If the router is getting an address on one subnet, say 10.100.100.x /24, then it shouldn't also be giving out IP addresses in that same subnet. It could also be something more obscure, like it's getting an ip address of 192.168.3.122 with a subnet mask of 255.255.252.0 (/22), and giving out an IP address of 192.168.1.3 with a subnet mask of 255.255.255.0 (/24). They would seem to be on different subnets, since the third octet is different, but they actually do overlap.
posted by gjc at 6:44 AM on June 20, 2013


Another thing to try is to run a traceroute to google.com when everything is working, and then make note of the IP addresses along the path. Do it a couple of times to make sure you see the same routers along the way. Then, when your service goes funny, try pinging those IPs as I detailed above- 127.0.0.1, your IP, your default gateway, then up the chain of IPs the traceroute gave you.

The reason you have to start at the bottom of the OSI layers is because each service depends on the ones below it. If DNS isn't working, it could be because DNS it broken. Or it could be because IP is broken. Or ARP. Or a switchport. That's why you start from the bottom up, so you can discover the most serious problem first.
posted by gjc at 6:49 AM on June 20, 2013


Ok - so troubleshooting this is frustrating, because this is my only connection and it just fails at random times :)

re:empath when when the connection is broken, and I attempt to ping a random i.p address I just get either "unable to reach host" or "request timeout" messages repeatedly. and traceroute to a random i.p address just fails to work like above.

I'm not using a router plugged into the network - I'll try the steps that you suggest gjc next time I cut out. :)
posted by Another Fine Product From The Nonsense Factory at 7:13 AM on June 20, 2013


Random IP addresses aren't a good indicator. There are relatively few actual hosts out there that will respond to pings.

So just to reiterate, get that list of good IP addresses ahead of time when the connection is working so you'll have known good addresses to try when it isn't.
posted by gjc at 7:27 AM on June 20, 2013


Ok so, new, hopefully more precise:
When I ping 8.8.8.8 and my connection is working I get what I aussume is the the usual response, a series of pings of the format 64 bytes from 8.8.8.8: icmp_seq=0 ttl=48 time=11.710 ms (with 8.8.8.8 still set as my DNS btw)
Similarly when I ping the first IP in the traceroute to google.com which is 100.65.148.1 - I get a similar response.

When the connection has gone and I ping 8.8.8.8 I get - "unable to reach host" or "request timeout"
When I ping 100.65.148.1 I get host is down (may not be exact wording).

If I restart my computer... the connection will come back up again,
If I restart my network device - either through the terminal ( with sudo ifconfig en1 down/up) it will not.
If I unplug and replug my connection, it will not come back up...

I don't really understand the stuff in the middle very well, but it is that last one that confuses me - I don't understand how disabling and re-enabling the network does not work but restarting does!
posted by Another Fine Product From The Nonsense Factory at 7:54 AM on June 20, 2013


If you just do ifconfig, does it show 100.65.148.1 as your gateway on your en1 adapter?

You might want to track what IP addesses you are getting from the DHCP server, and the lease length. I don't know how to do that on OSx. But what I'm guessing is that just turning the interface off and on again, or unplugging the cable, doesn't make the computer re request an address from DHCP, where restarting does.

So what I'd do is restart, make sure it's working, then see what IP address you have.

Then when it stops working, see if anything has changed.

Then restart, see if it's working, and then see what IP address you have now.

If my guess is right, then you will have a new IP address, and if you ping the old one, you'll get an answer because some other machine has that IP address.

A thought: is your machine set to not respond to pings? Some DHCP servers will ping an IP address to test whether it is in use before assigning it to a new client. If the DHCP server doesn't get a response from you, then it assumes you aren't using the address anymore and gives it away. When that happens, you lose network connectivity.
posted by gjc at 8:41 AM on June 20, 2013


OK - if I do a straight ifconfig I get this for my en1 (ethernet connection) - its way beyond my competency to translate it - but I get the same things once my connection goes down so I've discounted that as the issue.

en1: flags=8863 mtu 1500
ether 00:1c:b3:c4:49:39
inet 169.254.236.233 netmask 0xffff0000 broadcast 169.254.255.255
media: autoselect
status: active

Can you tell me how to check if my machine is set to respond to pings? I have my mac on default settings as far as I can tell -(I checked and I don't have the firewall running - is there something else that would block that?).

I''ll google a bit and try to figure out how to get better information about my DCHP server.

p.s I tried calling a support number after my last message... the person on the other end actually told me just to turn it off and on again... If nothing else I am very happy to have tried to fix it just for that!

pps. thanks again for your help!

posted by Another Fine Product From The Nonsense Factory at 9:01 AM on June 20, 2013


You get that ip when it's working? Because that's not a valid ip. Try looking at your other interfaces.
posted by empath at 9:33 AM on June 20, 2013


That's the IP address you get if DHCP fails. You might check the DHCP settings on your router - perhaps it is expiring DHCP very quickly. Seconding the advice above to check for updated firmware for your router. Also, you can check the Console app to see if there are messages there about errors around the time your network goes out.
posted by nightwood at 9:58 AM on June 20, 2013


Sorry my mistake (if anyone is still reading this!) en1 was the wireless connection I was not using.
My active wired connection stats were:
en0: flags=8863 mtu 1500
options=2b
ether 00:1b:63:35:5f:a5
inet6 fe80::21b:63ff:fe35:5fa5%en0 prefixlen 64 scopeid 0x6
inet 100.65.148.22 netmask 0xffffff00 broadcast 100.65.148.255
inet6 2002:6441:9405:a:21b:63ff:fe35:5fa5 prefixlen 64 deprecated autoconf

if that makes more sense to anyone (I note the 100.65.148 commonality)

posted by Another Fine Product From The Nonsense Factory at 10:30 AM on June 20, 2013


If you can pin down the time when your connection goes out, take a look at your system log around that time range. What does the output look like?

(So in a terminal window, say something like "less /var/log/system.log", scroll through, and pick out lines that look like this with time stamps around the connection loss:
kernel[0]: en0::IO80211Interface::postMessage bssid changed
kernel[0]: en0: BSSID changed to 00:1f:5b:89:68:1a
kernel[0]: wlEvent: en0 en0 Link DOWN virtIf = 0
kernel[0]: AirPort: Link Down on en0. Reason 8 (Disassociated because station leaving).
kernel[0]: en0::IO80211Interface::postMessage bssid changed

Better yet, leave the log scrolling in a window ("tail -f /var/log/system.log") while the link is up and post what shows up when the link goes down...?
posted by RedOrGreen at 2:32 PM on June 20, 2013


(Huh. Or you could do what nightwood says above and use the Console app in /Applications/Utilities. Learn something new every day...)
posted by RedOrGreen at 2:36 PM on June 20, 2013


Are you connecting directly to the modem with your laptop? That's not really a great idea for a variety of reasons (mostly security -- it's not as bad a problem with OSX as it is with windows, but it's still not ideal). You should consider getting a wifi router.

That said, from what you've said, this appears to be an ISP problem, not a software problem. Call them.
posted by empath at 6:11 PM on June 20, 2013


Testing pings: when it works, find another computer to use to ping your IP address. Probably one nearby, because it might not ping over the internet. I'm not sure what happens if you ping yourself- if it doesn't work, then there is a problem. But if it works, that's not a guarantee there isn't a problem.

At this point, I think the system log is probably going to be the best way to see what's going on. Still keep track of the IP address you are getting leased.

You can also use grep to filter the system.log. Something like "less /var/log/system.log | grep en0"
posted by gjc at 6:40 PM on June 20, 2013


Update for posterity... I phoned the technical support again.. they could not fix the problem though they saw I was no-longer making network requests on their end when it cut out apparently - I eventually I got them to speak to the property manager who moved me to the room next door in my flats, which was unoccupied... the internet there works (over ethernet... so far) though the wifi still has the same problem. Problem not fixed but avoided (in a very time consuming way) for now (cross fingers - thanks to all for your invaluable help, which saved alot of phone time!)
posted by Another Fine Product From The Nonsense Factory at 12:56 PM on June 22, 2013


update to the update.. now the problem has come back :( I hate my stupid ooooollllldddd laptop but can't afford another one :(((
posted by Another Fine Product From The Nonsense Factory at 10:31 AM on July 2, 2013


« Older Seeking a gemstone epoxy   |   Best Coffee Shops for Writing in DC? Newer »
This thread is closed to new comments.