Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [176]

By Root 2870 0
dhcpd.conf file from the server directory and install it in /etc/dhcpd.conf.16

You must also create an empty lease database file called /var/db/dhcp.leases. Make sure that dhcpd can write to this file. To set up the dhcpd.conf file, you need the following information:

• The subnets for which dhcpd should manage IP addresses, and the ranges of addresses to dole out

• The initial and maximum lease durations, in seconds

• Configurations for BOOTP clients if you have any (they have static IP addresses and must have their MAC-level hardware address listed as well)

• Any other options the server should pass to DHCP clients: netmask, default route, DNS domain, name servers, etc.

The dhcpd man page gives an overview of the configuration process. The exact syntax of the config file is covered in the dhcpd.conf man page. Both are located in the distribution’s server subdirectory.

dhcpd should be started automatically at boot time. You may find it helpful to make the startup of the daemon conditional on the existence of /etc/dhcpd.conf.

Here’s a sample dhcpd.conf file from a Linux box with two interfaces, one internal and one that connects to the Internet. This machine performs NAT translation for the internal network and leases out a range of 10 IP addresses on this network as well. The dhcpd.conf file contains a dummy entry for the external interface (required) and a host entry for one particular machine that needs a fixed address.

# dhcpd.conf

#

# global options

option domain-name "synack.net";

option domain-name-servers gw.synack.net;

option subnet-mask 255.255.255.0;

default-lease-time 600;

max-lease-time 7200;

subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.51 192.168.1.60;

option broadcast-address 192.168.1.255;

option routers gw.synack.net;

}

subnet 209.180.251.0 netmask 255.255.255.0 {

}

host gandalf {

hardware ethernet 08:00:07:12:34:56;

fixed-address gandalf.synack.net;

}

Addresses assigned by DHCP might potentially be in conflict with the contents of the DNS database. Sites often assign a generic name to each dynamically leased address (e.g., dhcp1.synack.net) and allow the names of individual machines to “float” along with their IP addresses. If you are running a recent version of BIND that supports dynamic updates, you can also configure dhcpd to update the DNS database as it hands out addresses. The dynamic update solution is more complicated, but it has the advantage of preserving each machine’s hostname.

See Chapter 16 for more information about DNS.

dhcpd records each lease transaction in the file dhcp.leases. It also periodically backs up this file by renaming it to dhcpd.leases~ and recreating the dhcp.leases file from its in-memory database. If dhcpd were to crash during this operation, you might end up with only a dhcp.leases~ file. In that case, dhcpd will refuse to start, and you will have to rename the file before restarting it. Do not just create an empty dhcp.leases file, or chaos will ensue as clients end up with duplicate addresses.

13.8 PPP: THE POINT-TO-POINT PROTOCOL


PPP, the Point-to-Point Protocol, is a serial line encapsulation protocol that specifies how IP packets must be encoded for transmission on a slow (and often unreliable) serial line. Serial lines simply transmit streams of bits and have no concept of the beginning or end of a packet. The PPP device driver takes care of encoding and decoding packets on the serial line; it adds a link-level header and markers that separate packets.

PPP is sometimes used with the newer home technologies such as DSL and cable modems, but this fact is usually hidden from you as an administrator. Encapsulation is typically performed by the interface device, and the traffic is bridged to Ethernet. You just see an Ethernet connection.

Designed by committee, PPP is the “everything and the kitchen sink” encapsulation protocol. It was inspired by the SLIP (Serial Line IP) and CSLIP (compressed SLIP) protocols designed by Rick Adams and Van Jacobson, respectively. PPP differs from these systems

Return Main Page Previous Page Next Page

®Online Book Reader