# strange dhcpd problem

## jrknowles1

When I woke up this morning I found that my router had gone down some time during the night. Anyway I began to gring the system back up as I would normaly do, however during the process I got this error

"No Subnet Declaration for eth1 (0.0.0.0)

Ignoring all requests on eth1. If this is not what you want, please write a subnet declaration in your dhcpd.conf file for the network segment to which interface eth1 is attached"

Out of all of the times that I have had to restart the dhcpd server I have never had this error and I have not changed that file since I created it. Any suggestions.

----------

## allucid

run ifconfig and make sure your ethernet cards are set up correctly. eth1 shoud not have an ip of 0.0.0.0

----------

## jrknowles1

I ran ifconfig and eth1 has the IP address that it has always had 192.168.1.254

----------

## ctford0

I've got the same problem, any ideas how to get it working??

Chris

----------

## allucid

just for the hell of it post your dhcpd.conf and ifconfig output for the ethernet device the daemon is listening on. not sure what else could cause this error...

----------

## dook43

I'm having the same problem.  here's dhcpd.conf:

```

# dhcpd.conf

#

# Sample configuration file for ISC dhcpd

#

# option definitions common to all supported networks...

default-lease-time 3600;

max-lease-time 86400;

ddns-update-style ad-hoc;

# If this DHCP server is the official DHCP server for the local

# network, the authoritative directive should be uncommented.

authoritative;

# Use this to send dhcp log messages to a different log file (you also

# have to hack syslog.conf to complete the redirection).

log-facility local7;

# No service will be given on this subnet, but declaring it helps the

# DHCP server to understand the network topology.

# This is a very basic subnet declaration.

subnet 10.0.25.0 netmask 255.255.255.0 {

  range 10.0.25.4 10.0.25.254;

  option routers 10.0.25.1;

  #option broadcast-address 10.0.25.255;

  option domain-name-servers 68.11.16.245, 68.11.16.30, 68.1.18.30;

  #option domain-name "internal.verified-systems.com";

}

# This declaration allows BOOTP clients to get dynamic addresses,

# which we don't really recommend.

# A slightly different configuration for an internal subnet.

# Hosts which require special configuration options can be listed in

# host statements.   If no address is specified, the address will be

# allocated dynamically (if possible), but the host-specific information

# will still come from the host declaration.

# Fixed IP addresses can also be specified for hosts.   These addresses

# should not also be listed as being available for dynamic assignment.

# Hosts for which fixed IP addresses have been specified can boot using

# BOOTP or DHCP.   Hosts for which no fixed address is specified can only

# be booted with DHCP, unless there is an address range on the subnet

# to which a BOOTP client is connected which has the dynamic-bootp flag

# set.

#host lordaeron {

  #hardware ethernet 00:50:BF:91:AD:2A;

  #fixed-address 10.0.25.2;

#}

#host gamecock {

  #hardware ethernet 00:80:c7:7c:f2:bf;

  #fixed-address 10.0.25.3;

#}

# You can declare a class of clients and then do address allocation

# based on that.   The example below shows a case where all clients

# in a certain class get addresses on the 10.17.224/24 subnet, and all

# other clients get addresses on the 10.0.29/24 subnet.

```

/etc/init.d/dhcp start output:

```
* Starting dhcpd...

Internet Software Consortium DHCP Server V3.0pl2

Copyright 1995-2003 Internet Software Consortium.

All rights reserved.

For info, please visit http://www.isc.org/products/DHCP

Wrote 0 leases to leases file.

No subnet declaration for eth0 (68.105.1.93).

** Ignoring requests on eth0.  If this is not what

   you want, please write a subnet declaration

   in your dhcpd.conf file for the network segment

   to which interface eth0 is attached. **

Not configured to listen on any interfaces!

If you did not get this software from ftp.isc.org, please

get the latest from ftp.isc.org and install that before

requesting help.

If you did get this software from ftp.isc.org and have not

yet read the README, please read it before requesting help.

If you intend to request help from the dhcp-server@isc.org

mailing list, please read the section on the README about

submitting bug reports and requests for help.

Please do not under any circumstances send requests for

help directly to the authors of this software - please

send them to the appropriate mailing list as described in

the README file.

exiting.
```

ifconfig output:

```

root@meta dhcp # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:04:AC:33:13:61

          inet addr:68.105.1.93  Bcast:68.105.3.255  Mask:255.255.252.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:5367197 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2075216 errors:1 dropped:0 overruns:0 carrier:1

          collisions:0 txqueuelen:100

          RX bytes:4090455633 (3900.9 Mb)  TX bytes:156506430 (149.2 Mb)

          Interrupt:9 Base address:0xb800 Memory:ee800000-ee800038

eth1      Link encap:Ethernet  HWaddr 00:40:05:80:43:B8

          inet addr:10.0.25.1  Bcast:10.0.25.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2372737 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3404065 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100

          RX bytes:286578894 (273.3 Mb)  TX bytes:3946296381 (3763.4 Mb)

          Interrupt:9 Base address:0x5000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:1571 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1571 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:94478 (92.2 Kb)  TX bytes:94478 (92.2 Kb)

```

I'm of course trying to run dhcp on eth1, but its complaining that I have no configuration for eth0.

----------

