TOC PREV NEXT INDEX

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
/bin/dhclient
DHCP client configuration binary
/etc/dhcpd.conf
DHCP configuration file
/etc/dhcpd.leases
DHCP lease configuration file
/etc/dhclient-script
DHCP client configuration script
/net/dhcpd
DHCP daemon
/net/dhcrelay
DHCP relay agent

DHCP man pages

Additional DHCP configuration information is available in these man pages:

DHCP man pages  
man page
Description
dhcpd(1)
The DHCP server
dhcpd.conf(5)
The DHCP server configuration file
dhcp-options(1)
DHCP option statements
dhclient(1)
DHCP client for LynxOS
dhclient.conf(5)
DHCP client for LynxOS config file
dhrelay(1)
DHCP relay Agent
dhclient.leases(5)
DHCP lease file

Online Resources

Additional information on DHCP is available at the Internet Software Consortium web page:

http://www.isc.org

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.

Note: It is recommended that the DCHP server be incorporated into system startup scripts to automate this functionality; for example adding a line executing dhcpd in /etc/rc/network.

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 file
# shared-network
subnet 192.168.11.0 netmask 255.255.255.0 {
range 192.168.11.1 192.168.11.251;
option routers 192.168.11.254;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.11.253;
# default lease time=30 Days
default-lease-time 2592000;
# max lease time=45 Days
max-lease-time 3888000;
}

Additional 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:

  1. Find the Process ID (PID) of the DHCP daemon (dhcpd) with the following command:

# ps -axon | grep dhcpd
  1. Use the kill command to stop the process.

# kill <PID>
  1. Restart the DHCP daemon:

# /net/dhcpd

Note: X86 systems that netboot LynxOS use RARP and TFTP. However, PXE compatible devices must use DHCP.

Note: PPP Server and Client IP address allocation are not integrated with DHCP and continue to work independently.

Note: Dynamic DNS update is not currently supported.

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

Start the dhclient script by typing:

# dhclient

Note: It is recommended that dhclient be incorporated into system startup scripts to automate this functionality; for example adding a line executing dhclient in /net/rc/network.



LynuxWorks, Inc.
855 Branham Lane East
San Jose, CA 95138
http://www.lynuxworks.com
1.800.255.5969
TOC PREV NEXT INDEX