Posted by: isaraffee | April 21, 2010

Configuring DHCP server in Ubuntu Jaunty

Configuring DHCP server in Ubuntu Jaunty

DHCP server: Ubuntu

DHCP client: Vector linux

On DHCP server, install DHCP package

root@ismail-laptop:~# apt-get install dhcp3-server

<output truncated for brevity>

Setting up dhcp3-common (3.1.1-5ubuntu8.2) …

Setting up dhcp3-client (3.1.1-5ubuntu8.2) …

* Reloading AppArmor profiles … [ OK ]

Setting up dhcp3-server (3.1.1-5ubuntu8.2) …

Generating /etc/default/dhcp3-server…

* Reloading AppArmor profiles … [ OK ]

* Starting DHCP server dhcpd3 * check syslog for diagnostics.


invoke-rc.d: initscript dhcp3-server, action “start” failed.

To check if the dhcp packages are installed, type:

# dpkg –list | grep dhcp

ii dhcp3-client 3.1.1-5ubuntu8.2 DHCP client

ii dhcp3-common 3.1.1-5ubuntu8.2 common files used by all the dhcp3* packages

ii dhcp3-server 3.1.1-5ubuntu8.2 DHCP server for automatic IP address assignm

Next on the DHCP server edit the configuration file. But before that I could never strees enough on making a backup copy of the original file.

root@ismail-laptop:~# cd /etc/dhcp3/

root@ismail-laptop:/etc/dhcp3# ls

dhclient.conf dhclient-enter-hooks.d dhclient-exit-hooks.d dhcpd.conf

root@ismail-laptop:/etc/dhcp3# cp -p dhcpd.conf dhcpd.conf.bak

Now edit the file and include the following lines:;

#i added the following

subnet netmask {



The above entries said that to assign IP address in the range of to to a host (dhcp client).

Check that the DHCP server is running. And if changes were done on the configuration file, you have to restart the dhcpd service.

# cd /etc/init.d/

# ./dhcp3-server status

Status of DHCP server: dhcpd3 is not running.

Start the dhcpd server,

# ./dhcp3-server start

  • Starting DHCP server dhcpd3 [ OK ]

Configuring the dhcp client (Vector LInux)

Edit the network settings of the dhcp client. Change the DHCP value to “yes”

root:# cd /etc/rc.d


root:# vi rc.inet1

## The settings







Save and quit. Then you need to restart the network services.

root:# ./rc.inet1 stop

Stopping network eth0 …

root:# ./rc.inet1 start

Starting network eth0 using a DHCP server…

dhcpcd: MAC address = 00:11:85:77:d0:a7

dhcpcd: your IP address =

eth0 Link encap:Ethernet HWaddr 00:11:85:77:D0:A7

inet addr: Bcast: Mask:


RX packets:4 errors:0 dropped:0 overruns:0 frame:0

TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:671 (671.0 b) TX bytes:594 (594.0 b)


From the output, it shows that the dhcp client was assign the IP address of Remember that we have assigned a range of IP addresses on the DHCP server i.e. IP addresses from to

Verify this IP address and check that you can now ping the DHCP server, and that the DHCP server can ping its clients.

root:# ping

PING ( 56(84) bytes of data.

64 bytes from icmp_seq=1 ttl=64 time=0.213 ms

64 bytes from icmp_seq=2 ttl=64 time=0.204 ms

Yes the dhcp client can ping the DHCP server

Try ping the dhcp client from the DHCP server

# ping

PING ( 56(84) bytes of data.

64 bytes from icmp_seq=1 ttl=64 time=1.26 ms

64 bytes from icmp_seq=2 ttl=64 time=0.202 ms

Yes this shows that the dhcp client can ping the DHCP server.

Next we are going to assign IP address based on a specificHardware MAC address.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: