Re: [opensuse] DHCP lease requests

On 01/05/2012 08:34 AM, Lew Wolfgang wrote:
On 01/05/2012 08:26 AM, James Knott wrote:
Per Jessen wrote:
On a reboot dhcpcd has to be started, so check to see what is happening
at that point.

I think the idea is to have an immediate dhcp request when connecting to a network, which means dhcpcd should be restarted at that time.

Right, but if there's a still-valid lease showing in /var/lib/dhcpcd it
looks like the just-started dhcpcd doesn't request a new lease. At
least this how it seemed to me, I was in a hurry.

OK, I confirmed the behavior on another 12.1 x86-64 desktop.

I started the system with eth0 connected to a router which assigned a DHCP
address of I then unplugged the cable and connected to a
fully up and running network. ifconfig showed the old, and now stale, IP address.
/var/log/messages showed a "link down", then a "link up" message without
re-running dhcpcd.

I then issued a "/etc/init.d/network restart" which didn't help. Messages showed
an entry from ifup-dhcp saying the "client is already running" and repeated the
old IP address.

So I then issued a "/etc/init.d/network restart-all-dhcp-clients". This option did a
lot more as reflected in messages, but it still didn't renew the DHCP lease. It started
dhcpcd but put it in background, then dhcpcd reported "eth0 timed out". At
this point it tried to "use old lease in `/var/lib/dhcpcd/'", which
still contained the old lease info, and proceeded to reuse the old lease without
broadcasting for a new one.

I then removed the lease files in /var/lib/dhcpcd/ and re-ran
/etc/init.d/network restart-all-dhcp-clients. Now dhcpcd says the lease information
file does not exist and proceeds to broadcast for a new lease. Now it works!

So I see two issues:

1. dhcpcd doesn't seem to be tickled by the interface going down, then up (cable swap).

2. When dhcpcd does start/restart, it doesn't broadcast for a new lease if an
old one exists.

This sounds like a "feature" to streamline the boot process that turned into a bug.


To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx