天天看点

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