# cat dhcpd.conf
option domain-name
"bigcloud.local"
;
#此处设置主机名
option domain-name-servers 192.168.188.11, 192.168.188.12;
#此处设置默认DNS
subnet 192.168.188.0 netmask 255.255.255.0 {
#此处设置第一个子网
range dynamic-bootp 192.168.188.100 192.168.188.160;
#此处设定为不连续的IP段
range dynamic-bootp 192.168.188.169 192.168.188.253;
default-lease-
time
259200;
#默认租约时间
max-lease-
time
259200;
option routers 192.168.188.2;
# 默认网关
}
subnet 192.168.189.0 netmask 255.255.255.0 {
#第二个子网
range dynamic-bootp 192.168.189.100 192.168.189.253;
default-lease-
time
691200;
max-lease-
time
691200;
option routers 192.168.189.2;
}
host pc1 {
#为某一台主机单独配置静态IP
hardware ethernet 00:12:34:56:78:90;
fixed-address 192.168.188.111;
#启动服务。
# service dhcpd start
Starting dhcpd: [ OK ]