第一步:安装
rpm -ivh /mnt/Packages/dhcp-4.2.5-58.el7.centos.x86_64.rpm
第二步:修改配置文件
rpm -qc dhcp
vi /etc/dhcp/dhcpd.conf 查看dhcp服务相关的配置文件
subnet 192.168.80.0 netmask 255.255.255.0 {
range 192.168.80.100 192.168.80.200;
option routers 192.168.80.1;
option domain-name-servers 2.2.2.2, 3.3.3.3;
default-lease-time 600;
max-lease-time 7200;
}
#host boss { #保留地址
# hardware ethernet #mac地址
# fixed-address 192.168.80.188;
#}
第三步:启动
service dhcpd start
cat /var/log/message
netstat -anpu | grep dhcp //udp67端口需要工作
service firewalld stop
用客户端测试地址获得。
cat /var/lib/dhcpd/dhcpd.leases 查看租约信息