Using DHCP with Red Hat Linux


During the installation of Red Hat Linux, you will be prompted for the network components to install, just as you are with Windows. You can specify at that time to use DHCP for a client workstation, or you can assign a static address. If you elect to use DHCP, you will be able to access a DHCP server to obtain IP configuration information from a DHCP server. You can also choose to install a DHCP server when you install Linux so that you can service other client computers.

The client configuration information is stored in several files for Red Hat Linux:

  • dhclient.conf This file stores information about all network devices attached to the computer, such as the amount of time the client will wait before attempting to contact a DHCP server when no response has been received. If you have a DNS server that supports dynamic updates, you can list the fully qualified name of those servers in this file.

  • dhclient.leases This file records leases previously obtained so that the client can request them again after a reboot. More than one address can be listed in this file because the computer can have more than one network interface.

  • dhcpd.options This file lists options requested by the client, as described earlier in this chapter.

You probably won't have to make any edits to the previously listed filesthe default values created when you elect to use DHCP on the client are usually sufficient in all but the most extreme circumstances. If you do need to tweak some of the data contained in the configuration or options files, use the man pages for the DHCP client to obtain more detailed information.

The DHCP Server Daemon

The server portion of DHCP for a Red Hat Linux system is a background process (called a daemon) that is also started at boot time. The name of this daemon is dhcpd. Several important files used by the server daemon include the following:

  • dhcpd.conf This is the configuration file for the daemon that contains, among other things, the range of IP addresses the server can lease to clients.

  • dhcpd.leases The leases that have been allocated to clients are stored in this file. New leases are appended to the end of the file. Periodically, the server examines the file and removes addresses (or other information stored here) that is no longer valid, and rewrites the file so that it will be available if the server or the daemon is restarted. The old file is not deleted but instead is renamed dhcpd.leases~.

Although the actual command to start the DHCP server on the computer is contained in a startup file that is executed when the computer is booted, you can execute commands online to restart the server. This capability can be useful when you are debugging a problem with the server, for example, and want to run it as a foreground application instead of a background daemon.

The syntax for the DHCP daemon is

dhcpd [-p port] [-f] [-d] [-q] [-t | -T] [-cf configfile] [-lf leasefile] [-tf tracefile]  [-play tracefile] [if0 [... ifN]] 


where

  • -p port The standard port that the server listens to for DHCP requests is port 67. Use this to specify a different port number.

  • -f Causes the server to be run as a foreground process instead of a background (daemon) process. This is useful when using a debugger to diagnose problems with the server.

  • -d This option causes the server to output the DHCP log to the standard error descriptor instead of the syslog file.

  • -q Suppresses printing the copyright notice when the daemon is started.

  • -t | -T When the system is booted, the configuration file and lease file are read. The -t option will examine the configuration file to ensure that the syntax is correct, but won't connect to the network. Similarly, the -T option will examine the lease database. When using the -play option (listed in the following text), use an alternate lease file because the playback option might overwrite your lease file with test data.

  • -cf configfile Use this to specify a filename for the configuration file if you don't want to use the default filename.

  • -lf leasefile Use this to specify a filename for the lease file if you don't want to use the default filename.

  • -tf TRacefile Use this to specify the filename that will log the startup of the server. Useful for debugging.

  • -play tracefile Use this to "playback" the tracefile.

  • if0 [...ifN] Specify the network interface on which the server will be used.

The DHCP Relay Agent

DHCP and BOOTP messages can be exchanged with clients and servers that are not on the same subnet. This is done by running the dhcrelay daemon on the subnet where the client resides. This daemon is responsible for intercepting the requests and forwarding them to a DHCP server and, likewise, returning the responses to the client.

The syntax for the agent can be found using the command man dhcrelay if you need to use this capability.




Upgrading and Repairing Networks
Upgrading and Repairing Networks (5th Edition)
ISBN: 078973530X
EAN: 2147483647
Year: 2006
Pages: 411

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net