2013年12月25日 星期三

Install DHCP server on ubuntu 12.04

Below list the procedures to setup DHCP server on ubuntu 12.04 for my machine.

1. install DHCP server
sudo apt-get install isc-dhcp-server


2. set interface  
sudo vi /etc/default/isc-dhcp-server 
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"

3. set DHCP client ip range    
sudo vi /etc/dhcp/dhcpd.conf 
default-lease-time 6000;
max-lease-time 72000;
option domain-name-servers 192.168.0.1, 168.95.1.1;
subnet 192.168.0.0 netmask 255.255.255.0 {
   range 192.168.0.160  192.168.0.170;
   option routers 192.168.0.1;
   host testFixedIP {
      hardware ethernet 08:00:27:C5:EB:50;
      fixed-address 192.168.0.169;
   }
}   


4. restart DHCP server
sudo service isc-dhcp-server restart

Reference:
https://help.ubuntu.com/community/dhcp3-server