[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Changing IP addresses with dhclient



I think you'll need to use wireshark to figure out what's different (if
anything) about the two sets of dhcp requests.

You might want to run wireshark on another box with two NICs bridged
(cubox into one, router into the other) to ensure you see unicast as
well as broadcast traffic.

Alternatively, you could start tcpdump on the cubox early in the boot
process to create a packet trace file, and load that into wireshark
later for analysis.

Possibly the changing local time is making the local cubox dhclient not
request a lease renewal, but to request?  You could hack around this by
setting the time prior to dhcp, using the timestamp of something on
local storage - like a log file (or the "Last write time" from the
filesystem superblock).  The time will still be wrong, but at least the
machine won't have seem like it time-travelled backwards.

If you can't find anything changing between the two requests, then it's
probably down to the router policy.

Tim.


On 28/06/14 13:42, Rainer Dorsch wrote:
> Hi Ian,
>
> On Saturday 28 June 2014 10:28:33 Ian Campbell wrote:
>> On Sat, 2014-06-28 at 10:23 +0200, Rainer Dorsch wrote:
>>> The real question is why does the dhclient on the cubox-i
>>> http://cubox-i.com/ get another IP address when it asks again?
>> Is it possible that it is booting with some hardcoded default MAC
>> address which gets set to the proper one during boot, before the clock
>> change forces a second DHCP request?
> I thought about that, but the weired thing is that sometimes it has *.87 after 
> booting and changes to *.88 and sometimes the other way round. Here are two of 
> these examples
>
> rd@bokocube:/var/log$ grep "bound to" syslog
> Jan  1 01:00:10 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 342127 seconds.
> Jan  1 01:00:12 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 369324 seconds.
> Jan  1 01:00:12 bokocube ifup[238]: bound to 192.168.178.87 -- renewal in 
> 369324 seconds.
> Jun 28 11:37:08 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 371052 seconds.
> Jun 28 11:37:08 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 392786 seconds.
> Jan  1 01:00:09 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 379228 seconds.
> Jan  1 01:00:12 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 369324 seconds.
> Jan  1 01:00:12 bokocube ifup[244]: bound to 192.168.178.88 -- renewal in 
> 369324 seconds.
> Jan  1 01:00:09 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 361711 seconds.
> Jan  1 01:00:10 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 423282 seconds.
> Jan  1 01:00:10 bokocube ifup[238]: bound to 192.168.178.88 -- renewal in 
> 423282 seconds.
> Jun 28 14:02:58 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 370838 seconds.
> Jun 28 14:02:58 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 365945 seconds.
> rd@bokocube:/var/log$ 
>
> Also this is independent of setting a dhcp-client-identifier in dhclient.conf 
> or not.
>
>> Perhaps the DHCP server logs can give you a clue why it decided to give
>> a new IP address instead of reusing the existing lease?
> Unfortunately, the server side is a router, I do not see log entries from dhcp 
> requests. The only weired observation on the router is that one entry (either 
> *.87 or *.88) has an empty MAC address. But not even that is fix, also the IP 
> with the empty MAC address "oscillates".
>
> Here is the complete client log for reference:
>
> rd@bokocube:/var/log$ grep dhclient syslog
> Jan  1 01:00:08 bokocube NetworkManager[341]: <info> dhclient started with pid 
> 427
> Jan  1 01:00:08 bokocube dhclient: Internet Systems Consortium DHCP Client 
> 4.3.0
> Jan  1 01:00:08 bokocube dhclient: Copyright 2004-2014 Internet Systems 
> Consortium.
> Jan  1 01:00:08 bokocube dhclient: All rights reserved.
> Jan  1 01:00:08 bokocube dhclient: For info, please visit 
> https://www.isc.org/software/dhcp/
> Jan  1 01:00:08 bokocube dhclient: 
> Jan  1 01:00:08 bokocube dhclient: Listening on LPF/eth0/d0:63:b4:00:32:5c
> Jan  1 01:00:08 bokocube dhclient: Sending on   LPF/eth0/d0:63:b4:00:32:5c
> Jan  1 01:00:08 bokocube dhclient: Sending on   Socket/fallback
> Jan  1 01:00:08 bokocube dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 
> port 67 interval 8
> Jan  1 01:00:09 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jan  1 01:00:09 bokocube dhclient: DHCPOFFER from 192.168.178.1
> Jan  1 01:00:10 bokocube dhclient: DHCPACK from 192.168.178.1
> Jan  1 01:00:10 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 342127 seconds.
> Jan  1 01:00:12 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jan  1 01:00:12 bokocube dhclient: DHCPACK from 192.168.178.1
> Jan  1 01:00:12 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 369324 seconds.
> Jun 28 11:37:07 bokocube dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 
> port 67 interval 5
> Jun 28 11:37:07 bokocube dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 
> port 67 interval 8
> Jun 28 11:37:08 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jun 28 11:37:08 bokocube dhclient: DHCPOFFER from 192.168.178.1
> Jun 28 11:37:08 bokocube dhclient: DHCPACK from 192.168.178.1
> Jun 28 11:37:08 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 371052 seconds.
> Jun 28 11:37:08 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jun 28 11:37:08 bokocube dhclient: DHCPOFFER from 192.168.178.1
> Jun 28 11:37:08 bokocube dhclient: DHCPACK from 192.168.178.1
> Jun 28 11:37:08 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 392786 seconds.
> Jan  1 01:00:08 bokocube NetworkManager[343]: <info> dhclient started with pid 
> 431
> Jan  1 01:00:08 bokocube dhclient: Internet Systems Consortium DHCP Client 
> 4.3.0                                                                             
> Jan  1 01:00:08 bokocube dhclient: Copyright 2004-2014 Internet Systems 
> Consortium.                                                                          
> Jan  1 01:00:08 bokocube dhclient: All rights reserved.                                                                                                      
> Jan  1 01:00:08 bokocube dhclient: For info, please visit 
> https://www.isc.org/software/dhcp/                                                                 
> Jan  1 01:00:08 bokocube dhclient:                                                                                                                           
> Jan  1 01:00:08 bokocube dhclient: Listening on LPF/eth0/d0:63:b4:00:32:5c                                                                                   
> Jan  1 01:00:08 bokocube dhclient: Sending on   LPF/eth0/d0:63:b4:00:32:5c                                                                                   
> Jan  1 01:00:08 bokocube dhclient: Sending on   Socket/fallback                                                                                              
> Jan  1 01:00:08 bokocube dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 
> port 67 interval 7                                                                
> Jan  1 01:00:09 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67                                                                            
> Jan  1 01:00:09 bokocube dhclient: DHCPOFFER from 192.168.178.1                                                                                              
> Jan  1 01:00:09 bokocube dhclient: DHCPACK from 192.168.178.1                                                                                                
> Jan  1 01:00:09 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 379228 seconds.                                                                     
> Jan  1 01:00:12 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67                                                                            
> Jan  1 01:00:12 bokocube dhclient: DHCPACK from 192.168.178.1                                                                                                
> Jan  1 01:00:12 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 369324 seconds.                                                                     
> Jan  1 01:00:08 bokocube NetworkManager[344]: <info> dhclient started with pid 
> 432                                                                           
> Jan  1 01:00:08 bokocube dhclient: Internet Systems Consortium DHCP Client 
> 4.3.0                                                                             
> Jan  1 01:00:08 bokocube dhclient: Copyright 2004-2014 Internet Systems 
> Consortium.                                                                          
> Jan  1 01:00:08 bokocube dhclient: All rights reserved.                                                                                                      
> Jan  1 01:00:08 bokocube dhclient: For info, please visit 
> https://www.isc.org/software/dhcp/                                                                 
> Jan  1 01:00:08 bokocube dhclient:                                                                                                                           
> Jan  1 01:00:08 bokocube dhclient: Listening on LPF/eth0/d0:63:b4:00:32:5c                                                                                   
> Jan  1 01:00:08 bokocube dhclient: Sending on   LPF/eth0/d0:63:b4:00:32:5c
> Jan  1 01:00:08 bokocube dhclient: Sending on   Socket/fallback
> Jan  1 01:00:08 bokocube dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 
> port 67 interval 5
> Jan  1 01:00:09 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jan  1 01:00:09 bokocube dhclient: DHCPOFFER from 192.168.178.1
> Jan  1 01:00:09 bokocube dhclient: DHCPACK from 192.168.178.1
> Jan  1 01:00:09 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 361711 seconds.
> Jan  1 01:00:10 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jan  1 01:00:10 bokocube dhclient: DHCPACK from 192.168.178.1
> Jan  1 01:00:10 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 423282 seconds.
> Jun 28 14:02:57 bokocube dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 
> port 67 interval 5
> Jun 28 14:02:57 bokocube dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 
> port 67 interval 5
> Jun 28 14:02:58 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jun 28 14:02:58 bokocube dhclient: DHCPOFFER from 192.168.178.1
> Jun 28 14:02:58 bokocube dhclient: DHCPACK from 192.168.178.1
> Jun 28 14:02:58 bokocube dhclient: bound to 192.168.178.88 -- renewal in 
> 370838 seconds.
> Jun 28 14:02:58 bokocube dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 
> 67
> Jun 28 14:02:58 bokocube dhclient: DHCPOFFER from 192.168.178.1
> Jun 28 14:02:58 bokocube dhclient: DHCPACK from 192.168.178.1
> Jun 28 14:02:58 bokocube dhclient: bound to 192.168.178.87 -- renewal in 
> 365945 seconds.
> rd@bokocube:/var/log$
>
> Thanks,
> Rainer
>


Reply to: