DHCP service configuration

1. rpm or yum to install DHCP service, generally use yum.

2. After the installation is complete, rpm -ql dhcp ##-q is to query, -l is to list the names of the files in the software, you can query all the files and their locations.

3. Open /etc/dhcp/dhcpd.conf, back up and modify the /usr/share/doc/dhcp*/dhcpd.conf.sample template to modify according to the description.

option domain-name "example.com";   ##Configure the domain name 

option domain-name-servers 172.16.0.1; ##Configure the IP that provides DNS service 

default-lease-time 600; ##Default lease time  600s

max-lease-time 7200; ##Maximum lease time 7200s 

log-facility local7; ##Logging facility setting default

subnet 172.25.254.0 netmask 255.255.255.0 ##subnet is the subnet (network segment)  network is the subnet mask  

range 172.25.254.220 172.25.254.240;   ##Assign the range of IPs from 220 to 240:  

option routers 172.25.254.254; ##Route address

systemctl restart dhcpd ##Restart the service after editing, the configuration will take effect (CentOS 7)

services dhcpd restart ##Restart the service after editing, the configuration will take effect (CentOS 6)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325935352&siteId=291194637