Linux: Configuration of dhcp service

1. The configuration of the dhcp service is
in the server:
ifconfig eth0

vim      /etc/hosts


yum search dhcp query installed file name

yum install dhcp.x86_64 -y installs the dhcp.x86_64 file


cd    /etc/dhcp/

cp    /usr/share/doc/dhcp*/dhcpd.conf.example      /etc/dhcp/dhcpd.conf

vim     dhcpd.conf
 7 option domain-name "example.com"; ("example.com":域名)

 8 option domain-name-servers 114.114.114.114;  (114.114.114.1140:DNS)


delete 26.27
 29 subnet 172.25.254.0 (network bit) netmask 255.255.255.0 { (subnet mask)
 30 range 172.25.254.200 172.25.254.210;
 31 option routers 172.25.254.250; (172.25.254.250: gateway)

 32 }


delete after line 34

systemctl    start   dhcpd

systemctl    enable   dhcpd


In the test side:
unplug the network cable to reset the virtual machine
ifconfig


In the server:

cat /var/lib/dhcpd/dhcpd.leasea




The final query result is the same as success

Guess you like

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