配置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
还是失败!!!!不过已经是新的问题了
未完待续。。。!!!