Debian dhcpd "No subnet declaration for eth0"

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.


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)

Tags:

Debian

Dhcp

Pxe