天天看點

centos dhcpd No subnet declaration 解決方法

1、Centos dhcp環境

centos 6.6,dhcp通過yum安裝,網卡IP:10.70.11.230/24

2、dhcp配置檔案

option domain-name-servers  10.70.11.230;

default-lease-time 432000;   

max-lease-time 432000;

authoritative;

ddns-update-style none;

subnet 10.70.12.0 netmask 255.255.255.0{

       range dynamic-bootp 10.70.12.10 10.70.12.229;

       option broadcast-address 10.70.12.255;

       option routers 10.70.12.1;

}

3、dhcp服務啟動報錯,日志如下:

Oct  7 10:52:31 sh dhcpd: No subnet declaration for eth0 (10.70.11.230).

Oct  7 10:52:31 sh dhcpd: ** Ignoring requests on eth0.  If this is not what

Oct  7 10:52:31 sh dhcpd:    you want, please write a subnet declaration

Oct  7 10:52:31 sh dhcpd:    in your dhcpd.conf file for the network segment

Oct  7 10:52:31 sh dhcpd:    to which interface eth0 is attached. **

Oct  7 10:52:31 sh dhcpd:

Oct  7 10:52:31 sh dhcpd:

Oct  7 10:52:31 sh dhcpd: Not configured to listen on any interfaces!

Oct  7 10:52:31 sh dhcpd:

Oct  7 10:52:31 sh dhcpd: This version of ISC DHCP is based on the release available

Oct  7 10:52:31 sh dhcpd: on ftp.isc.org.  Features have been added and other changes

Oct  7 10:52:31 sh dhcpd: have been made to the base software release in order to make

Oct  7 10:52:31 sh dhcpd: it work better with this distribution.

Oct  7 10:52:31 sh dhcpd:

Oct  7 10:52:31 sh dhcpd: Please report for this software via the CentOS Bugs Database:

Oct  7 10:52:31 sh dhcpd:     http://bugs.centos.org/

Oct  7 10:52:31 sh dhcpd:

Oct  7 10:52:31 sh dhcpd: exiting.

4、解決問題的方法

Centos dhcpd服務配置的時候一定要将本身IP位址劃入DHCP配置設定範圍

調整後的dhcpd.conf

option domain-name-servers  10.70.11.230;

default-lease-time 432000;   

max-lease-time 432000;

authoritative;

ddns-update-style none;

subnet 10.70.11.0 netmask 255.255.255.0{

       range dynamic-bootp 10.70.11.10 10.70.11.229;

       option broadcast-address 10.70.11.255;

       option routers 10.70.11.1;

}

subnet 10.70.12.0 netmask 255.255.255.0{

       range dynamic-bootp 10.70.12.10 10.70.12.229;

       option broadcast-address 10.70.12.255;

       option routers 10.70.12.1;

}

轉載于:https://my.oschina.net/u/3702678/blog/1547257