第一步:
查询:
rpm -qa|grep dhcpd
第二步:
安装:
yum -y install dhcpd
第三步:
配置参数
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.sample /ect/dhcp/dhcpd.conf
vi /etc/dhcp/dhcpd.conf
只保留一下文件。
#this is a very basic subnet declaration.
subnet 192.168.157.0 netmask 255.255.255.0 {
range 192.168.157.10 192.168.157.20;
option routers 192.168.157.2;}
其他文件全部删除。重点(所有IP地址必须在同一个网段,DHCP服务才可以开启)
关闭防火墙
systemctl stop firewalld.service (关闭防火墙)
systemctl restart firewalld.services (重启防火墙)
systemctl status firewalld.service (查看防火墙状态)
关闭selinux
Vi /etc/selinux/conf
Disable
第四步:
测试:
systemctl start dhcpd (开启dhcp服务)
systmectl restart dhcpd(重启dhcp服务)
systemctl status dhcpd(查看dhcp服务状态)