DHCP dynamically configures the host address

1. Project background

Assume that the IP address of the corporate DHCP server is 192.168.1.2. The domain name of the DNS server is dns.jnrp.cn, the IP address is 192.168.1.3, the WEB server address is 192.168.1.10, and the Samba server IP address is 192.168.1.5; the gateway address is 192.168.1.254; the address range is 192.168.1.3 to 192.168 .1.150, the mask is 255.255.255.0

DHCP service

-Automatically allocate addresses for a large number of clients and provide centralized management
-Reduce and manage and maintain costs, and improve network configuration efficiency

The address information that can be allocated mainly includes

-IP address and subnet mask of the network card
-Broadcast address
-Default gateway information-
DNS server address

DHCP server software

Insert picture description here

Install DHCP

[root@redhat ~]# yum install -y dhcp

Edit the dhcp main configuration file

[root@redhat ~]# vim /etc/dhcp/dhcpd.conf

Copy the file: /usr/share/doc/dhcp*/dhcpd.conf.example
after copying and opening it to see the DHCP example file:

[root@redhat ~]# cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd
dhcpd6.conf  dhcpd.conf   
[root@redhat ~]# cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf 
cp:是否覆盖"/etc/dhcp/dhcpd.conf"? y
[root@redhat ~]# vim /etc/dhcp/dhcpd.conf

Guess you like

Origin blog.csdn.net/weixin_45849066/article/details/112227682