Posted by: isaraffee | April 21, 2010

Assgining IP address with a specific MAC address

Assgining IP address with a specific MAC address

Suppose our dhcp client has a MAC address of 00:11:85:77:d0:a7 and we want to fixed its IP address as These are the steps:

Firstly on the DHCP server, edit the dhcpd.conf and add the following lines.

# cd /etc/dhcp3/

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

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

root@ismail-laptop:/etc/dhcp3# vi dhcpd.conf

#I add this

subnet netmask {


host examplehost {

hardware ethernet 00:11:85:77:d0:a7;



Save and quit. Then restart the dhcpd service.

You can also run the following command

# service dhcp3-server restart

* Stopping DHCP server dhcpd3 [ OK ]

* Starting DHCP server dhcpd3 [OK].

On the dhcp client, in my case the Vector Linux, type:

#/etc/rc.d/./rc.inet1 stop

#/etc/rc.d/./rc.inet1 start

if it fail to obtain IP address then type:


This is the DHCP client daemon. Then check the IP address. It should now assign the IP address based on the MAC address.

# ifconfig eth0

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

inet addr: Bcast: Mask:



You can include the DNS server in the DHCP server

option domain-name-servers;

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: