Search This Blog

Sunday, September 29, 2013

Cisco IOS DHCP reservation

Cisco IOS DHCP basic configuration:



ip dhcp excluded-address 192.168.10.1192.168.10.100
!
ip dhcp pool LAN
 import all
 network 192.168.10.0 255.255.255.0
 default-router 192.168.10.1
 domain-name network.local
 dns-server 212.143.212.143 194.90.1.5
 lease 7

network is 192.168.10.0/24 with .1 as default router and 2 DNS servers.

now let's configure reservation for my iPad:


ip dhcp pool iPAD2
 host 192.168.10.15 255.255.255.0
 client-identifier 0164.a6c2.f3fc.11
 client-name iPAD2



I reserved IP 192.168.10.15 for MAC address 64a6.c2f3.fc11, which in this case is my iPad MAC address, note that a leading 01 comes to notate that this is an Ethernet media. 

So for every device you would like to do a DHCP reservation create a new pool using his MAC address along with the leading 01. Don't forget to reserve an IP which is in the exclude range.

the following configuration will work almost for every type of device but yesterday i noticed it doesn't work with my Linux machine (CentOS 5.9)?!

after digging a while i found the solution:


ip dhcp pool CENTOS
 host 192.168.10.16 255.255.255.0
 hardware-address 0040.c3a4.adf5
 client-name CENTOS

note that this time no leading 01 is needed, only the MAC address of the NIC.