Linux学习之DHCP服务器
-
安装:yum install -y dhcp*
-
关闭selinux
-
服务器配置静态IP:BOOTPROTO=static
IPADDR=192.168.100.1
NETMASK=255.255.255.0
GATEWAY=192.168.100.250
-
配置:cp /usr/...dhcpd.conf.sample /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
default-lease-time 259200;
max-lease-time 518400;
option domain-name "sample.com";
option domain-name-servers 114.114.114.114;
subnet 192.168.100.0 netmask 255.255.255.0{
range 192.168.100.2 192.168.100.100;
option routers 192.168.100.250;}
-
启动:/etc/init.d/dhcpd start
chkconfig dhcpd on
-
查看已出租的IP:cat /var/lib/dhcpd/dhcpd.lease