1 DHCP
1.1 DHCP Service Introduction
DHCP (Dynamic Host Configuration Protocol), which is used to dynamically assign IP addresses and configuration of the associated network environment (gateway and DNS Server information) to hosts on a network segment, For example, we use ADSL dialing is the DHCP protocol used.
1.2 Use of DHCP
1, IP Address resources can not meet all the requirements of the subnet
2. Network with frequently changing IP addresses
1.3 How DHCP works
1. The DHCP client initializes TCP/IP and broadcasts a request message on the local physical subnet to determine the DHCP server location and its IP address. (If the DHCP server and the client are not on the same physical subnet, the BOOTP relay agent forwards the message to the DHCP server.) )
2. Because there may be more than one DHCP server on the network, any DHCP server with valid IP address information sends a proposal to the client.
3. The client selects the IP address information from the first proposal received and broadcasts a message request for the leased address.
4. The DHCP server issuing the proposal should respond to the message, specify the IP address information to the client and send a confirmation, and all other DHCP servers withdraw their proposals.
5, the client completes the TCP/IP protocol initialization and binding. Once configured, the client can use normal network communications and all IP services and applications that are used to connect to other IP hosts.
1.4 Installation configuration for DHCP
The procedure is as follows:
1.4.1 Installing the DHCP service
Yum–y Install DHCP
1.4.2 Copying profile templates
Overwrite/usr/share/doc/dhcp-4.2.5/dhcpd.conf.example to/etc/dhcp/dhcpd.conf
1.4.3 Edit Master Profile detailed configuration DHCP address pool, Gateway
Vim/etc/dhcp/dhcpd.conf
1.4.4 Starting the DHCP service
Systemctl Restart DHCPD//Restart DHCP service
Systemctl Enable DHCPD//Restart DHCP service on next reboot
Systemctl status DHCPD//view the state of DHCP
1.4.5 Viewing DHCP ports
NETSTAT-TUNLP |grep DHCPD
1.4.6 test client gets IP address
Ifconfig
LINUX 7.4 DHCP Setup