DHCP and static leases

At first I want to say how now how DHCP and static leases works, but still I am bit confused, so would like if someone will confirm my theories:-)

I want to use mix of static and dynamic leases. My inderstanding is that in Luci in network-interfaces I configure “DHCP server” with start 100 and limit 100.

On “General settings” I have as IP address 192.168.81.1 and mask 255.255.255.0

And now my “theories”:.)

  1. IP allocated by DHCP will be between 192.168.100 and 192.168.200, right?

  2. My static allocations + IPs I will configure directly on devices should be outside this range, right?

  3. In “Network - DHCP and DNS - static leases” should every entry have unique hostname right? I probably made mistake assigning “MyLaptop” hostname to two static entries, as my laptop have two (ethernet + wifi) mac addresses.

  4. In Active DHCP leases are shown only static + dynamic leases, but not IP confogured directly on devices. Is that OK if for device with static IP configured directly on device I will create also DHCP reservation?

  1. Yes. 192.168.81.100-192.168.81.200
  2. Yes but you could avoid using static ip on devices so like that they are seen in dhcp leases.
  3. It doesnt matter it could be the same host name if the device have two NICs.
  4. You could do that to reserve the ip for the device but since you are already using entry for that device you could go with static ip (dhcp client on device if possible)

Hostnames and IP address are two different “domains” independent of each other. An IP address can have many hostnames, and a hostname can have many IP addresses. The network itself doesn’t care, as long a every device has its own unique numerical IP address. DNS takes care of resolving hostnames to numerical IP addresses mostly for us humans who can’t remember that many numbers.

That’s recommended and helps to distinguish them. But since DHCP also checks addresses if its not already in use before its leased to a new client, its usually not a problem to have static addresses or leases inside a dynamic range.

I usually do both, fixed leases on the DHCP server and static configuration on the device:

  1. DHCP is unsafe. Anybody in your LAN could setup her own DHCP server and override yours. Important devices should not rely on DHCP.
  2. If the fixed local configuration gets lost or the device needs a reset, it will most likely default back to DHCP and I can still reach it on its usual address.
  3. Documentaion: I like to see all addresses on the list, regardless if they are static, dynamic or fixed.