[Dnsmasq-discuss] Suggestion: use arp rather than ping to check
for addresses in use in DHCP
simon at thekelleys.org.uk
Thu Jul 13 12:28:04 BST 2006
Rune Kock wrote:
> While checking out dnsmasq, I noticed that it uses an ICMP-ping to
> determine if an IP-address is already in use, before allocating it to
> a new DHCP-lease.
> I could not help wonder, if it wouldn't be even better to send an
> arp-request (like the arping-program). After all, some computers have
> personal firewalls that block pings, but I don't think it is possible
> to block arp.
The problem with using ARP for this is that a DHCP server can be
attempting to allocate addresses on a remote subnet on which it doesn't
have a interface. (DHCP works over routers, providing they provide a
"DHCP-relay" function.) Since ARP isn't routed, it's only useful for
checking that an address is in use on the local subnet. ICMP _is_
routed, so it allows the DHCP server to check for in-use addresses even
when they are not local; provided that it's not blocked, of course.
Interestingly DHCP clients do the address-in-use check too, and since
the client only needs to check the local network, it does use ARP.
All this stuff is specified in RFC 2131, which is well worth a read if
you're interested in the nuts-and-bolts.
More information about the Dnsmasq-discuss