9


I am trying to set up a pxe boot server on a Debian 6.0.3 Squeeze machine that gives images of PLoP Linux. I was following a this tutorial.
When I try to start dhcpd (from package dhcp3-server), I get the following:

No subnet declaration for eth0 (10.0.0.0).
**Ignoring requests on eth0. If this is not what
  you want, please write a subnet delclaration
  in your dhcpd.conf file for the network segment 
  to which interface eth0 is attached. **



Not configured to listen on any interfaces!

My /etc/dhcpd.conf is identical to that in the tutorial save for a few changes:

host testpc {
        hardware ethernet 00:0C:6E:A6:1A:E6;
        fixed-address 10.0.0.250;
}

is instead

host tablet {
        hardware ethernet 00:02:3F:FB:E2:6F;
        fixed-address 10.0.0.249;
}

My /etc/network/interfaces is:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 10.0.0.0
        netmask 255.255.255.0

And this is my /etc/default/isc-dhcp-server:

# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"

which I copied to /etc/default/dhcp3-server as well, unsure which it would check.

I also tried setting the ip in /etc/network/interfaces as 10.0.0.1 and 10.0.0.2, but it produced the same result.

8

Since dhcpd has to hand out IP addresses to clients, it needs to know the range of addresses that it is responsible for. The subnet declaration gives dhcpd that information and more. Assuming you're using 10.0.0/24, the following should get you started and past the error message, but you really need to get into the documentation to go further. Add this to your dhcpd.conf:

subnet 10.0.0.0 netmask 255.255.255.0 { 
   authoritative; 
   range 10.0.0.1 10.0.0.254; 
   default-lease-time 3600; 
   max-lease-time 3600; 
   option subnet-mask 255.255.255.0; 
   option broadcast-address 10.0.0.255; 
   option routers 10.0.0.0; 
   option domain-name-servers 8.8.8.8; 
   option domain-name "example.com"; 
} 

The IP addresses I plugged in above are guesses. You've got to set these properly for your setup.

2

The problem is that 10.0.0.0 is not a valid IPv4 address. The first address in the subnet (the address with all zeros for the host portion) is the subnet identifier and therefore is not a valid host address. Try 10.0.0.1. You should also avoid the last address in a subnet, as that's the IP broadcast address.

Decimal: 
  Address:     10   .0  .0  .0
  Subnet Mask: 255.255.255.255
Hex:     
  Address:     0A 00 00 00 
  Subnet Mask: FF FF FF 00
  Network:     ^^ ^^ ^^
  Host:                 ^^
  Smallest Addr:        01 (.1)
  Largest Addr:         FE (.254)
  Broadcast:            FF (.255)
1

I ended up just purging dhcp3-server and using dnsmasq instead. I went through the configuration file for it and was able to use the examples it had commented to configure my server how I needed. dnsmasq also has a built in tftp server that I used for the PXE boot.

  • I am having the same problem as you did here I was wondering if you can share some light on this or share your dnsmasq.conf please…Thanks! – user1680784 Jun 26 '14 at 21:21
  • @user1680784 I no longer have the system that was set up to do this so I cannot share my config file. While I do not know what you are trying to accomplish specifically, if you are having trouble configuring dhcpd or dnsmasq by hand you may want to try using DRBL to give out Linux boot images. – Suchipi Jun 26 '14 at 22:57
0

Check with

ifconfig eth0

If your interface eth0 has the correct ipv4

(it seems you set it to address 10.0.0.0 which would be invalid anyway)

if it has an IP in the wrong range, give it a new adress for example with:

ifconfig eth0 10.0.0.1

then try restarting your dhcp server

0

Removing dnsmasq solved my problem

sudo apt-get -y remove dnsmasq
0

On systemd-based OS'es make sure NetworkManager-wait-online.service is running.

I've had a similar problem on Fedora 26, and because I could not find any reference I will post my solution here in case someone needs it:

No subnet declaration for enp2s0 (no IPv4 addresses).  
** Ignoring requests on enp2s0.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface enp2s0 is attached. **

Fedora 26 is a systemd-based OS, where traditional init scripts (/etc/rc.d/init.d) have been replaced by native systemd services files.

My dhcpd.service file:

[Unit]
Description=DHCPv4 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
Wants=network-online.target
After=network-online.target
After=time-sync.target

[Service]
Type=notify
EnvironmentFile=-/etc/sysconfig/dhcpd
ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS
StandardError=null

[Install]
WantedBy=multi-user.target

This lines:

Wants=network-online.target
After=network-online.target

make sure that the service starts after the network is online but the right "wait" service must be enabled too 1: NetworkManager-wait-online.service

Mine was not.

reference: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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