## ctford0

I finally got my dhcp to work by hard coding the eth1 (which is the device that I wanted to run it on) in the rc-script.  However I still get the warning, but at least now it works.

Chris

----------

## staynalive

Take a look in the /etc/conf.d/dhcp file. For some odd reason there's a restriction on the iface, but you can change that. I was having having the same problem until I changed that file.

Hope this helps

----------

## ctford0

Sweet!!!!

After changing the iface in /etc/conf.d/dhcp to eth0 and then in my dhcpd.conf adding authoritative dhcp now starts up with no errors...

Thanks all

Chris

----------

## dmind

sorry fellows.... i have search my ass of here and couldnt solve it (or im just dumb?)... so here goes. (hope i get a reply soon)

well, i have dhcp on eth0 which get the ip from my isp.

on eth1 (192.168.1.1) i want to run a dhcp server.

/etc/dhcp/dhcpd.conf

ddns-update-style  ad-hoc;

authorative;

default-lease-time 2592000;

max-lease-time 5184000;

authorative;

option subnet-mask 255.255.255.0;

option broadcast-address 192.168.1.255;

option routers 192.168.1.1;

option domain-name-servers 10.0.0.1, 10.0.0.2;

option domain-name "utsikten.org";

subnet 192.168.1.0 netmask 255.255.255.0 {

        range 192.168.1.100 192.168.1.150;

        option domain-name "utsikten.org";

        option domain-name-servers 10.0.0.1 , 10.0.0.2;

        option netbios-name-servers 192.168.1.1;

        option netbios-node-type 8;

        option subnet-mask 255.255.255.0;

        option broadcast-address 192.168.1.255;

        option routers 192.168.1.1;

        }

host daniel.utsikten.org {

        hardware ethernet 00:A0:24:4A:FD:56;

        fixed-address 192.168.1.100;

        }

--------------------------------------------------------------

when i try to start dhcpd with /etc/init.d/dhcp start

it goes basiclly:

Wrote 0 deleted host decls to leases file.

Wrote 0 new dynamic host decls to leases file.

Wrote 0 leases to leases file.

No subnet declaration for eth0 (217.208.56.141).

** Ignoring requests on eth0.  If this is not what

   you want, please write a subnet declaration

   in your dhcpd.conf file for the network segment

   to which interface eth0 is attached. **

Not configured to listen on any interfaces

-----------------------------------------------------------

and when try to start it with /usr/sbin/dhcpd eth1

it goes:

Wrote 0 deleted host decls to leases file.

Wrote 0 new dynamic host decls to leases file.

Wrote 0 leases to leases file.

socket: Protocol not available - make sure

CONFIG_PACKET (Packet socket) and CONFIG_FILTER

(Socket Filtering) are enabled in your kernel

configuration!

--------------------------------------------------------------------

well ive have those options enabled in the kernel and all. after all, im running it as a gateway/etc/etc.

any ideas?  :Rolling Eyes: 

----------

## ARC2300

If I remember correctly, when you have two NICs, you have to specify which one is the DHCP server.  If not, it will use both, and since your ISP is running a DHCP server also, that's bad.

I forget where you specify which NIC you want it to use, though.  I think you may do it in the dhcpd.conf file, but I'm not sure.   :Confused: 

[edit]Look in /etc/conf.d/dhcp.

In that file, that states which NIC uses DHCP for serving out addresses.  Changing that from one NIC to the other may help.

----------

## dmind

 *ARC2300 wrote:*   

> 
> 
> I forget where you specify which NIC you want it to use, though.  I think you may do it in the dhcpd.conf file, but I'm not sure.  
> 
> [edit]Look in /etc/conf.d/dhcp.
> ...

 

yeah i know. i have tryed it but...

/etc/conf.d/dhcp:

#configure which interface or interfaces to for dhcp to listen on

#list all interfaces space separated.

IFACE="eth0"

# Insert any other options needed

DHCPD_OPTS=""

--------------------------------

i changed the line DHCPD_OPTS="" to DHCPD_OPTS="eth1"

but it didnt work. or am i just specifying the wrong options?

and btw doesnt IFACE="eth0" stand for which the nic who listens after a dhcp server to get an ip. well im gonna give it a shot =)

nope it didnt work. same message as above.  :Crying or Very sad: 

btw, should i post some other relevant conf's if it could help sort out my prob?

----------

## devon

Can you post the output of the following?

```
/bin/egrep "FILTER|PACKET" /usr/src/linux/.config
```

----------

## dmind

 *devon wrote:*   

> Can you post the output of the following?
> 
> ```
> /bin/egrep "FILTER|PACKET" /usr/src/linux/.config
> ```
> ...

 

output:

CONFIG_PACKET=y

# CONFIG_PACKET_MMAP is not set

CONFIG_NETFILTER=y

# CONFIG_NETFILTER_DEBUG is not set

# CONFIG_FILTER is not set

CONFIG_IP_NF_FILTER=m

CONFIG_IP_NF_ARPFILTER=m

# CONFIG_NCPFS_PACKET_SIGNING is not set

[edit] oh man... ive missed Socket Filtering in the kernel. recompiling.  :Embarassed:   [/edit]

[edit] ive recompiled and now everything works great =) [/edit]

----------

