Wednesday, 2 December 2015

Cisco Router - DHCP configuration

Set up static mapping for device that requires permanent IP address rather than IP assign by DHCP server (for example for printer)

Requirements:

Static IP for printer
MAC address of the printer
IP DHCP pool: 172.19.142.0 255.255.255.0 
Excluded IP: 172.19.142.0 172.19.142.99 and 172.19.142.200 172.19.142.255 (our excluded IPs)
Static IP (printer): 172.19.142.211


Set up excluded addresses:

(Static IP needs to be one of excluded IPs)
#ip dhcp excluded-address 172.19.142.0 172.19.142.99
#ip dhcp excluded-address 172.19.142.200 172.19.142.255


Set up DHCP pool:

#ip dhcp pool LAN_POOL
    import all
    network 172.19.142.0 255.255.255.0
    domain-name cisco.local
    default-router 172.19.142.254
    dns-server 172.19.142.17 172.19.140.16
    lease 0 2

Set up Static IP Mapping:

#ip dhcp pool STATIC
    host 172.19.142.211 255.255.255.0  (printers IP)
    hardware-address d485.6440.b314   (printers MAC address)
    domain-name cisco.local
    default-router 172.19.142.254
    dns-server 172.19.142.17 172.19.140.16

Clear DHCP address from router database:

#sh ip dhcp binding (to see DHCP database)
#clear ip dhcp binding 1.1.1.1 (This will clear IP address from router database, but the device will still respond on old IP. To assign new IP: reboot of the device or clear old IP with ipconfig /renew)

1.1 Switched campus 1.1.a Switch administration 1.1.a i Managing MAC address table Show Commands: Switch#show mac address-table ?   address ...