cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate IP address allocation by router

clownfish
Rising Star
Posts: 84
Thanks: 8
Fixes: 1
Registered: ‎13-11-2007

Duplicate IP address allocation by router

Hi,
I have a Thomson router supplied by PlusNet and recently it started to reset itself.  At first I thought it was because the broadband connection had become unreliable but after further investigation I think its a fault with e router's management of IP address.
This culminated yesterday with me turning on the wireless of my Android phone, using an app to try and access two devices attached to the network (a Linn DS media player and a NAS) with the app locking up until the router crashed.
I had previously on other occasions  lost sight of the NAS and Linn player and I reckon it is an IP addressing problem. 
Looking at the devices page on the router confutation screen it has shown several devices all with the same IP address.  What is more the devices connected via wireless on the WLAN all have the IP addresses labelled as static whereas the directly connected devices are have the IP address labelled as DHCP - so they are dynamic.
What seems to happen is  a wireless device starts up this gets allocated 192.168.1.65 for example.  It then goes into standby or is switched off and the router thinks it's inactive so then another different device starts up and it is also given 192.168.1.65.  However the router has saved the information about the original device and decided it has a static IP address so if you switch that on again it tries to use 192.168.1.65 for two devices at the same time.  Router crashes.
I am also pretty sure the WLAN side of the network will allocate duplicate IP addresses to those allocated on the LAN side.
The only way I have been able to cure this is to power everything off, power the router on, then power on anything that is directly connected followed by powering on ALL the various wireless devices one after the other so they are all on at the same time.  That seems to result in the router allocating and recording different IP addresses for each device and that means coexist OK.
BUT - I shouldn't really have to do this should I?  Shouldn't the router manage the WLAN IP address allocation dynamically?  I can't see any way to change this in the router configuration so am pretty sure I have no inadvertently changed anything myself to cause this to occur.
So is there a bug in the router software and do I need a new router or is there something I can change to stop this behaviour?
15 REPLIES 15
jojopillo
Plusnet Alumni (retired)
Plusnet Alumni (retired)
Posts: 9,786
Registered: ‎16-06-2010

Re: Duplicate IP address allocation by router

HI clownfish,
It does appear the router is being a little funky there.Try a factory reset and see if that cures it.
Jojo Smiley
mattturner
Grafter
Posts: 246
Thanks: 2
Registered: ‎25-06-2009

Re: Duplicate IP address allocation by router

Hi clownfish,
I'm aware of a couple of problems with the Android DHCP implementation, if you could have a read of the bug report here: http://code.google.com/p/android/issues/detail?id=11236 and let us know if this is what you are experiencing then we may be able to put it down to the Android phone.
Some background here: http://mobile.slashdot.org/story/11/04/19/0330216/Bug-Forces-Android-Devices-Off-Princeton-Campus-Ne...
If this is happening then a possible solution is to set the Android IP address manually to an IP address outside the range assigned by the DHCP server on the router.
Matt
clownfish
Rising Star
Posts: 84
Thanks: 8
Fixes: 1
Registered: ‎13-11-2007

Re: Duplicate IP address allocation by router

Hi Matt,
That was interesting.  My Android phone is at the 2.3 level and I didn't see any reports about it having DHCP problems with that version though that doesn't mean they have fixed it.  Reading through the comments on one of the links I also noticed Princeton University had banned the iPad for similar DHCP misbehaviour.  Guess what? We have one of those as well.
The thing is though both Android phones and iPad's are pretty popular WiFi devices so if their DHCP handling is so naff, why have you not had many users with such issues?  I'd also expect the Internet to be awash with this as big news.  Many people who use a Linn DS use an iPad as control point and over on the Linn forums I seem to be the only one with this problem so if the phone or the iPad misbehave over DHCP I can only conclude other routers handle this better or people have configured them manually in some way.  My router just crashes  Cry
I did myself suspect a DHCP issue but that doesn't explain why the router labels every WiFi device connected too it as having a static IP address including things like a Nintendo Wii an Asus Netbook and my work laptop which is a HP model.  What is that about?
By labelling as static I mean when you click on the Devices URL in the router config you get a list of devices then clicking on a device link takes you to the device screen and in the configuration it lists the IP address and says its static.  Do the same for a LAN connected device (not WLAN) and it says its a dynamic DHCP address.  It does seem the router is  allocating IP addresses for the WLAN and then labels them as static because I have not done anything to any device of the router to define a static IP address anywhere.
mattturner
Grafter
Posts: 246
Thanks: 2
Registered: ‎25-06-2009

