在配置DHCP时报错:
ul 30 22:55:06 CentOS6 dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Jul 30 22:55:06 CentOS6 dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Jul 30 22:55:06 CentOS6 dhcpd: All rights reserved.
Jul 30 22:55:06 CentOS6 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Jul 30 22:55:06 CentOS6 dhcpd: WARNING: Host declarations are global. They are not limited to the scope you declared them in.
Jul 30 22:55:06 CentOS6 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Jul 30 22:55:06 CentOS6 dhcpd: Wrote 0 deleted host decls to leases file.
Jul 30 22:55:06 CentOS6 dhcpd: Wrote 0 new dynamic host decls to leases file.
Jul 30 22:55:06 CentOS6 dhcpd: Wrote 0 leases to leases file.
Jul 30 22:55:06 CentOS6 dhcpd:
Jul 30 22:55:06 CentOS6 dhcpd: No subnet declaration for eth0 (192.168.0.10).
Jul 30 22:55:06 CentOS6 dhcpd: ** Ignoring requests on eth0. If this is not what
Jul 30 22:55:06 CentOS6 dhcpd: you want, please write a subnet declaration
Jul 30 22:55:06 CentOS6 dhcpd: in your dhcpd.conf file for the network segment
Jul 30 22:55:06 CentOS6 dhcpd: to which interface eth0 is attached. **
Jul 30 22:55:06 CentOS6 dhcpd:
Jul 30 22:55:06 CentOS6 dhcpd:
Jul 30 22:55:06 CentOS6 dhcpd: Not configured to listen on any interfaces!
Jul 30 22:55:06 CentOS6 dhcpd:
Jul 30 22:55:06 CentOS6 dhcpd: This version of ISC DHCP is based on the release available
Jul 30 22:55:06 CentOS6 dhcpd: on ftp.isc.org. Features have been added and other changes
Jul 30 22:55:06 CentOS6 dhcpd: have been made to the base software release in order to make
Jul 30 22:55:06 CentOS6 dhcpd: it work better with this distribution.
Jul 30 22:55:06 CentOS6 dhcpd:
Jul 30 22:55:06 CentOS6 dhcpd: Please report for this software via the CentOS Bugs Database:
Jul 30 22:55:06 CentOS6 dhcpd: http://bugs.centos.org/
Jul 30 22:55:06 CentOS6 dhcpd:
Jul 30 22:55:06 CentOS6 dhcpd: exiting.
问题描述:
以上报错告诉我,我的DHCP配置的思路错了,原来的配置为
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 { #subnet 是默认网关,netmask是子网掩码
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;}
}
而我本机的IP地址正是报错的192.168.0.10,说明了我的默认网关等都配置错误,应该配置为对应的0网段,而不是1网段(当时是怎么脑挫到1网段的!!!)
解决方案:
重新配置如下:
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.0.50 192.168.0.60;
host ns {
hardware ethernet 00:0C:29:93:75:A9;
fixed-address 192.168.0.15;}
}
再次执行/etc/init.d/dhcpd restart
啊啊啊啊啊啊啊,终于成功了
老泪纵横ing!!!!
感觉dhcp的坑我都跳进去过了~~~!!