CentOS6.5: DHCP Configuration file errors encountered -- exiting

本文记录了在CentOS上配置DHCP服务器时遇到的错误,详细描述了配置文件dhcp.conf中subnet设置的问题及初步解决方案,但重启后仍遇到新问题。

配置DHCP,vi /etc/dhcp/dhcp.conf文件配置如下:

ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.1.1 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;

range  dynamic-bootp  192.168.1.50 192.168.1.60;

host ns {
hardware ethernet  00:0C:29:93:75:A9;
fixed-address 192.168.1.15;}
}

配置完成后执行/etc/init.d/dhcp restart,重新启动dhcp

报错:

Jul 30 23:35:44 CentOS6 dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Jul 30 23:35:44 CentOS6 dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Jul 30 23:35:44 CentOS6 dhcpd: All rights reserved.
Jul 30 23:35:44 CentOS6 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Jul 30 23:35:44 CentOS6 dhcpd: /etc/dhcp/dhcpd.conf line 5: subnet 192.168.1.1 netmask 255.255.255.0: bad subnet number/mask combination.
Jul 30 23:35:44 CentOS6 dhcpd: subnet 192.168.1.1 netmask 255.255.255.0
Jul 30 23:35:44 CentOS6 dhcpd:                                        ^
Jul 30 23:35:44 CentOS6 dhcpd: Configuration file errors encountered -- exiting
Jul 30 23:35:44 CentOS6 dhcpd:
Jul 30 23:35:44 CentOS6 dhcpd: This version of ISC DHCP is based on the release available
Jul 30 23:35:44 CentOS6 dhcpd: on ftp.isc.org.  Features have been added and other changes
Jul 30 23:35:44 CentOS6 dhcpd: have been made to the base software release in order to make
Jul 30 23:35:44 CentOS6 dhcpd: it work better with this distribution.
Jul 30 23:35:44 CentOS6 dhcpd:
Jul 30 23:35:44 CentOS6 dhcpd: Please report for this software via the CentOS Bugs Database:
Jul 30 23:35:44 CentOS6 dhcpd:     http://bugs.centos.org/
Jul 30 23:35:44 CentOS6 dhcpd:
Jul 30 23:35:44 CentOS6 dhcpd: exiting.
 

问题描述:

由以下描述可知,问题出现在subnet 192.168.1.1 netmask 255.255.255.0这一行
 subnet 192.168.1.1 netmask 255.255.255.0
                                      ^
dhcpd: Configuration file errors encountered -- exiting

解决方案:

修改vi /etc/dhcp/dhcp.conf 

 subnet 192.168.1.1 netmask 255.255.255.0 ---》 subnet 192.168.1.0 netmask 255.255.255.0

ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;

range  dynamic-bootp  192.168.1.50 192.168.1.60;

host ns {
hardware ethernet  00:0C:29:93:75:A9;
fixed-address 192.168.1.15;}
}

继续执行:/etc/init.d/dhcp restart 

还是失败!!!!不过已经是新的问题了

未完待续。。。!!!

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值