CentOS=6.5: DHCP No subnet declaration for eth0 (192.168.0.10).** Ignoring requests on eth0.……**

在配置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的坑我都跳進去過了~~~!!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章