Friday, March 26, 2010

DHCP Server Configuration in UBUNTU

STEP 1:
Install the dhcp package
#apt-get install dhcp3-server
STEP 2:
DHCP server can be configured in two ways
i>Address Pool
ii>Mac Address

STEP 3:

Inorder to configure DHCP server 2 files has to be edited

i>/etc/default/dhcp3-server

ii>/etc/dhcp3/dhcpd.conf

Editing /etc/default/dhcp3-server

This file is edited inorder to show which network interface is been used for DHCP listening

Example:

Find this line INTERACES = "eth0" which will be default,Incase if your using different interface like eth1 or eth2 change eth0 to the interface we are using.

STEP 4:

How to edit /etc/dhcp3/dhcpd.conf

Using Address Pool method

default-lease-time 600;

max-lease-time 7200;

option subnet-mask 255.255.255.0;

option broadcast-address 192.168.1.255;

option routers 192.168.1.254 ; //default gateway being used

option domain-name-servers 192.168.1.1,192.168.1.2;

option domain-name "

subnet 192.168.1.0 netmask 255.255.255.0 {

192.168.1.10 192.168.1.200;

}

Using MAC Address method

This method can be used to reserve fixed IP address for machines depending on mac address

Add the following to the above mentioned

host server1{

hardware ethernet

fixed-address

}

STEP 5:

Restart DHCP service

#/etc/init.d/dhcp3-server restart

Also start the networking service

#/etc/init.d/networking restart


No comments: