Thursday, December 13, 2007

OS X / iPod Touch DHCP timeout problem

It has been some time since I last posted, but I spent the time well, especially on a vacation in Malta. Very nice place, even in late November. Apart from one rainy day we had great weather and temperatures around 20°C. Very comfortable. Another nice aspect was the display of prices in both Maltesian Lira (Lm) and Euros, because as of January 1st, 2008 Malta will change their currency and introduce the Euro as well. Very convenient for travelers :)

Back to business: Of course I did not want to be cut off from the net completely, so apart from my girlfriend's notebook I took my iPod Touch with me. The hotel advertised free WiFi access in the lobby. The first day I went down there and connected to the network without any problems using the iPod. They provided a freely accessible, unencrypted access point.

Two days later I could not get a working link. The iPod detected the wireless network and was able to join it, however I never got an IP address from the DHCP server but ended up with one of those IPV4LL (better known as APIPA) addresses that usually don't do you any good...

Trying and renewing the DHCP lease did not help, so I decided to take the hard way and ask someone at the front desk. I was surprised when the guy I talked to showed some basic knowledge of DHCP and asked me to wait while he checked the router. A moment later he came back and told me he could not do anything, because on Sundays the technical hotline available for the staff was not available. He gave me a complementary hour of Internet access on one of the for-pay computers in the business lounge and asked me to check again on Monday.

So I did - and still had the same problem. So I went back to the front desk, again asking if they had any problems with the router leasing IP addresses. This time the person at the desk was less knowledgeable and told me "We do not have IP addresses. Just set everything to automatic and it will work.". Very helpful. I decided to try again and explained to her in layman's terms that my device being set to automatic would result in it asking their WiFi device what to do and that this did not work. She recommended moving over to the business area and try again, because "the wireless network is installed over there". Imagine the front desk being approximately 15m away from the business area. Just three steps down, no walls etc. and my iPod showing a perfectly fine signal strength for the "Lobby Wireless" network. Anyway, because she had asked nicely I went over there - and guess what - this time got an address when I hit the renew lease button...

While she was happy that she had been right and helped another one of the tech-illiterate guests, I was both happy that I finally could check my mails, but also a little confused. Trying again later with the XP notebook it dawned on me that this was simply a very slow DHCP service and apparently the iPod is not too keen on waiting longer than approximately 5 seconds (rough guess) before falling back to Zeroconf.

I went looking around the net for someone with similar problems. Turns out this does not seem to be a iPhone/iPod issue but a general Mac OS X thing. I have not tried it out (do not have a Mac), but maybe a change to /etc/dhclient.conf could work, specifying a longer timeout value - assuming that OS X uses dhclient...


Brian said...

I have had this same problem, and if you can find a Windows PC on the same network, you can get its network settings and then use a similar static IP on the Touch. For example if the Windows PC has an IP of subnet router and DNS, use all the same settings on the Touch but set the static IP to something like
I have had success with this but it requires that you have another computer already connected to the network to discover the settings.
Good luck!

Anonymous said...

I had some crazy problems where my apple DHCP would time-out and go to a self-assigned IP address that was not routable to my router. Even a VMWare PC (a virtual PC) running simultaneously on the MAC was able to "Release" and "Renew" the IP adresses nont-stop without failure by doing that manually from IPCONFIG. I assumed the MAC was at fault, so I upgraded to snow leapord. No change. I found an old copy of the disk that used to work and booted and it had the same failure.
Then, in my router which was using DD-WRT on a WRT-54GLS I disabled "use DNS Masq to assign DHCP". BINGO - everything works!!!!
This might not be the fault for many people, but I knew enough about networking to eliminate the other causes. I know other people on public networks can't do anything about this, but there is a problem between MAC OS-X and some well reviewed DHCP software.
Specifically, I was suspiscious of the MAC because the time-out to a self-assigned DHCP happened almost immediately, whereas I should not see a timeout for at least 5 seconds.