Tech: dhcpd tips, and how you should get it to work on a totally separate network

For the poor sods who had problems with dhcpd – my DHCP troubleshooting notes. Done on a Fedora box, version 10 IIRC.

Restart network interfaces:

service network restart

to use tcpdump for packet capture on the server:

tcpdump -i -n port 67 or port 68

run dhcpd in debug mode in foreground:

/usr/sbin/dhcpd eth1 -d -f

stop service:

/etc/rc.d/init.d/dhcpd stop

run dhcpd on eth1 specifically:

/usr/sbin/dhcpd eth1

If you are looking to run dhcpd as a server for other subnets, but not on the subnet it is on, the below sample /etc/dhcpd.conf shows the server as having a static IP address of 1.1.1.2/24, but it only acts as a DHCP server on the network 10.1.0.0/16.

(I used Cisco’s ip-helper to relay the DHCP broadcasts across to 10.1.0.0/16 network, if you were wondering.)

Credit to jmcdaniel for the configuration below.


ddns-update-style interim;
ignore client-updates;

# LAN-SHARE
#This is a filler to make dhcpd believe the adapter is valid
subnet 1.1.1.0 netmask 255.255.255.0 {
}

#This is the dhcpd configuration for the STB network
subnet 10.1.0.0 netmask 255.255.0.0 {
option broadcast-address 10.1.255.255;
option routers 10.1.0.1;
option subnet-mask 255.255.0.0;
# option domain-name "testdhcp.com.au";
option domain-name-servers 10.1.0.1;
# IP address allocation range from 10.1.0.10 to 10.1.255.250
range dynamic-bootp 10.1.0.10 10.1.255.250;
default-lease-time 21600;
max-lease-time 43200;
}

Advertisements