shorter lease times after dhclient update

Issues related to configuring your network
drknut
Posts: 50
Joined: 2016/12/13 11:59:42

shorter lease times after dhclient update

Post by drknut » 2018/05/18 15:24:21

A few days ago, I updated the dhclient package from 4.2.5-68.el7.centos.x86_64 to 4.2.5-68.el7.centos.1.x86_64.

There were no other packages in this update.

Since then, my lease times are roughly divided by 10 : from 7500-15000 seconds to 750-1500.

I have no control on the dhcp server, it belongs to my ISP.

Any idea someone ?

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: shorter lease times after dhclient update

Post by lightman47 » 2018/05/19 14:22:38

I wonder if "you" are now requesting an address more frequently. That aside, my understanding is that the address server determines lease time.

Found this; don't know if it helps.
https://www.cyberciti.biz/faq/howto-lin ... p-address/

drknut
Posts: 50
Joined: 2016/12/13 11:59:42

Re: shorter lease times after dhclient update

Post by drknut » 2018/05/19 14:54:00

Yes "I" renew 10 times more often than before the update.

That's no problem, except for the logs filling rate.

Like you, I thought that the client had no influence on the lease time given by the server.

But the coincidence with the update made me think that the client maybe could lease a shorter time than the one given by the server.

I have yet to read the RFC.

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: shorter lease times after dhclient update

Post by lightman47 » 2018/05/19 15:03:05

Sorry, what I failed to mention but mean to - I was wondering if the update changed a dhclient setting, specifically the one you mention. I don't know WHERE this setting would be found ...

And I wonder WHY the update would do that, if so.

drknut
Posts: 50
Joined: 2016/12/13 11:59:42

Re: shorter lease times after dhclient update

Post by drknut » 2018/05/19 15:08:27

We are now two asking the same question.

Let's hope we'll attract an answer.

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: shorter lease times after dhclient update

Post by lightman47 » 2018/05/19 15:24:23

I started poking around and and eventually found /sbin/dhclient-script. It took not long to realize how over-my-head it was ...

:oops:

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: shorter lease times after dhclient update

Post by TrevorH » 2018/05/19 16:32:02

Not seeing any differences in my logs. I checked both an el6 and several el7 machines that use dhclient using:

grep -i "dhc.*renew" /var/log/messages

Code: Select all

$ rpm -qi dhclient | grep -i install
Install Date: Wed 16 May 2018 00:33:29 BST
$ sudo grep -i "dhc.*renew" /var/log/messages
May 14 19:36:19 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 17134 seconds.
May 15 00:21:53 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 20861 seconds.
May 15 06:09:34 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 17297 seconds.
May 15 10:57:51 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 19458 seconds.
May 15 16:22:09 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 19840 seconds.
May 15 21:52:50 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 16773 seconds.
May 15 21:54:00 xps13 dhclient[1075]: bound to 192.168.1.61 -- renewal in 19386 seconds.
May 16 00:34:11 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 21596 seconds.
May 16 06:34:07 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 20274 seconds.
May 16 12:12:01 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 18435 seconds.
May 16 17:19:16 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 20925 seconds.
May 16 23:08:01 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 16761 seconds.
May 17 03:47:22 xps13 dhclient[1078]: bound to 192.168.1.61 -- renewal in 18192 seconds.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

drknut
Posts: 50
Joined: 2016/12/13 11:59:42

Re: shorter lease times after dhclient update

Post by drknut » 2018/05/19 17:27:46

Thank for your logs. Here are mine :

Code: Select all