Re: Duplicate IP address allocation by router

Hi clownfish,
I also found it surprising when reading this that it wasn't big news.
I'll need to do some testing to get to the bottom of this, we've got Android devices and an iPad in the office so we'll have a go at replicating.
It is possible that if devices continue to use the same IP address after the lease has expired then the router will classify them as static IP devices as it doesn't have a record of an current DHCP lease for that device.
If you log into the router over telnet and execute the following command  [  :dhcp server lease list   ], that should show you the list of leases that the DHCP server has allocated to devices. You can use the device name to identify the device based on the hostname or the mac address (depending on the device). If you have the Android (or perhaps iPad) connected to the network without an active lease defined then it would seem to indicate a problem. By default the 585v8 gives out 24 hour duration leases.
This is all speculation, I'll take a look over the next couple of days and see if I can replicate anything that you're seeing.
Matt
clownfish
Rising Star
Posts: 84
Thanks: 8
Fixes: 1
Registered: ‎13-11-2007

Re: Duplicate IP address allocation by router

I will have a go with that telnet command and see what I find. 
Is there a way to set the lease time to less than 24 hours?  If so I might do some testing myself with shorter lease times to see what happens.
Regarding DHCP leases in general do they expire regardless after the time period has elapsed or do they renew automatically for a further time period (24 hours in this case)  if a device connects again within the time period?
knowdice
Rising Star
Posts: 381
Thanks: 19
Registered: ‎25-04-2008

Re: Duplicate IP address allocation by router

Pretty sure that the way DHCP works is that the server will not issue a "used" IP address until the lease expires.
The host is meant to renew its IP lease halfway through the lease time, which in your case would be after 12 hours.
It is meant to keep on trying (if may be the DHCP server doesn't respond) until the lease expires, but, would carry on using the lease in any case till it expires.
mattturner
Grafter
Posts: 246
Thanks: 2
Registered: ‎25-06-2009

Re: Duplicate IP address allocation by router

Quote from: clownfish

Is there a way to set the lease time to less than 24 hours?  If so I might do some testing myself with shorter lease times to see what happens.

Yes, this was my thought too.
The command you'll need is:
:dhcp server pool config name=LAN_private state=enabled leasetime=80000
Where leasetime is in seconds. I've just set up my test router to 15 minutes (900 seconds) and it works well.
If you type :dhcp server pool config name=LAN_private state=enabled (with a space on the end) then press tab, you will see the full configuration options for the DHCP server.
Let me know how you get on.
Matt
WWWombat
Grafter
Posts: 1,412
Thanks: 4
Registered: ‎29-01-2009

Re: Duplicate IP address allocation by router

We have a Three MiFi device, and often have an iPad & laptop connected through it - and I've certainly had hassles in getting connections to work correctly sometimes; usually this seems to be after the iPad has gone to sleep for a while, or the laptop (Win XP) has just re-awoken from sleep. I also have an Android phone, which is occasionally set to go through the MiFi - and that *does* cause headaches.
When I've investigated, I've seen one IP used on multiple devices.
Sometimes, to clear it, I've had to change the IP allocation range on the MiFi. That can get things working again, but not always.
But this would certainly explain it...
Plusnet Customer
Using FTTC since 2011. Currently on 80/20 Unlimited Fibre Extra.
clownfish
Rising Star
Posts: 84
Thanks: 8
Fixes: 1
Registered: ‎13-11-2007

Re: Duplicate IP address allocation by router

Well I had a go at setting a short lease time and it wasn't really conclusive.  I could not provoke two devices connecting via the same IP address which I saw before.
I did manage to get a different type of IP Address Assignment for the phone and iPad.  I deleted the device from the router and let the DHCP lease expire, turned the phone on and I got "IP Address Assignment: DHCP".  I let the lease expire with the phone idle and then I got "IP Address Assignment: DHCP: Static".  Why this should be I don't know.  It seems to happen if devices are idle when the lease expires.
However on using the phones Wireless connection the next time I looked it was back at "IP Address Assignment: DHCP"
I still think there is a problem whereby when a WLAN device is changed to "IP Address Assignment: Static" a duplicate IP address can be assigned but whether this is a device problem or router problem I don't know.  
There is an option on the router device configuration to say always use the same IP address for the device (only applies to LAN connected devices I think) but I guess this would prevent it from using the IP address twice and so may help avoid clashes.  Does that sound reasonable?

mattturner
Grafter
Posts: 246
Thanks: 2
Registered: ‎25-06-2009

Re: Duplicate IP address allocation by router

Hi clownfish,
Good news is I've managed to replicate the problem using a two minute DHCP lease.
I've uploaded a couple of Wireshark packet captures here:
http://www.mattturner.plus.com/Dodgy%20Android%20DHCP.pcap
and here:
http://www.mattturner.plus.com/Dodgy%20Ipad%20DHCP.pcap
They show the Android device (a HTC phone) and an iPad2 responding to ARP requests (who has IP address xxx.xxx.xxx.xxx?) for an IP address assigned by DHCP but for which the lease has run out and no renew was requested (device sat on a table next to the router with screen off).
The Android capture shows that it keeps sending data to outside servers whereas the iPad at least doesn't do this and stays quiet on the network.
In both cases the device sends a DHCP request when the screen is turned back on and everything is fine again.
When the DHCP lease expired but the device continued to use it, the page on the router switched from 'DHCP assigned' to 'static ip', I assume this is because there is no current DHCP lease for the IP address being used.
It would be difficult to test this using the devices themselves as they seem to need to be left alone to malfunction.
Quote from: clownfish
There is an option on the router device configuration to say always use the same IP address for the device (only applies to LAN connected devices I think) but I guess this would prevent it from using the IP address twice and so may help avoid clashes.  Does that sound reasonable?

I would try this, it should fix the problem.
I really have no idea what the effects of this would be, but I'm guessing it would be less than desirable and a nightmare to track down.
Let us know how you get on.
Matt
MJN
Pro
Posts: 1,318
Thanks: 161
Fixes: 5
Registered: ‎26-08-2010

Re: Duplicate IP address allocation by router

Nice bit of detective work there Matt - whilst I don't have this problem it is nevertheless good to see the efforts you'll go to to help out!
Mathew
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,869
Thanks: 4,950
Fixes: 315
Registered: ‎04-04-2007

Re: Duplicate IP address allocation by router

Quote from: clownfish
I have a Thomson router supplied by PlusNet and recently it started to reset itself. 

Good to see Matt going to the lengths he has, and good to see that at least a partial solution has been arrived at Smiley
Forgive me if I've overlooked it or it's been asked elsewhere, but was/is the device running the latest firmware revision?

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

clownfish
Rising Star
Posts: 84
Thanks: 8
Fixes: 1
Registered: ‎13-11-2007

Re: Duplicate IP address allocation by router

I think it was running the latest firmware version available for that particular model.  I say "was" because I am no longer using it.  I replaced it with a D-Link router a friend no longer required and that has finally cured the problem.
To recap I did try and use the "always use the same IP address" for devices such as the Andriod phones but in the end that didn't prevent duplicate IP addresses being allocated and the router crashing.
I am sue if you can look at my connection statistics over recent weeks you will see a pretty regular disconnection / reconnection events occurring which have now stopped.
So far with the D-link router all devices that connect are given a separate IP address and Android phone's are also recognised in that the router displays the devices ID alongside the IP address (the old router didn't do that though it did show the MAC address). 
The default DHCP lease time is much longer on the D-Link and I have not tried shortening it to see if the same problem reoccurs when the lease expires but so far using the D-link seems to have cured the problem.
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,869
Thanks: 4,950
Fixes: 315
Registered: ‎04-04-2007

Re: Duplicate IP address allocation by router

Thanks for the clarification.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