LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   "one-lease-per-client" option in ISC dhcpd dhcpd.conf file (https://www.linuxquestions.org/questions/linux-networking-3/one-lease-per-client-option-in-isc-dhcpd-dhcpd-conf-file-4175429079/)

m4rtin 09-26-2012 04:54 AM

"one-lease-per-client" option in ISC dhcpd dhcpd.conf file
 
In dhcpd.conf file there is an option to allow one client to have exactly one lease and expire old lease if dhcpd receives DHCPREQUEST:

Quote:

Originally Posted by man dhcpd.conf
one-lease-per-client flag;

If this flag is enabled, whenever a client sends a DHCPREQUEST for a particular lease, the server will automatically free any other leases the client holds.

If I add "one-lease-per-client true;" to my dhcpd.conf file and start dhclient for both eth0 and eth1 in the same machine, I still get network parameters for both interfaces. According to /var/lib/dhcp/db/dhcpd.leases file there are two leases for the same client.


How is the "client" determined? Looks like at least not by system hostname. In addition, why can I request multiple leases to different network adapters in my machine despite the fact that "one-lease-per-client true;" is enabled in dhcpd.conf?

wildwizard 09-26-2012 05:36 AM

The MAC address is what identifies a client.

If a machine has 2 network interfaces then it has 2 MAC addresses.

m4rtin 09-26-2012 05:57 AM

Quote:

Originally Posted by wildwizard (Post 4789617)
The MAC address is what identifies a client.

If a machine has 2 network interfaces then it has 2 MAC addresses.


If MAC address identifies a client, I can't see the purpose of the "one-lease-per-client true;" option because MAC addresses are globally unique. I mean if I have a machine with two different network cards, then both of those are treated as different clients by dhcpd.

wildwizard 09-27-2012 04:44 AM

It exists because you can have multiple IP's against a single MAC and some admins way want to ensure that can't happen.

You must remember that this option came into existence way back when a machine with more than one ethernet port was extremely rare, expensive and probably the dhcp server itself.


All times are GMT -5. The time now is 06:09 PM.