Redhat – how dhcpd handles static IPs vs DHCP reservations

dhcpdhcp-serverredhatstatic-ip

We have a RHEL 6.7 server for DHCP. I am needing some clarification on how dhcpd handles network addressing when someone wants a permanent IP address. Here is a sample config from one of our servers. My understanding is there are 2 ways to get them. A DHCP reservation and a true static IP which falls outside the DHCP scope.

subnet 192.168.100.0 netmask 255.255.255.0 {
  option domain-name "domain.net";
  option broadcast-address 192.168.100.255;
  option routers 192.168.100.1;

  # Define the scopes for this DHCP pool

  pool {
   range 192.168.100.2 192.168.100.200;
   # static reserve = 192.168.100.201 - 192.168.100.254
  }
  host static-custid {
   hardware ethernet 00:01:02:03:04:05;
   fixed-address 192.168.100.150;
  }
  host static-custid {
   hardware ethernet 00:01:02:03:04:05;
   fixed address 192.168.100.201;
  }
}

So as you can see, we have one static reserve outside the DHCP scope and one inside. My understanding is that dhcpd only knows about the one inside a declared pool since the client will be using the DHCP protocol. But for the life of me I can't get anyone here to explain to me why we are declaring static reserves for IP's not defined in a pool. Is it possible that dhcpd would know about the static reserve outside the pool and give it the 192.168.100.201 when it sees that mac address AND the client is using DHCP? I don't think this is the case because all of these static reserves that fall outside the pool are not in the dhcpd.leases file.

Best Answer

Static IPs are normally outside the pool range as you do not want static IPs assigned to other hosts. As long as the static IPs are in an IP range local (or relayed) to the DCHP server they can be served.

The leases file records which addresses from the pool have been assigned to a host and when that assignment expires. This is used to ensure that multiple hosts don't get assigned the same IP address. The presence of an active lease does not indicate that host is currently connected to the network. As static IP assignments are know by their definition, they do not need to be recorded in the lease file.

If the lease time is too long and clients frequently change, it is possible to run out of addresses while only a few hosts are currently connected. This is more likely in a hot-spot or guest network than a typical office network.