Dynamic Host Configuration Protocol

What is DHCP?

DHCP is a TCP/IP protocol that enables hosts (for example, diskless workstations or mobile users) to obtain temporary IP addresses (out of a pool) from centrally-administered servers. The host runs the DHCP server, and the workstation runs the DHCP client.

Clients broadcast a message to locate a DHCP server, which responds with the:
  • IP Address, which is valid for a period of time specified by the administrator of the DHCP server.

  • Subnet Bit Mask.

  • Default Gateway.

  • Optional DNS Servers.

  • Duration for which the IP address assignment is valid

DHCP is flexible so that other information can also be stored and retrieved. A shortcoming is that there is currently no way to update Domain Name Servers with the new IP address for a user's DNS name (DNS names remain permanently assigned to hosts). Since important destination machines (such as servers) would use permanently assigned IP addresses, this should not be a big problem (until a solution is standardized).

Example Configuration

In many ways, DHCP is quite similar to RADIUS (Remote Authenticat Dial-In User System), which assigns a user their IP address, Subnet Mask, Default Gateway, and DNS Servers. The primary difference is in the authentication. Authentication for RADIUS is handled by a username/password pair, while the only authentication system that DHCP supports is through MAC Address filtering.

The VPEC network runs the Internet Software Consortium DHCP Server to handle the granting of IP addresses to all workstations and laptops on the network. This software, while it runs on a UNIX system, is similar in configuration to many other DHCP systems, including Microsoft's.

Here's the basic configuration for the desktop workstations:

subnet 209.39.6.0 netmask 255.255.255.0 {
  range 209.39.6.129 209.39.6.254;
  option subnet-mask 255.255.255.0;
  option broadcast-address 209.39.6.255;
  option routers 209.39.6.1;
  option domain-name-servers 209.39.6.4, 209.39.6.5;
  option domain-name "training.verio.net";
  default-lease-time 2592000;
  max-lease-time 2592000;
}
This defines a pool of IP's (209.39.6.129 - 209.39.6.254) that workstations will be assigned for 2592000 seconds at a time.

However, if we want to provide the same IP address for a computer everytime it logs on, then we can define the MAC address for the computer into the DHCP server configuration as follows:

host rnejdl {
  # Static IP for Rusty
  hardware ethernet 00:50:04:DF:1A:4C;
  fixed-address 209.39.6.32;
  option subnet-mask 255.255.255.0;
  option broadcast-address 209.39.6.255;
  option routers 209.39.6.1;
  option domain-name-servers 129.250.35.250, 129.250.35.251;
  option domain-name "training.verio.com";
}

By using this same configuration for more than one computer, we can provide a static IP to trusted workstations.