Cisco – DHCP static

First some news, I finally passed my CCNP Switch exam.. Happy days!
next up is the CCNP Route… glad I’m doing a course on that one..

But as a network nerd, I’m still improving my home network, and lately I’ve moved more away from my beloved PFSense box.
My Cisco 2960S that makes up the core of my network right now, is now taking a big roll in my Network. After enabling ip routing, I also had to add dhcp support for my little switch.. But hey, static dhcp binding ain’t that easy I guess.. well you can make a dedicated pool for every one of your static mappings, but that’s a big hazel.. here is my quick fix after searching the web for a while.

My config

!Reserved the first 50 addressess
ip dhcp excluded-address
!Setup my pool for LAN
ip dhcp pool LAN
!Setup my static pool for LAN
ip dhcp pool static
origin file flash://static-map

And the content of my flash://static-map file

*time* Sep 28 2013 11:10 AM
*version* 1
!IP address Type Hardware address Lease expiration /25 id xxxx.yyyy.zzzz.KK Infinite /25 id xxxx.yyyy.zzzz.KK Infinite

And here is the catch, you can’t use the mac address, you need the ID…
But if you let the machine/device get a normal dhcp ip, you can find the id by running
#sh ip dhcp binding
Clear it, with the ip x.x.x.x
#clear ip dhcp binding x.x.x.x

And today’s tip, use tftp to transfer the file.. you can use tclsh, but that’s why to complicated.

2 Coments

  • mihai07/05/2014

    Is this method working for you well ? I have ongoing discussions with people about this method over here

    I have an issue with my Cisco 1801 and they are pointing that this method might cause trouble.

  • Lars-Georg Paulsen22/09/2014

    This is used on a 2960 Switch, and is working flawless. I agree with aryoba on forum, that you should separate clients and servers on different subnets, but in my case, I’m doing dhcp lease for my servers as well.. the clients are on a totally different subnet. But the methos in it self is working. Never tried it on a router, but I guess it should work on those as well.

  • Leave a Comments