DHCP Server Fixed Address Options

Once you have the MAC address of a DHCP client, you can add an entry to the DHCP server's /etc/dhcpd.conf file for that client. This entry can go within the subnet declaration, as shown in Listing 27.1, or the entry can go after the subnet declaration. Either way, the entry looks like this:

host calvin.threeroomco.com { hardware ethernet 00:80:C6:F9:3B:BA; fixed-address 172.27.15.2;

The host declaration tells the server that you're defining parameters for a specific computer. Place the computer's hostname after the keyword host, and end the line with an open curly brace. Lines between this one and the close curly brace that defines the end of the declaration apply only to this host.

The hardware parameter provides a means for the server to identify the host. This parameter is followed by a keyword for the hardware type (ethernet in this example, but token-ring is also valid) and the MAC address, using colons (:) to separate bytes of the address. The fixed-address line, of course, defines the IP address that's to be given to this host. Be sure that the address is not also specified in the range line for any subnet declaration!

After you add this entry and restart the server, it should begin delivering the fixed IP address you specify with the fixed-address parameter to that client. Of course, this will only work as long as the hardware address remains unchanged. If you replace a computer's NIC, you must update the hardware line to reflect the change.

Team LiB

Team LIB

^ previous

0 0

Post a comment