LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   dhcpcd fails to use offered lease (https://www.linuxquestions.org/questions/linux-networking-3/dhcpcd-fails-to-use-offered-lease-724265/)

subdriver 05-06-2009 07:41 PM

dhcpcd fails to use offered lease - SOLVED
 
I've had dhcpcd working correctly but then moved the HDD to another machine with the same hardware, initially eth0 didn't work as udev had renamed it because the MAC address was different; I've now edited the udev rules to reflect the new MAC address and removed the entry for the renamed NIC. Now eth0 starts up and dhcpcd shows that my DHCP sever offered a valid IP address but dhcpcd waits for a while then reverts to using a 169.xxx.xxx.xxx address as if it failed to contact the DHCP server; /var/log/messages shows:
dhcpcd [pid]: eth0: offered 192.168.0.199 from 192.168.0.1
dhcpcd [pid]: eth0: timed out
dhcpcd [pid]: eth0: probing for an IPV4LL address
dhcpcd [pid]: eth0: checking 169.254.242.112 is available on attached network
dhcpcd [pid]: eth0: using IPV4LL address 169.254.242.112

Any ideas?
The hardware is a Sun Ultra 10 and it's running Gentoo, kernel 2.6.29.gentoo-r1 in case it's relevant.

farslayer 05-07-2009 11:48 AM

Use tcpdump or wireshark to view the DHCP exchange, to see why it isn't completing..

subdriver 05-09-2009 08:17 PM

After wasting hours trying to get the floppy to work I gave up :-(
I manually configured the network (several times as I forgot to kill dhcpcd which was backgrounded) and used ssh to pull the logfile from tcpdump (the machine in question isn't running X and posting here using links is just too hard!)
This is the output generated when running dhcpcd:

00:47:16.179227 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 306
00:47:16.180712 ARP, Request who-has 192.168.0.199 tell 192.168.0.1, length 46
00:47:16.732062 IP 192.168.0.1.bootps > 192.168.0.199.bootpc: BOOTP/DHCP, Reply, length 303
00:47:16.733176 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318
00:47:17.171606 ARP, Request who-has 192.168.0.199 tell 192.168.0.1, length 46
00:47:18.171708 ARP, Request who-has 192.168.0.199 tell 192.168.0.1, length 46
00:47:20.127414 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318
00:47:27.795397 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318
00:47:43.504414 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318
00:47:46.192759 ARP, Request who-has 169.254.242.112 tell 0.0.0.0, length 28
00:47:48.057797 ARP, Request who-has 169.254.242.112 tell 0.0.0.0, length 28
00:47:49.507486 ARP, Request who-has 169.254.242.112 tell 0.0.0.0, length 28
00:47:53.605076 ARP, Request who-has 169.254.242.112 tell 169.254.242.112, length 28
00:47:55.607361 ARP, Request who-has 169.254.242.112 tell 169.254.242.112, length 28

192.168.0.1 is the router and dhcp server on my network, 08:00:20:a2:f6:15 is the MAC address of the machine I'm trying to get dhcpcd working on.
I'm not familiar enough with the protocol to figure out what's (not) going on but it seems that the machine is just ignoring the lease offer and requesting an address several more times. I'd be grateful for any insite or suggestions as to what to try next.

subdriver 05-10-2009 07:03 PM

Here's another tcpdump trace using -vvv option to get more detail:

00:53:49.914450 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 334)
0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 306, xid 0x5482b8bc, Flags [none] (0x0000)
Client-Ethernet-Address 08:00:20:a2:f6:15 (oui Unknown) [|bootp]
00:53:49.915847 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.198 tell 192.168.0.1, length 46
00:53:50.385405 IP (tos 0x10, ttl 16, id 0, offset 0, flags [none], proto UDP (17), length 331)
192.168.0.1.bootps > 192.168.0.198.bootpc: BOOTP/DHCP, Reply, length 303, xid 0x5482b8bc, Flags [none] (0x0000)
Your-IP 192.168.0.198
Server-IP 192.168.0.1
Client-Ethernet-Address 08:00:20:a2:f6:15 (oui Unknown) [|bootp]
00:53:50.403614 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 346)
0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318, xid 0x5482b8bc, secs 1, Flags [none] (0x0000)
Client-Ethernet-Address 08:00:20:a2:f6:15 (oui Unknown) [|bootp]
00:53:50.914934 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.198 tell 192.168.0.1, length 46
00:53:51.915009 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.0.198 tell 192.168.0.1, length 46
00:53:55.086505 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 346)
0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318, xid 0x5482b8bc, secs 5, Flags [none] (0x0000)
Client-Ethernet-Address 08:00:20:a2:f6:15 (oui Unknown) [|bootp]
00:54:02.677309 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 346)
0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318, xid 0x5482b8bc, secs 13, Flags [none] (0x0000)
Client-Ethernet-Address 08:00:20:a2:f6:15 (oui Unknown) [|bootp]
00:54:18.802786 IP (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 346)
0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 08:00:20:a2:f6:15 (oui Unknown), length 318, xid 0x5482b8bc, secs 29, Flags [none] (0x0000)
Client-Ethernet-Address 08:00:20:a2:f6:15 (oui Unknown) [|bootp]
00:54:19.924493 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 169.254.242.112 tell 0.0.0.0, length 28
00:54:21.789504 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 169.254.242.112 tell 0.0.0.0, length 28
00:54:23.751609 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 169.254.242.112 tell 0.0.0.0, length 28
00:54:27.847960 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 169.254.242.112 tell 169.254.242.112, length 28

The versions for the client and server are dhcpcd V4.0.12, dhcpd V3.0 rc12. The server version is pretty old so I'm going to try to update this.

subdriver 05-10-2009 09:11 PM

After trying to upgrade dhcpd I was getting messages about not being able to open the dhcpd.leases file on /var/db/ , I checked /var and found it empty and df showed it had a capacity of 0; I rebooted the server and found the HDD that /var was mounted on had died! After regressing dhcpd to the original version, modifying fstab to remove the mountpoint for /var then recreating /var , /var/lib/ , /var/lib/dhcp/ and touching /var/lib/dhcp/dhcpd.leases , I was able to start dhcpd and the client machine now correctly obtains an IP address.

farslayer 05-10-2009 10:00 PM

glad to see you found the source of the issue.. not quite what I was expecting though.. :)


All times are GMT -5. The time now is 03:02 PM.