为 InsideCli 客户端网络分配地址,地址池范围:192.168.0.110-192.168.0.190/24;
域名解析服务器:按照实际需求配置 DNS 服务器地址选项;
网关:按照实际需求配置网关地址选项;
为 InsideCli 分配固定地址为 192.168.0.190/24;
设置默认租约时间为 0.5 天,最大租约时间为 3 天;
将 DHCP 服务的日志信息从系统的日志服务中分离,通过 rsyslog 自定义消息处理,将日志信息保至/var/log/dhcpd.log 中。
Plain
yum install dhcp -y
cp -p /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf
vi /etc/dhcp/dhcpd.conf
default-lease-time 43200; #默认租约时间
max-lease-time 259200; #最大租约时间
log-facility local1; #日志
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.110 192.168.0.190;
option domain-name-servers 192.168.100.100;
option domain-name "chinaskills.cn";
option routers 192.168.0.254;
}
subnet 192.168.100.0 netmask 255.255.255.0 {
}
host insidecli{
hardware ethernet 00:0c:29:01:af:58;
fixed-address 192.168.0.190;
}
#日志
vim /etc/rsyslog.conf
local1.* /var/log/dhcpd.log
systemctl restart dhcpd rsyslog
#routersrvDHCP中继
yum install dhcp -y
dhcrelay 192.168.100.100