Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

eth0, my internal interface, has a static address of 10.0.0.1. I also have an interface, p4p1, acting as my external interface. If it matters, my external interface is not physically connected and iptables is off/still being written.

/etc/sysconfig/dhcpd:

DHCPDARGS=eth0

subnet clause from /etc/dhcpd.conf:

subnet 10.0.0.0 netmask 255.255.255.0 {
  option routers 10.0.0.1;
  option domain-name-servers 10.0.0.1;
  option ntp-servers 10.0.0.1;
  default-lease-time 86400; # 1 day 
  max-lease-time 604800;    # 7 days
  use-host-decl-names on;
  ddns-updates on;

  use-host-decl-names on;
  allow unknown-clients;
  ignore client-updates;

  option domain-name "localdomain";
  ddns-domainname "localdomain";
  next-server 10.0.0.1;
  filename "pxelinux.0";

  group # known hosts
  {
    host host1.localdomain  {hardware ethernet [REDACTED]; fixed-address host1.localdomain;}
    host host2.localdomain  {hardware ethernet [REDACTED]; fixed-address host2.localdomain;}
  {

  pool
  {
    one-lease-per-client true;
    ping-check true;
    range 10.0.0.51 10.0.0.60;
  }
}

So, why am I still getting the "No subnet declaration" error message at launch?

No subnet declaration for eth0 (10.0.0.1).
** 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. **

UPDATE 4/1 1900h

Prior to tonight's experiments:

[root@father ~]# ip addr show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 90:e2:ba:2d:92:4d brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0
    inet6 fe80::92e2:baff:fe2d:924d/64 scope link 
       valid_lft forever preferred_lft forever

I switched my internal network IP addresses to 192.168.100.0/24 with matching changes to /etc/dhcpd.conf for no change in behavior.

[root@father ~]# ip addr show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 90:e2:ba:2d:92:4d brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global eth0
    inet6 fe80::92e2:baff:fe2d:924d/64 scope link 
       valid_lft forever preferred_lft forever

[root@father ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 p4p1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 p4p1
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth0

Oh, hey! No gateway there! That's easy to fix with a GATEWAY=192.168.0.1 in the ifcfg-eth0 and ifcfg-p4p1 files. service network restart and...

[root@father ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 p4p1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 p4p1
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 p4p1

So, I have a gateway, but service dhcpd start fails with the same error.

Other notes:

  • p4p1 is not physically connected.
  • service dhcpd configtest says Syntax: OK. So, this almost certainly is not a case of a misplaced brace.
share|improve this question

2 Answers 2

The subnet mask that you have specify in dhcpd.conf must match your interface subnet mask.

Run:

/sbin/ifconfig eth0

You specified the subnet mask as 255.255.255.0, this is most likely wrong. Change your dhcpd.conf to match your interface.

The interface where the DHCP server is listening must have an Static IP of the same subnet you are using in your DHCP configuration.

share|improve this answer
    
ifconfig reports the netmask as 255.255.255.0, which matches the NETMASK=255.255.255.0 setting I put in ifcfg-eth0. –  dafydd Apr 1 '13 at 17:34
    
what is your server IP and router, post output of /sbin/route -n –  Rahul Patil Apr 2 '13 at 1:51
    
I've updated the main question with the information. –  dafydd Apr 2 '13 at 2:20
    
@dafydd Now it is working fine or you are facing any issue –  Rahul Patil Apr 2 '13 at 5:02
up vote 3 down vote accepted

Okay, can I get a "D'oh!" from the congregation!

In RHEL6 and derivatives, the dhcpd config file is now located at /etc/dhcp/dhcpd.conf, not /etc/dhcpd.conf. Moved the file and all is well.

share|improve this answer
    
Now it is working fine or you are facing any issue ? –  Rahul Patil Apr 2 '13 at 3:12
    
It's working fine, now. And that bruise on my forehead is from where I was bashing my head on my desk... –  dafydd Apr 3 '13 at 3:25
    
Annoying, right? I just got bit by this. –  ewwhite Jan 19 at 9:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.