«

»

Apr 04 2011

Static DHCP on CISCO IOS

After replacing a normal router with a Cisco 881K, i had to re-assign static addresses to a couple of printers (actually one – because the other has a LCD panel and i can manually enter it’s IP address).

The problem was that Cisco documentation states that after creating a dhcp pool , you just need to enter the IP address and the client identifier. Normally the identifier is the MAC address concatenated with a number representing the Ethernet media type. In my particular case, i had to use only the MAC address, in order for the printer to get the assigned IP.
"DHCP clients require client identifiers. The unique identification of the client is specified in dotted hexadecimal notation, for example, 01b7.0813.8811.66, where 01 represents the Ethernet media type, and the rest is the MAC address for the device".

Steps :
1.Ensure the DHCP service is running
service dhcp
2.Create a new pool named pool1
ip dhcp pool pool1
3.Set the static ip
host 192.168.5.6
4.Enter the hardware address of the device
hardware-address 001b.7813.51e9

*Note : I found that you can use client-identifier 001b.7813.51e9, but this is only in case of Windows machines that supply this identifier through DHCP.

5.(optional) Set the client name
client-name HP2016

As you can see, for my particular case ( HP P2016 printer, and CISCO 881K with IOS 12.4(20)T1 ) i had to use only the MAC address, without the first two digits which represent the Ethernet media type)
The value options for Ethernet (according to here) are:

a) 1 : 10Mb Ethernet

b) 6 : IEEE 802

Useful commands to be used :
show ip dhcp pool
no ip dhcp pool pool1
show ip dhcp binding
show ip dhcp binding 192.168.5.6
clear ip dhcp binding 192.168.5.6

Update : trying to add a second device to pool1 replaced the original binding. So create a new pool for each device.

1 comment

  1. DosTrenzas

    Great post!

    Here is another example:

    http://www.sysadmit.com/2015/03/cisco-dhcp-ip-por-mac.html

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*