DHCP

DHCP

From Consultancy.EdVoncken.NET

Jump to: navigation, search

The Dynamic Host Configuration Protocol (DHCP) provides clients with an IP address as well as other relevant information.

The ISC DHCP daemon supports failover configuration as well as integration with DNS for Dynamic DNS Updates.

Contents

IP Address Negotiation

The client and server exchange several messages to negotiate an IP address. Just remember "DORA":

Discover
client sends out a broadcast message
Offer
server sends out a unicast reply message, containing an IP address offer
Request
client agrees, and replies with an official request for the IP address offered
Acknowledge
server acknowledges the agreement and records the IP lease

The reply includes a Lease Time parameter - after this interval expires, the client must negotiate a new IP address.

Renewal

If the client wishes to renew the IP lease with the same DHCP server, it can skip some steps:

Request
client tries to request the same IP address from the DHCP server
Acknowledge
server acknowledges, and records the IP lease renewal

Typically, a client will try to renew the IP lease about halfway through the Lease Time.

Of course, the DHCP server can deny a request by responding with a DHCPNAK message. Now, the client needs to re-negotiate the IP lease.

DHCP Options

DHCP replies can include a variety of options, ranging from domain name and DNS servers to a list of IRC servers available to the client. You can even define your own options - check the dhcpd-options(5) manpage for more details.

In practice, only a handful of options are used in /etc/dhcpd.conf:

Routing information

 option routers             192.168.1.254;
 option subnet-mask         255.255.255.0;
 option broadcast-address   192.168.1.255;

DNS settings

 option domain-name         "example.com";
 option domain-name-servers 192.168.1.1, 192.168.1.254;

Time synchonization settings

 option ntp-servers         192.168.1.1, 192.168.1.254;

Windows-specific settings

 option netbios-node-type   8;

Pre-flight checks

See also