DHCP is an acronym for Dynamic Host Configuration Protocol. It allows a host to broadcast a request for it’s IP settings. Hopefully, a DHCP server like the one we’ll be configuring will respond. Running tcpdump shows a dhcp request looks like:
17:26:02.003956 00:00:00:00:00:00 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0×0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request, length 300
Configuration is easy, to start with, just run ‘apt-get install dhcpd’
Then just create your /etc/dhcpd.conf.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}
#In the above example, we are handing out addresses on the 192.168.1.0/24 range, between 192.168.1.10-100 and 150-200.
#If you want to specify WINS server information to your Windows clients, you can now add:
option netbios-name-servers 192.168.1.1;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
# If this is set, it will NACK responses from other DHCPDs
authoritative;
# Here you can specify a certain MAC (Hardware) address being given a fixed IP address:
host mymachine {
hardware ethernet 00:11:22:33:44:55;
fixed-address 192.168.1.123;
}
The above are the basic options that you’ll use. Once configured, run:
/usr/sbin/dhcpd
You should notice DHCP running in the process (ps) list. Any problems, check syslog. Alternatively run dhcpd in the foreground in debug mode with /usr/sbin/dhcpd -d -f
Tags: apt-get, dhcp, dhcpd, Linux, ps, syslog, tcpdump
You must be logged in to post a comment.