DHCP address assignment

Let's say, for example, I config DHCP service to assign addresses from the rage 192.168.1.100 to 192.168.1.150. Will dnsmasq hand out duplicate address if:

  1. I explicitly reserve some addresses inside that range
config host
	option	name		'my-reserved-host-1'
	option	mac			'F8:D1:11:8B:91:0D'
	option	ip			'192.168.1.120'
	option	leasetime	'1d'
  1. I configure some hosts to use static addresses on their side, by manually changing their network configurations. If they has sent some packets to the router, the router may realize that such IPs are in used.
  1. No.
  2. Usually no. Dnsmasq first pings the IP it is about to hand out as DHCP lease in order to ensure that it is indeed unused. If a host in LAN manually configures a static IP and deliberately drops ICMP traffic then there might be a conflict.

#2 is never a recommended practice. In a DHCP based system it is best to let the DHCP server control all client IPs through random assignment or reservations if really needed. This centralizes the configuration making it less necessary to physically visit client machines.

Dnsmasq uses a ping test before leasing an IP. It does not examine the ARP table. Some clients including Windows in some cases may not answer pings.

There is what @jow and @mk24 said, plus what would happen if you give a device a static IP that's already given to another device by the DHCP. Some operating systems will tell you, but probably not all of them.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.