兴起,配置dhcp

yum search dhcp
yum install -y dhcp
 cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

# more /etc/dhcp/dhcpd.conf
option domain-name "lib01.com";
option domain-name-servers 192.168.20.10;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 192.168.20.0 netmask 255.255.255.0 {
  range 192.168.20.100 192.168.20.200;
  option routers 192.168.20.10;
  option broadcast-address 192.168.20.255;
  default-lease-time 600;
  max-lease-time 7200;
}

/etc/init.d/dhcpd start

启动失败,查看/var/log/messages:

Aug 12 17:26:56 lib01 dhcpd: Can't chown new lease file: Operation not permitted

修改 /etc/init.d/dhcpd

user=root

group=root



参考:

http://www.tuicool.com/articles/raM7naV

http://www.linuxidc.com/Linux/2015-02/112985.htm