Knowledge Base ISC Main Website Ask a Question/Contact ISC
Why is it necessary to declare all the subnets?
Author: Cathy Almond Reference Number: AA-00274 Views: 240 Created: 2011-05-06 11:46 Last Updated: 2017-03-17 10:29 0 Rating/ Voters

It's necessary to declare the subnets in dhcpd.conf for any interfaces on which you want to use DHCP protocols:
- the subnets on which you are listening for and responding to leasequeries
- the subnets for which you are providing client leases.

The need to declare the subnets on which the server is listening as well as those for which client leases are being provided is sometimes surprising to administrators, but the necessity is because of the way that the ISC DHCP code interfaces with the kernel and networking layers of the host operating system.

Dynamic Host Configuration Protocol (RFC 2131) requires that DHCP messages from the booting clients are sourced from the all-zeroes address and sent to the all-ones limited broadcast address (0.0.0.0 and 255.255.255.255). These special addresses are used in the initial bootstrapping of a DHCP client, when the client does not yet have an address.

Without coding vast amounts of platform-specific  skulduggery, we can't reliably transmit packets of that form via a straight UDP socket; receiving packets of that form is even less reliable (and that's without default local firewall rules trying to helpfully throw out "Martians").  So we use raw sockets, and that means we open a raw socket for every interface declared on the command line, plus a UDP socket overall.

The raw sockets perform only "funny packet" transmission, these all-ones limited broadcasts or unicast-without-arps, and all packet reception. The overall UDP socket ("fallback interface" in internal parlance) has a reader that drops every packet read from it (based on the assumption that all packets read in this way are duplicates of packets read from raw sockets), and is only used to transmit "routable" replies to clients, e.g. clients performing lease renewals".

The UDP socket can be used to transmit to a renewing DHCP client, but it cannot be used to receive leasequeries.

So to receive leasequeries on other interfaces, the interface must be listed on the command line (if interfaces are listed on the command line, otherwise all interfaces are read by default) and ISC DHCP configuration requires that all read interfaces are associated with a subnet declaration.

In the example below, the administrator wants only to listen for leasequeries on this interface - the DHCP service is provided on other interfaces:

subnet 192.168.22.0 netmask 255.255.255.0 {
        not authoritative;
        ignore booting;
        }


© 2001-2017 Internet Systems Consortium

For assistance with problems and questions for which you have not been able to find an answer in our Knowledge Base, we recommend searching our community mailing list archives and/or posting your question there (you will need to register there first for your posts to be accepted). The bind-users and the dhcp-users lists particularly have a long-standing and active membership.

ISC relies on the financial support of the community to fund the development of its open source software products. If you would like to support future product evolution and maintenance as well having peace of mind knowing that our team of experts are poised to provide you with individual technical assistance whenever you call upon them, then please consider our Professional Subscription Support services - details can be found on our main website.

Feedback
  • There is no feedback for this article
Quick Jump Menu