2018 May 15 21:02:43 r02 dhclient[10816]: bound to XX.XX.XX.XX -- renewal in 7557 seconds.
2018 May 15 22:17:19 r01 dhclient[11027]: bound to YY.YY.YY.YY -- renewal in 11219 seconds.
2018 May 15 23:08:43 r02 dhclient[10816]: bound to XX.XX.XX.XX -- renewal in 10606 seconds.
2018 May 16 01:24:20 r01 dhclient[11027]: bound to YY.YY.YY.YY -- renewal in 6494 seconds.
2018 May 16 02:05:31 r02 dhclient[10816]: bound to XX.XX.XX.XX -- renewal in 7135 seconds.
2018 May 16 03:12:36 r01 dhclient[11027]: bound to YY.YY.YY.YY -- renewal in 13848 seconds.
2018 May 16 04:04:28 r02 dhclient[10816]: bound to XX.XX.XX.XX -- renewal in 13500 seconds.
2018 May 16 07:03:26 r01 dhclient[11027]: bound to YY.YY.YY.YY -- renewal in 5993 seconds.
2018 May 16 07:49:30 r02 dhclient[10816]: bound to XX.XX.XX.XX -- renewal in 7230 seconds.
2018 May 16 08:25:25 r02 dhclient[46060]: bound to XX.XX.XX.XX -- renewal in 12987 seconds.
2018 May 16 08:27:53 r01 dhclient[3942]: bound to YY.YY.YY.YY -- renewal in 13135 seconds.
2018 May 16 12:01:54 r02 dhclient[46101]: bound to XX.XX.XX.XX -- renewal in 1592 seconds.
2018 May 16 12:06:50 r01 dhclient[3989]: bound to YY.YY.YY.YY -- renewal in 1469 seconds.
2018 May 16 12:28:36 r02 dhclient[46101]: bound to XX.XX.XX.XX -- renewal in 763 seconds.
2018 May 16 12:31:22 r01 dhclient[3989]: bound to YY.YY.YY.YY -- renewal in 806 seconds.
2018 May 16 12:41:34 r02 dhclient[46101]: bound to XX.XX.XX.XX -- renewal in 1610 seconds.
2018 May 16 12:44:51 r01 dhclient[3989]: bound to YY.YY.YY.YY -- renewal in 1657 seconds.
2018 May 16 13:08:27 r02 dhclient[46101]: bound to XX.XX.XX.XX -- renewal in 767 seconds.


2018 May 10 07:39:01 r02 yum[15232]: Updated: 12:dhclient-4.2.5-68.el7.centos.x86_64
2018 May 10 07:51:25 r01 yum[47342]: Updated: 12:dhclient-4.2.5-68.el7.centos.x86_64
2018 May 16 08:15:07 r01 yum[3788]: Updated: 12:dhclient-4.2.5-68.el7.centos.1.x86_64
2018 May 16 08:15:20 r02 yum[45972]: Updated: 12:dhclient-4.2.5-68.el7.centos.1.x86_64

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: shorter lease times after dhclient update

Post by TrevorH » 2018/05/19 21:35:30

That does look different apart from the very first renewal after the update. No idea why it should do that for you and not for me.

Random thoughts:
I run my own pair of DHCP servers and the one on CentOS would have been patched and restarted at the same time as the clients.

I also rebooted my client after that update as there was a kernel update for me too. I have checked a different machine and the logs there are pretty similar to the one I posted before. That one didn't get rebooted for 2 more days after the update but it doesn't show any variation in renewal times in those two days.

Could be worth breaking out wireshark and googling on how to get it to decode DHCP traffic (if it needs telling) and seeing what client/server say to each other. Also worth searching for bugs on bugzilla.redhat.com to see if it's something that's already been reported.

Got any files in /etc/dhcp/dhclient.d/ ?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

drknut
Posts: 50
Joined: 2016/12/13 11:59:42

Re: shorter lease times after dhclient update

Post by drknut » 2018/05/20 09:09:10

I must give up for now, since I have more urgent tasks in the pipe.

My findings so far : dhclient seems to work as documented.

I have put "send dhcp-lease-time 7200;" in /etc/dhcp/dhclient.conf, and I saw this option in the request.

But the server always replies with a lease time of 3600 seconds.

Even the "supersede" option is honored, but of course it is not a solution in my context.

One last thing I'd like to check : could you please post your /sbin/dhclient command line as it is displayed by the 'ps -x' command ?

If the -cf option is used, could you post the content of the file ?

If not, the content of your /etc/dhcp/dhclient.conf ?

TIA

Post Reply