Glossary

DHCP Server

What is a DHCP Server

A DHCP server is a device that automatically assigns IP addresses and other network settings to the devices on a network. It is the server side of DHCP (Dynamic Host Configuration Protocol), a technology for centralized management and configuration of user IP addresses.

DHCP follows the RFC 2131 standard and works in a client/server model. A DHCP client sends a request to a DHCP server, and the server allocates an IP address to the client for a set period of time known as the lease time.

This approach suits hosts that only need temporary network access, and networks where the number of hosts is large but the available addresses are limited. It is especially useful when hosts do not need a permanent network connection.

The server selects an address from an address pool and assigns it to the client. It can also provide other network parameters, such as the default gateway address, DNS server addresses, and WINS server addresses. A DHCP server can handle request packets from its own subnet, as well as requests forwarded from other subnets through a DHCP relay.

DHCP Roles

A typical DHCP network has three roles:

· DHCP server: Selects an IP address from an address pool and assigns it to a client, together with other network parameters.

· DHCP client: Sends DHCP request packets, using the BOOTP or DHCP protocol, to obtain an IP address and other network parameters. Typical clients include IP phones, personal computers, mobile phones, and diskless workstations.

· DHCP relay: Forwards DHCP packets between clients and servers that are not in the same subnet. A client broadcasts its request, and only servers in the same subnet can receive it. A relay receives the request or response packets, builds new DHCP unicast packets, and forwards them across the Layer 3 network. This is different from ordinary IP packet forwarding.

How a DHCP Server Assigns an IP Address

The address acquisition process has five stages:

  1. Discover: When a client joins a network or needs new network information, it broadcasts a DHCP Discover message to all devices on the local network to find available DHCP servers.

  2. Offer: Each DHCP server that receives the Discover message replies with a DHCP Offer message. It contains an available IP address, a lease duration, a subnet mask, a default gateway, and other configuration details.

  3. Request: If the client receives several Offer messages, it typically chooses one and broadcasts a DHCP Request message to the chosen server, to accept the offered configuration.

  4. Acknowledgment: The server confirms the allocation of the IP address and configuration with a DHCP Acknowledgment message. The client has now acquired its network configuration.

  5. Renewal and release: Before the lease expires, the client tries to renew it by contacting the server halfway through the lease duration. If the client no longer needs the configuration or leaves the network, it can send a DHCP Release message to give up the address.

Why a DHCP Server is Beneficial

Centralized address management: IP addresses and network parameters are managed in one place, instead of being set by hand on each host.

Efficient use of limited addresses: Because addresses are leased for a period of time, they can be reused by other hosts when they are no longer needed.

More than an IP address: Clients also receive the gateway, DNS servers, and other parameters they need to work on the network.

Works across subnets: With a DHCP relay, one server can serve clients in many subnets.

Customized settings by client type: Using DHCP options, the server can recognize vendor information in a client's request and allocate parameters suited to that client.

At Asteraix

What We Can Do at Asteraix

AsterNOS lets a switch act as a DHCP server, and also as a DHCP client, through the command line.

  • Address pools: Create a pool with dhcp pool name, then define the subnet to allocate from with network, and the address range with address-pool. Set the gateway for clients with routers, DNS servers with dns, and the lease duration with lease-time.

  • Settings for network booting: Configure the TFTP server address with tftp-server, the boot file name with bootfile-name, and the next server address with next-server.

  • Bind the server to an interface: Enable the DHCP server on an Ethernet interface or a VLAN interface with dhcp select server.

  • DHCP options for customized allocation: Classify clients by their request, for example by option 93, using dhcp class and if-match rule. Define the custom options for them in an option group with dhcp option-group, such as option 43 for vendor information or a TFTP server address. Then bind the option group to the client class in the pool with class name option-group ID, so matching clients receive the custom options.

  • The switch as a DHCP client: On an Ethernet or VLAN interface, ip address dhcp-alloc lets the interface obtain its IP address and other information from a DHCP server. If the address assigned falls in the same subnet as the IP address of another interface on the device, the interface does not use it.