UNIX System Administration Handbook - Evi Nemeth [174]
If two hosts on a network are using the same IP address, one will have the right ARP table entry and one will be wrong. You can use the arp command to track down the offending machine.
Sometimes, hardware addresses need to be translated into IP addresses. A lot of handicapped hardware (e.g., diskless workstations, network computers, printers) needs to perform this translation at boot time. Instead of having an IP address hardwired into a configuration file, a machine can query a central server to discover its own address. The near-obsolete RARP protocol (Reverse ARP) extends ARP to cover reverse translations.
Unlike ARP, RARP requires a central server process to be installed on each network. RARP is not self-configuring; you must supply an explicit mapping between Ethernet addresses and IP addresses. On most systems that support RARP, the server is called rarpd and configuration data is drawn from /etc/ethers and /etc/hosts.
RARP has been largely superseded, first by BOOTP and now by DHCP.
13.7 DHCP: THE DYNAMIC HOST CONFIGURATION PROTOCOL
UNIX hosts have always required manual configuration to be added to a network. When you plug a Mac or PC into a network, it just works. Why can’t UNIX do that? The Dynamic Host Configuration Protocol (DHCP) brings this reasonable expectation several steps closer to reality.
DHCP is defined in RFCs 2131 and 2132.
The protocol enables a DHCP client to “lease” a variety of network and administrative parameters from a central server that is authorized to distribute them. The leasing paradigm is particularly convenient for PCs that are turned off when not in use and for ISPs that have intermittent dial-up customers.
Leasable parameters include
• IP addresses and netmasks
• Gateways (default routes)
• DNS name servers
• Syslog hosts
• WINS servers, X font servers, proxy servers, NTP servers
• TFTP servers (for loading a boot image)
and dozens more (see RFC2132). Real-world use of the more exotic parameters is rare, however. In many cases, a DHCP server supplies only basic networking parameters such as IP addresses, netmasks, default gateways, and name servers.
Clients must report back to the DHCP server periodically to renew their leases. If a lease is not renewed, it eventually expires. The DHCP server is then free to assign the address (or whatever was being leased) to a different client. The lease period is configurable, but it’s usually quite long (hours or days).
DHCP can save a formerly hapless sysadmin a lot of time and suffering. Once the server is up and running, clients can use it to obtain their network configuration automatically at boot time. No fuss, no mess.
DHCP software
Table 13.10 shows the DHCP software that is shipped with our four example systems.
Table 13.10 DHCP software on our example systems
a dhcpconfig is a shell script that helps you configure Solaris’s DHCP server.
ISC, the Internet Software Consortium, has built a reference implementation of the DHCP protocol. The server, client, and relay agent are available from ftp.isc.org. The ISC server also speaks the BOOTP protocol, which is similar in concept to DHCP but less sophisticated.
We recommend the ISC package over all the vendor-specific implementations. In a typical heterogeneous network environment, administration can be greatly simplified by standardizing on a single implementation. The ISC software provides a reliable, open source solution that builds without incident on most versions of UNIX. As of this writing, the pending release of version 3.0 promises many new useful configuration options, including conditional behavior, separate address pools, and more.
DHCP clients must initiate a conversation with