computers:dhcp_server_configuration
This is an old revision of the document!
Table of Contents
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="eth3"
Configure the interface used in /etc/network/interfaces
, for example:
auto eth3 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; } # printer host poplar { hardware ethernet f4:ce:46:38:c7:7c; fixed-address 192.168.0.11; } host aspen { hardware ethernet 00:00:48:dd:e0:d8; fixed-address 192.168.0.12; } # server host oak { hardware ethernet 6c:f0:49:e4:66:49; fixed-address 192.168.0.21; } host maple { hardware ethernet bc:ae:c5:15:ba:ed; fixed-address 192.168.0.22; } # workstation host sage { hardware ethernet 34:15:9e:2f:97:8a; fixed-address 192.168.0.101; } host aloe { hardware ethernet 34:15:9e:2e:9b:06; fixed-address 192.168.0.102; } host azalea { hardware ethernet c4:2c:03:1d:03:50; fixed-address 192.168.0.103; } host camellia { hardware ethernet c4:2c:03:10:bf:95; fixed-address 192.168.0.104; } host fuchsia { hardware ethernet c4:2c:03:1e:9d:fd; fixed-address 192.168.0.105; } host basil { hardware ethernet c8:2a:14:48:62:0d; fixed-address 192.168.0.106; }
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.1314598627.txt.gz · Last modified: 2011/08/29 14:17 by chkuo