User Tools

Site Tools


computers:dhcp_server_configuration

This is an old revision of the document!


DHCP server configuration

Installation

Download and install the dhcp3-server package

sudo apt-get install dhcp3-server

Configuration

Specify the interfaces dhcpd should listen to in /etc/default/dhcp3-server, for example:

INTERFACES="eth1" 

Configure the interface used in /etc/network/interfaces, for example:

auto eth1
iface eth1 inet static
    address 192.168.0.1
    netmask 255.255.255.0
    gateway 192.168.0.254

Edit /etc/dhcpd.conf, for example:

# /etc/dhcpd.conf
ddns-update-style none;
log-facility local7;
option domain-name-servers 140.109.13.10, 140.109.1.10;
default-lease-time 86400;
max-lease-time 86400;
 
subnet 192.168.0.0 netmask 255.255.255.0 {
	option routers                  192.168.0.1;
	option subnet-mask              255.255.255.0;
	option broadcast-address        192.168.0.255;
 
	range 192.168.0.200 192.168.0.250;
}
 
host aloe {
	hardware ethernet 34:15:9e:2e:9b:06;
	fixed-address 192.168.0.11;
}
host poplar {
	hardware ethernet f4:ce:46:38:c7:7c;
	fixed-address 192.168.0.101;
}
host aspen {
	hardware ethernet 00:00:48:dd:e0:d8;
	fixed-address 192.168.0.102;
}

Activation

To start/stop/restart the service:

sudo /etc/init.d/dhcp3-server start
sudo /etc/init.d/dhcp3-server stop
sudo /etc/init.d/dhcp3-server restart

Monitoring

To check dhcpd status:

sudo /etc/init.d/dhcp3-server status

To see the leases:

more /var/lib/dhcp3/dhcpd.leases

References

computers/dhcp_server_configuration.1314201507.txt.gz · Last modified: 2011/08/24 23:58 by chkuo