Wednesday, March 12, 2008

DHCP Server on Linux

My environment: RH FC8, x86_64

Before get started, make sure you have the dhcp package installed:


The main configuration file is in /etc/dhcpd.conf, here is mine:

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

subnet netmask {

option routers;
option subnet-mask;

option domain-name "";
option domain-name-servers;

next-server; #My CUCM address

range dynamic-bootp; #The dhcp pool range
default-lease-time 21600;
max-lease-time 43200;

host test-server {
hardware ethernet 12:34:56:78:AB:CD;
fixed-address; # Fixed allocation based on MAC address


Restart your DHCP daemon:
/etc/init.d/dhcpd restart

Check the leases by viewing the lease file at /var/lib/dhcpd/dhcpd.leases, here is the sample file:

lease {
starts 2 2008/03/11 08:00:21;
ends 2 2008/03/11 14:00:21;
tstp 2 2008/03/11 14:00:21;
binding state free;
hardware ethernet 00:19:d2:d0:10:01;
uid "\001\000\031\322\320\020\001";
lease {
starts 2 2008/03/11 12:34:28;
ends 2 2008/03/11 18:34:28;
binding state active;
next binding state free;
hardware ethernet 00:02:78:90:e6:c5;
uid "\001\000\002x\220\346\305";

No comments: