1. 安装DHCP
yum install dhcp
2. 编辑配置文件
- cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf #新版的这里改路径了注意
- vi /etc/dhcp/dhcpd.conf
- subnet 192.168.88.0 netmask 255.255.255.0 {
- range 192.168.88.1 192.168.88.254;
- option domain-name-servers ns.testlan.com;
- option domain-name "testlan.com";
- option routers 192.168.88.132;
- option broadcast-address 192.168.88.255;
- default-lease-time 600;
- max-lease-time 7200;
- }
- host dhcpserver {
- hardware ethernet 00:0C:29:54:FF:37;
- fixed-address 192.168.88.132;
- }
service dhcp start
5. .启动失败解决
打印日志,找出问题所在,主要检测目录和配置文件是否正确
cat /var/log/messages
在此之前,一定要配置下自己得IP地址为静态得地址。记得配置下网关地址哟