Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dhcpcd asking for a lease too frequently
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5871

PostPosted: Sat Jun 23, 2018 7:08 am    Post subject: dhcpcd asking for a lease too frequently Reply with quote

Not a major problem, but figured I'd ask around... is it just me or is dhcpcd not adhering to its lease time?

Code:
dhcpd.conf
default-lease-time 3600; # one hour
max-lease-time 14400; # four hours


Code:
daemon.log
Jun 23 02:35:14 firewall dhcpd: DHCPREQUEST for 192.168.0.12 from 80:fa:5b:48:f2:6e via eth1
Jun 23 02:35:14 firewall dhcpd: DHCPACK on 192.168.0.12 to 80:fa:5b:48:f2:6e via eth1
Jun 23 03:05:14 firewall dhcpd: DHCPREQUEST for 192.168.0.12 from 80:fa:5b:48:f2:6e via eth1
Jun 23 03:05:14 firewall dhcpd: DHCPACK on 192.168.0.12 to 80:fa:5b:48:f2:6e via eth1


That's only half an hour, not an hour. :?
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 474
Location: Somewhere in Denmark

PostPosted: Sat Jun 23, 2018 7:32 am    Post subject: Reply with quote

A DHCP client automatically attempts to renew its lease as soon as 50 percent of the lease duration has expired. The DHCP client will also attempt to renew its IP address lease each time that the computer restarts. To attempt a lease renewal, the DHCP client sends a DHCPREQUEST packet directly to the DHCP server from which the client obtained the lease.

If the DHCP client fails to renew its lease the first time, then the DHCP client broadcasts a DHCPDISCOVER packet to update its address lease when 87.5 percent of the current lease duration expires. At this stage, the DHCP client accepts a lease that any DHCP server has issued.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1707

PostPosted: Sat Jun 23, 2018 7:46 am    Post subject: Reply with quote

From my understanding, and from what a quick search on DHCP renew process works, that is as expected. In short, by dhcp will try initially at lease time/2; if that fails, it tries again about 3/4-7/8 of lease time. DHCP is designed that it renews before the ip lease expires else once it expires it drops full network and have to start from the beginning and request a new lease (at the same time interrupting network communications). Overall, having such a short lease time, is not necessarily a good thing with all the extra traffic unless you have a lot of devices coming and leaving the network in a short time fame. I'd recommend you look at your overall network usage and figure out if you need such a short lease time. Even if you do have such a high change in devices on the network, it may be better to break up your network regions such that ip leases are in different subnets based on each router/AP. I'd envision this usage would be more likely in like a coffee shop setting (i.e Starbucks or such).

http://www.tcpipguide.com/free/t_DHCPLeaseRenewalandRebindingProcesses-2.htm
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5871

PostPosted: Sun Jun 24, 2018 12:52 am    Post subject: Reply with quote

Hmm. I guess that makes sense, maybe I'll bump up the lease time a little. Thanks
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum