DHCP server of ISC
To configure the DHCP server DHCPD, edit the DHCPD. conf sample file from the server directory and install it as/etc/DHCPD. conf20. At the same time, you must create an empty lease database file named/var/DB/DHCP. Leases and run the touch command. Make sure that DHCPD can write this file. To set the DHCPD. conf file, the following information is required:
The subnet of the IP address managed by DHCPD and the address range that can be issued;
The initial and maximum lease period in seconds;
BOOTP client configurations, if any (they have static IP addresses and must list their mac-level hardware addresses );
Any other options that the server should send to the DHCP Client: network mask, default route, DNS domain, name server, etc.
The DHCPD manual page provides an overview of the configuration process. The exact language of the configuration file cannot be described on the DHCPD. conf manual page. Both are located in the server subdirectory of the software. In some Linux releases, the/etc directory contains a sample of the DHCPD. conf file. You can modify it to make it conform to the configuration of your local site.
DHCPD should be automatically started at system boot time. You will find it helpful to start the daemon based on the existence of the/etc/DHCPD. conf file.
The following is a sample DHCPD. conf file obtained from a Linux host with two interfaces: one interface is an internal interface, and the other interface is connected to the Internet. This computer performs Nat translation for the internal network and also rents 10 IP addresses on this network. The DHCPD. conf file contains a dummy (required) entry for external interfaces and a host entry for each computer that requires a fixed address.
The IP address allocated by DHCP may conflict with the content of the DNS database. A common name (such as dhcpl.synack.net) is often assigned to each dynamic lease address at the outlet, and each machine name is allowed to "float" between their IP addresses ". If you are running the recently released bind version that supports dynamic updates, you can also configure DHCPD to update the DNS database when it allocates an address. The dynamic update solution is more complex, but it has the advantage of saving the host name of each computer. For more information about DNS, see Chapter 1.
DHCPD records various lease transactions in the DHCP. Leases file. It will also rename this file as DHCPD. Leases ~, Then, regularly back up the DHCP. Leases file from the database in the memory. If DHCPD crashes during this operation, only DHCP. Leases ~ may be left in the end ~ File. In this case, DHCPD will refuse to start. You must rename the file before restarting. Do not create an empty DHCP. Leases file. Otherwise, there will be confusion when the client has two addresses.
DHCP clients do not need to be configured. It stores the status files of each connection in the/var/lib/DHCP directory or/var/lib/dhclient directory. The names of these files are named using the interfaces they describe. For example, the dhclient-eth0.leases file contains all the connection parameters that dhclient has set for the interface eth0.