12.1 dhcpcd permanently stuck on old lease

I have a 12.1 32-bit machine in which the dhcpcd daemon seems permanently stuck on an old lease.

Command “uname -a” says

 Linux sandrane 3.1.9-1.4-default #1 SMP Fri Jan 27 08:55:10 UTC 2012 (efb5ff4) i686 i686 i386 GNU/Linux

The dhcpcd daemon is running, command “ps aux | grep dhcpcd” reports

 root 1451 0.0  0.0 2096 764 ? S 00:07 0:00 /sbin/dhcpcd --netconfig -L -E -c /etc/sysconfig/network/scripts/dhcpcd-hook -t 0 -h sandrane eth0

In file /var/log/messages I get the following message every 20 seconds

 Apr  5 00:10:24 sandrane dhcpcd[1451]: eth0: timed out
 Apr  5 00:10:24 sandrane dhcpcd[1451]: eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
 Apr  5 00:10:24 sandrane dhcpcd[1451]: eth0: broadcasting for a lease

File /var/lib/dhcpcd/dhcpcd-eth0.info contains

 INTERFACE='eth0'
 CLASSID='dhcpcd 3.2.3'
 CLIENTID='01:00:14:6c:8e:23:d0'
 DHCPCHADDR='00:14:6c:8e:23:d0'

I tried with YaST to delete and then redefine eth0 but no change. I
tried to stop eth0 with the command “ifconfig eth0 down” and then
reboot, but no change. I tried replacing eth0 with another network
card. The command “ps aux | grep dhcpcd” now reports

 root  7149 0.0 0.0 2096 656 ? S 10:46 0:00 /sbin/dhcpcd --netconfig -L -E -c /etc/sysconfig/network/scripts/dhcpcd-hook -t 0 -h sandrane eth_s2_0

and I get the following message in /var/log/messages every 20 seconds:

 Apr  5 10:47:05 sandrane dhcpcd[7149]: eth_s2_0: timed out
 Apr  5 10:47:05 sandrane dhcpcd[7149]: eth_s2_0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth_s2_0.info'
 Apr  5 10:47:05 sandrane dhcpcd[7149]: eth_s2_0: lease information file `/var/lib/dhcpcd/dhcpcd-eth_s2_0.info' does not exist
 Apr  5 10:47:05 sandrane dhcpcd[7149]: eth_s2_0: broadcasting for a lease

Is there some way of getting dhcpcd to re-initialize and operate
correctly?

Roger

On 2012-04-05 11:36, Luo2Jie2 wrote:
>
> I have a 12.1 32-bit machine in which the dhcpcd daemon seems
> permanently stuck on an old lease.

It looks as if your server is not responding.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

> It looks as if your server is not responding.

Hi, The DHCP server is running, I just checked it, and the cable, again, by substituting
another machine (Windows XP laptop) for the openSUSE machine. The DHCP server works fine.
It served the laptop with two IP addresses in subnet 10.218.0/24, one for the cable and another
for the wireless.

Roger

Try switching to “dhclient” (instead of “dhcpcd”).

If all else fails, recommend forcing a new lease by spoofing your MAC address. If you need instructions how to change your MAC address you’ll need to post whether you"re using ifup/ifdown or Network Manager.

HTH,
TS

I waited patiently for openSUSE release 12.3, but 12.3 still uses the
same ancient dhcpcd version 3.2.3
(software.opensuse.org:) which has the same
instablity, so I fixed the problem by installing Roy Marples’ most recent
stable release dhcpcd-5.6.7 directly fromdhcpcd.

I stopped dhcpcd and copied /usr/sbin/dhcpcd to
/usr/sbin/dhcpcd-3.2.3, just in case.

I downloaded and installed dhcpcd 5.6.7. Since /sbin/dhcpcd is just a
link to /usr/sbin/dhcpcd, the installation commands become

   ./configure --sbindir=/usr/sbin
   make 
   make install

Getting it to work:
dhcpcd is called from /sbin/ifup-dhcp with hard coded arguments
“–netconfig -L -c /etc/sysconfig/network/scripts/dhcpcd-hook”. This
chokes dhcpcd 5.6.7 so I patched ifup-dhcp to remove them:

--- ifup-dhcp.orig    2013-03-04 22:47:37.000000000 +0100
+++ ifup-dhcp    2013-03-30 10:42:44.333228897 +0100
@@ -18,4 +18,5 @@
 #         Peter Poeml <poeml@suse.de>, 2002-2006
 #
+# 2012-03-30 Patched for DHCPCD version 5.6.7  Roger Price
 
 unset POSIXLY_CORRECT ; set +o posix # we're using non-posix bash features
@@ -328,4 +329,6 @@
     test "$STARTMODE" = "nfsroot" && args="-p $args"
 
+        # Simplify call of dhcpcd to allow use of dhcpcd 5.6.7 Roger Price
+        args=""        
     DHCLIENT_ARGS="$args"

This fix is enough for me, but it would be good to have a recent, and
maintained, release of dhcpcd correctly integrated into the openSUSE
distribution.

Roger

On 2013-03-30 11:46, Luo2Jie2 wrote:
> This fix is enough for me, but it would be good to have a recent, and
> maintained, release of dhcpcd correctly integrated into the openSUSE
> distribution.

You should write a bugzilla with all that info. It is the only way to
reach the responsible people.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

opensuse comes with the option to switch to “dhclient” in place of “dhcpcd”.

I had similar problems with dhcpcd constantly trying to renew the lease and solved it by switching to dhclient, thanks for the tip :slight_smile:

NOTE: when changing client via sysconfig editor. For me, after changing the client and pressing the save button, the following happens

  1. sysconfig restarts the network and after pausing at 60% progress, completes the operation
  2. eth0 (my nic, yours could be different) is up but has no ip address

I repeated this a few times and eth0 simply will not obtain an address through this operation. I even tried to restart networking manually but still no luck.

The only way I could get this to work, was to change dhcp client in sysconfig editor, then reboot the system immediately after the operation completes. After reboot, eth0 has an address and is working properly.

It’s a very rare reboot but nonetheless I have reported it as a bug.

On 2013-10-25 14:46, Tuxy Thang wrote:

> The only way I could get this to work, was to change dhcp client in
> sysconfig editor, then reboot the system immediately after the operation
> completes. After reboot, eth0 has an address and is working properly.

You need to reboot because the previous daemon is running. Restarting
the service does not work because it restarts the current daemon, not
the old one.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))