0

I have a set of Nodes which get their addresses from ISC-DHCPD. Since they boot using PXE, there will be two rounds of DHCP (one from the PXE, one from the OS) and for some reason, ISC-DHCPD will offer two different IPs. This is bad, since the numbers of the nodes are supposed to correspond to the last byte of the ip.

Here is an excerpt of the Syslog, showing whats happening:

May 25 23:16:26 cluster dhcpd: DHCPDISCOVER from 08:00:27:d3:d5:3b via eth1
May 25 23:16:27 cluster dhcpd: DHCPOFFER on 192.168.0.1 to 08:00:27:d3:d5:3b via eth1
May 25 23:16:29 cluster dhcpd: DHCPREQUEST for 192.168.0.1 (192.168.0.254) from 08:00:27:d3:d5:3b via eth1
May 25 23:16:29 cluster dhcpd: DHCPACK on 192.168.0.1 to 08:00:27:d3:d5:3b via eth1
May 25 23:17:07 cluster dhcpd: DHCPDISCOVER from 08:00:27:d3:d5:3b via eth1
May 25 23:17:08 cluster dhcpd: DHCPOFFER on 192.168.0.2 to 08:00:27:d3:d5:3b via eth1
May 25 23:17:08 cluster dhcpd: DHCPREQUEST for 192.168.0.2 (192.168.0.254) from 08:00:27:d3:d5:3b via eth1
May 25 23:17:08 cluster dhcpd: DHCPACK on 192.168.0.2 to 08:00:27:d3:d5:3b via eth1
May 25 23:17:08 cluster dhcpd: DHCPREQUEST for 192.168.0.2 (192.168.0.254) from 08:00:27:d3:d5:3b via eth1
May 25 23:17:08 cluster dhcpd: DHCPACK on 192.168.0.2 to 08:00:27:d3:d5:3b via eth1

Here is the corresponding excerpt from the leases-file:

lease 192.168.0.1 {
  starts 1 2015/05/25 21:16:28;
  ends 5 2151/07/02 03:44:43;
  cltt 1 2015/05/25 21:16:28;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 08:00:27:d3:d5:3b;
  uid "\001\010\000'\323\325;";
}
lease 192.168.0.2 {
  starts 1 2015/05/25 21:17:08;
  ends 5 2151/07/02 03:45:23;
  cltt 1 2015/05/25 21:17:08;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 08:00:27:d3:d5:3b;
}
lease 192.168.0.2 {
  starts 1 2015/05/25 21:17:08;
  ends 5 2151/07/02 03:45:23;
  cltt 1 2015/05/25 21:17:08;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet 08:00:27:d3:d5:3b;
}

This is the configuration of the dhcp-server:

ddns-update-style none;

default-lease-time -1;
max-lease-time -1;

authoritative;

allow booting;
allow bootp;
next-server 192.168.0.254;
filename "/pxelinux.0";

log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {

    range 192.168.0.1 192.168.0.253;
    interface eth1;
    option routers 192.168.0.254;
    option domain-name "cluster.hpc.org";
    option domain-name-servers 192.168.0.254;

}
  • Any news? I see similar behavior on my environment. – jirib Oct 12 '17 at 8:46
  • Isn't first lease from network card ROM? I mean, the machine was booting, it had network boot as default. Network card got IP but boot server was instructed not to continue booting from network. Thus OS booted and got different IP. – jirib Oct 12 '17 at 9:55
  • What are you trying to achieve? The DHCP server is configured to assign addresses dynamically, and every machine gets an IP address they can use. There isn't anything in your configuration specifying which IP to assign to which machine, so I don't know why you expected a different result. – kasperd Oct 28 '18 at 19:32
2

You can get it with the ignore-client-uids flags. It is included since the 4.2.0 version of isc-dchpd :

Add this line:

ignore-client-uids true;

     ignore-client-uids flag;

     If the ignore-client-uids statement is present and has a value of
     true or on, the UID for clients will not be recorded.  If this
     statement is not present or has a value of false or off, then client
     UIDs will be recorded.
| improve this answer | |
0

try something like

ddns-update-style none;

# Client control
deny duplicates;
one-lease-per-client on;

# Lease authority
default-lease-time 3600;
min-lease-time 3600;
max-lease-time 21600;

authoritative;

allow booting;
allow bootp;
next-server 192.168.0.254;
filename "/pxelinux.0";

log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {

    range 192.168.0.1 192.168.0.253;
    interface eth1;
    option routers 192.168.0.254;
    option domain-name "cluster.hpc.org";
    option domain-name-servers 192.168.0.254;

}
  deny duplicates;

   Host declarations can match client messages based on  the  DHCP  Client
   Identifier  option  or  based on the client's network hardware type and
   MAC address.   If the MAC address is used, the  host  declaration  will
   match  any  client  with that MAC address - even clients with different
   client identifiers.   This doesn't normally  happen,  but  is  possible
   when  one computer has more than one operating system installed on it -
   for example, Microsoft Windows and NetBSD or Linux.

   The duplicates flag tells the DHCP server that if a request is received
   from  a  client that matches the MAC address of a host declaration, any
   other leases matching that MAC  address  should  be  discarded  by  the
   server,  even  if the UID is not the same.   This is a violation of the
   DHCP protocol, but can prevent clients whose client identifiers  change
   regularly  from  holding  many  leases  at  the same time.  By default,
   duplicates are allowed.

sources

http://www.bctes.com/dhcpd.conf.5.html

http://www.xdracco.net/howto-configure-and-deploy-isc-dhcp-server/

| improve this answer | |
  • Sadly this isn't the solution. deny Duplicates only has an effect on host declarations. one-lease-per-client will only delete old leases when the DHCPREQUEST is recieved, but still offer an address differing from the one the existing lease has. – Nuwanda May 27 '15 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.