Lew Wolfgang wrote:
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 192.168.1.2. 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.
I don't know the exact semantics of "rcnetwork restart" - it might make sense to expect dhcpcd to renew leases (dhcpcd -n).
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/dhcpcd-eth0.info'", which still contained the old lease info, and proceeded to reuse the old lease without broadcasting for a new one.
It must have done a broadcast, otherwise why would it report "eth0 timed out"? Following a time-out, it seems reasonable to attempt a fall-back to the previous lease.
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!
The key question would appear to be - what caused the time-out on the first attempt?
So I see two issues:
1. dhcpcd doesn't seem to be tickled by the interface going down, then up (cable swap).
If it worked in a previous release, it sounds like a bug.
2. When dhcpcd does start/restart, it doesn't broadcast for a new lease if an old one exists.
Mine does. It requests the still-valid lease, and will reuse that one only if ack'ed by the dhcp server. If nack'ed, it'll broadcast for a new one. -- Per Jessen, Zürich (3.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org