![]() |
|
||||
LynxOS Networking Guide |
DHCP
DHCP (Dynamic Host Configuration Protocol) enables systems to request network configuration information (IP address, local nameservers, and routers) from a DHCP server. This chapter details DHCP concepts, installation and configuration.
Introduction
Dynamic Host Configuration Protocol (DHCP) enables individual clients on an IP network to receive network configurations from a DHCP server. The DHCP server provides pre-defined network configuration information dynamically, including client IP addresses, nameservers, and routers. DHCP reduces the amount of overhead in administering a large IP network by freeing the system administrator from having to reconfigure each system individually.
DHCP also enables the storage and distribution of network parameters for clients and groups. Additionally, DHCP allows for recovery and reallocation of these network addresses through a leasing mechanism. Client network configurations expire after a designated period of time, after which the client system's network configuration is either renewed or reissued from the DHCP server. Another feature of this protocol is that it can be routed. DHCP support consists of a server daemon, client utility, a relay daemon and a diagnostic utility and a set of configuration database files. DHCP support requires TCP/IP.
LynxOS DHCP Components
LynxOS uses the ISC (Internet Software Consortium) Open Source DHCP version 2.0 distribution. DHCP consists of two software components:
The DHCP Client sends a request to a DHCP server, which responds with particular network parameters for the client to use. The following sections describe DHCP files and configurations.
LynxOS DHCP Files
This table details the various configuration files used to configure a LynxOS system for DHCP.
LynxOS DHCP Files Component Definition DHCP client configuration binary DHCP configuration file DHCP lease configuration file DHCP client configuration script DHCP daemon DHCP relay agent
DHCP man pages
Additional DHCP configuration information is available in these man pages:
Online Resources
Additional information on DHCP is available at the Internet Software Consortium web page:
Installing DHCP
DHCP is included with the LynxOS base product, and is installed by default. Configuring DHCP is explained in the following sections.
The DHCP Server
The DHCP server responds to requests from DHCP clients with network configuration information. DHCP server components include: dhcpd and dhcpd.conf.
dhcpd
The DHCP server daemon (dhcpd) serves DHCP client requests based on the configuration file dhcpd.conf. The server also monitors the lease details of the client IP addresses, facilitating the recovery and reallocation of IP addresses through predefined lease agreements. Additionally, the server also services BOOTP clients. The DHCP server maintains all current client configurations in the dhcpd.leases file. For more information on dhcpd.leases, See "dhcpd.leases" .
By default, dhcpd uses UDP port 67 to receive and UDP port 68 to send DHCP information.
dhcpd.conf
The DHCP configuration file, dhcpd.conf, must be created by hand. This configuration file sets specific network topologies and parameters the DHCP server uses to assign IP addresses, nameservers, and routers to clients. In addition to a range of available IP addresses, dhcp.conf must provide the IP address subnet mask, and at least one router and nameserver on the network.
Network topology declarations include the shared-network and subnet declarations. Dynamically assigned addresses must include the range declaration with a subnet declaration. DHCP options are declared per subnet. lease durations are expressed in seconds.
The following is an example of a dhcpd.conf file:
example dhcpd.conf fileAdditional information on specific options in configuring dhcpd.conf can be found in the dhcpd.conf(5) man page.
After editing the dhcpd.conf file, restart the DHCP daemon:
dhcpd.leases
This is a generated file that contains lease expirations for client network configurations. The DHCP server maintains up-to-date information on client leases in this file. In the event of a system reboot, the DHCP server can resume all current connections without having to reconfigure each client on the network. This file should not be edited.
Relay Agents
Relay Agents allow a DHCP server to configure systems on more than one network segment. Relay agents forward DHCP requests from clients to the DHCP server, allowing a single DHCP server to serve multiple clients in multiple network segments. Using relay agents provides flexibility in configuring a DHCP network.
The DHCP Client
dhclient
The DHCP client (dhclient) sends requests to a DHCP server for network configuration information. The primary information sought from the server is the client IP address. The IP address is issued for a specific "lease" period, varying between a few hours up to a year. Initially, dhclient broadcasts DHCP requests using the UDP protocol over a chosen network interface (passed as an argument) to the DHCP server.
Once it establishes contact with the server, the network configuration is applied to the client. The client network configuration is valid until the lease period expires, after which, the client attempts to renew the lease, or obtain a lease on new network configurations. After configuring the client, the dhclient script becomes a background process to continue to contact the DHCP server.
While configuring a netbooted client to use bootp and DHCP, choose the DHCP option in the scripts. If not, the traditional RARP is used to netboot the client.
In addition, online man pages contain detailed information.
Starting dhclient
![]() LynuxWorks, Inc. 855 Branham Lane East San Jose, CA 95138 http://www.lynuxworks.com 1.800.255.5969 |
![]() |
![]() |
![]() |
![]() |