在 vm 環境下,取消 NAT 環境下的 dhcp 功能apache
yum install dhcp -y cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf vim /etc/dhcp/dhcpd.conf option domain-name "xuepeng.com"; option domain-name-servers 180.76.76.76,114.114.114.114; default-lease-time 86400; max-lease-time 864000; subnet 192.168.209.0 netmask 255.255.255.0 { range 192.168.209.150 192.168.209.200; option routers 192.168.209.2; } host windows { hardware ethernet 00:50:56:C0:00:08; fixed-address 192.168.209.200; } systemctl start dhcpd
vim /etc/sysconfig/network-scripts/ifcfg-eth0 BOOTPROTO="dhcp" systemctl restart network
service dhcpd configtest