1)安装软件:
yum install dhcp dhcp-devel -y
2)修改配置文件
1:配置文件为空复制模板进行覆盖
cd /etc/dhcp/ #进入dhcp配置文件目录
cp -a -p /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example dhcpd.conf
2:手写dhcp配置
3)配置文件内容
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.100 192.168.2.254;
option domain-name-servers 192.168.2.254;
option domain-name "test.com";
option routers 192.168.2.254;
option broadcast-address 192.168.2.255;
default-lease-time 600;
max-lease-time 7200;
#mac ip绑定
host 2003{
hardware ethernet 00:0c:29:b9:14:ce;
fixed-address 192.168.2.200;
}
}
网友评论