Datasheet

“main” (Installation and Administration) 2004/6/25 13:29 page 518 #544
i
i
i
i
i
i
i
i
21.11.4 Hosts with Fixed IP Addresses
As mentioned above, DHCP can also be used to assign a predefined, static
address to a specific host for each request. As might be expected, addresses
assigned explicitly always take priority over addresses from the pool of
dynamic addresses. Furthermore, a static address never expires in the way
a dynamic address would, for example, if there were not enough addresses
available so the server needed to redistribute them among hosts.
To identify a host configured with a static address, dhcpd uses the hard-
ware address, which is a globally unique, fixed numerical code consisting
of six octet pairs for the identification of all network devices (for exam-
ple 00:00:45:12:EE:F4). If the respective lines, like the ones in Exam-
ple 21.31, are added to the configuration file of Example 21.30 on page 516,
the DHCP daemon assigns the same set of data to the corresponding host
under all circumstances.
Example 21.31: Additions to the Configuration File
host earth {
hardware ethernet 00:00:45:12:EE:F4;
fixed-address 192.168.1.21;
}
The name of the respective host (host <host name>) is entered in the first
line and the MAC address in the second line. On Linux hosts, this address
can be determined with the command ifstatus followed by the network
device (for example, eth0). If necessary, activate the network card first
with ifup eth0. The output should contain something like
link/ether 00:00:45:12:EE:F4
In the above example, a host with a network card having the MAC address
00:00:45:12:EE:F4 is assigned the IP address 192.168.1.21 and the
host name earth automatically. The type of hardware to enter is ethernet
in nearly all cases, although token-ring, which is often found on IBM
systems, is also supported.
518
21.11. DHCP