You are not logged in.

#1 2013-09-16 13:17:36

Torxed
Member
Registered: 2013-01-10
Posts: 202

[SOLVED] dhclient & dhcpcd - Do they cache?

I saw some troubling data while monitoring `ip addr` during some firewall+dhcp scripting today.
One of them being that a private subnet-ip was given to me by a DHCP even tho i was not any where near that private subnet range hardware wise (i think, there's way to many network fault-points that can occur so my first check is to see if dhclient & dhcpcd cache addresses some how).


I'm aware that DHCP clients ask if X can be re-assigned and if not a offer is given and an acknowledgement is handshake'd and poff i got a IP.
But my question is, do they both repeatedly try to/assign faulty IP addresses even tho previous attempts failed or do they only assign "previously known" ip addresses once and then drop them from the "cache"?
Or do they "permanently" cache previous IP addresses and try them each time?


It's really hard to reproduce the issue because it occured in a nested spawning loop somehow within the script while dhcp leases was fetched (across multiple points of the day tho). Otherwise i would simply reproduce it and execute wireshark on the task and see what DHCP server was giving me the private subnet ip.

Last edited by Torxed (2013-09-17 16:03:59)

Offline

#2 2013-09-17 16:03:48

Torxed
Member
Registered: 2013-01-10
Posts: 202

Re: [SOLVED] dhclient & dhcpcd - Do they cache?

I figured it out, was so easy it makes the question look stupid.

dhclient will (after a while) start assigning previously known IP addresses to the interface and begin a PING session towards the last known gateway, and if successful assign that to the interface. Or at least that's what it looks like.

Offline

Board footer

Powered by FluxBB