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.1.1
    netmask 255.255.255.0
    gateway 192.168.1.254

Edit /etc/dhcp/dhcpd.conf, for example:

# /etc/dhcp/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.1.0 netmask 255.255.255.0 {
	option routers                  192.168.1.1;
	option subnet-mask              255.255.255.0;
	option broadcast-address        192.168.1.255;
 
	range 192.168.1.200 192.168.1.250;
}
 
# printer
host poplar {
	hardware ethernet XX:XX:XX:XX:XX:XX;
	fixed-address 192.168.1.11;
}
 
# server
host oak {
	hardware ethernet XX:XX:XX:XX:XX:XX;
	fixed-address 192.168.1.21;
}
 
# workstation
host sage {
	hardware ethernet XX:XX:XX:XX:XX:XX;
	fixed-address 192.168.1.101;
}

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.1376463462.txt.gz · Last modified: 2013/08/14 14:57 by chkuo