You are not logged in.

#1 2013-01-24 19:23:53

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

[Solved] Length of dhcpcd lease inconsistency

This isn't really so much a problem as a matter of curiousity.  After looking at journalctl, I noticed this:

Jan 24 12:10:49 isaac-laptop dhcpcd[1101]: wlp2s0: renewing lease of 192.168.0.11
Jan 24 12:10:50 isaac-laptop dhcpcd[1101]: wlp2s0: acknowledged 192.168.0.11 from 192.168.0.1
Jan 24 12:10:50 isaac-laptop dhcpcd[1101]: wlp2s0: leased 192.168.0.11 for 3600 seconds
Jan 24 12:40:51 isaac-laptop dhcpcd[1101]: wlp2s0: renewing lease of 192.168.0.11
Jan 24 12:40:52 isaac-laptop dhcpcd[1101]: wlp2s0: acknowledged 192.168.0.11 from 192.168.0.1
Jan 24 12:40:52 isaac-laptop dhcpcd[1101]: wlp2s0: leased 192.168.0.11 for 3600 seconds
Jan 24 13:10:52 isaac-laptop dhcpcd[1101]: wlp2s0: renewing lease of 192.168.0.11
Jan 24 13:10:53 isaac-laptop dhcpcd[1101]: wlp2s0: acknowledged 192.168.0.11 from 192.168.0.1
Jan 24 13:10:53 isaac-laptop dhcpcd[1101]: wlp2s0: leased 192.168.0.11 for 3600 seconds

Why is it renewing the lease every thirty minutes (1800 seconds) but saying that it is being leased for 3600 seconds?

Last edited by the sad clown (2013-01-24 21:04:32)


I laugh, yet the joke is on me

Offline

#2 2013-01-24 19:35:39

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: [Solved] Length of dhcpcd lease inconsistency

I checked my router, and the lease time it gave was for 3600 seconds as well, at least the time it gave for my dhcp lease was 3600 seconds after the last renewal as recorded in the journal.


I laugh, yet the joke is on me

Offline

#3 2013-01-24 20:17:52

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [Solved] Length of dhcpcd lease inconsistency

Because by default renewal time is half of lease time (proabably because renewal does not involve resetting interface parameters such as MTU or changing routing table). This proabably can be changed on the server side. On your client run "/usr/sbin/dhcpcd -U <interface name>" to see variables broadcasted by the server.. For example, an almost default dnsmasq config yields:

$ /usr/sbin/dhcpcd -U wlan0
broadcast_address=10.0.0.255
dhcp_lease_time=86400   <--- 24 hours, modified in dnsmasq.conf
dhcp_message_type=5
dhcp_rebinding_time=75600   <--- haven't set
dhcp_renewal_time=43200     <--- haven't set
dhcp_server_identifier=10.0.0.1
domain_name=home
domain_name_servers=10.0.0.1
ip_address=10.0.0.11       <--- client IP
network_number=10.0.0.0
routers=10.0.0.1
subnet_cidr=24
subnet_mask=255.255.255.0

As a sidenote, why do you need such short lease time? It is typically used on large networks (like university) where users come in and leave very often.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#4 2013-01-24 20:31:18

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: [Solved] Length of dhcpcd lease inconsistency

I don't need such a short lease time, but I haven't made any modifications, so 3600 seconds seems to have been the default somewhere along the line.  I'll modify it to 86400.  Thanks.


I laugh, yet the joke is on me

Offline

#5 2013-01-24 20:59:09

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: [Solved] Length of dhcpcd lease inconsistency

OK, so I thought I could modify dhcpcd.conf and add:

leasetime 86400

But this has had no effect.  Is there somewhere else I'm supposed to be looking to make this change?

I'll start a new thread, since this has morphed into a different sort of question.

Last edited by the sad clown (2013-01-24 20:59:52)


I laugh, yet the joke is on me

Offline

#6 2013-01-24 22:40:03

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [Solved] Length of dhcpcd lease inconsistency

the sad clown wrote:

OK, so I thought I could modify dhcpcd.conf and add:

leasetime 86400

But this has had no effect.  Is there somewhere else I'm supposed to be looking to make this change?

I'll start a new thread, since this has morphed into a different sort of question.

This has to be done on the DHCP server side. The way to do this depends on your router. In most canned devices, there is an option in the web interface.

The option which you used simply instruct a client to request a particular leasetime, however, if the server sets this variable on its own, the request will be ignored.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#7 2013-01-24 23:04:31

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: [Solved] Length of dhcpcd lease inconsistency

Yeah, I figured that out.  I also figured out that my router (Netgear CG814WG) has absolutely no way (available to me) to change the lease time settings.  Quality.


I laugh, yet the joke is on me

Offline

Board footer

Powered by FluxBB