DHCP 服務

DHCP 服務

在 vm 環境下,取消 NAT 環境下的 dhcp 功能apache

dhcp 服務器的配置

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

dhcpclient的配置

vim /etc/sysconfig/network-scripts/ifcfg-eth0
	BOOTPROTO="dhcp"
systemctl restart network

在 dhcp服務器上查看 租約狀況

dhclient 命令

dhcp服務配置文件檢查

service dhcpd configtest
相關文章
相關標籤/搜索