Difference between revisions of "Cisco DHCP configuration"

From Ever changing code
Jump to navigation Jump to search
Line 33: Line 33:
   host 10.0.99.1 255.255.255.128
   host 10.0.99.1 255.255.255.128
   client-identifier 017c.69f6.e1d8.7d
   client-identifier 017c.69f6.e1d8.7d
   client-name ap1-ds
  ! client-name does not work for me assigning the hostnaem to a client/AP
   client-name ap1


If you configure a Cisco router as a DHCP client, you'll notice that it uses weird client-id in its DHCP requests (assuming you care about client IDs on the DHCP server). Instead of using the interface MAC address as the client ID (as most workstations do), the client ID is the string 'cisco-dotted.mac.ascii-ifname' where the dotted.mac.ascii is the interface MAC address in ascii and the ifname is the short interface name.
debug dhcp detail
ote that if you have <tt>client-id cc05.12bc.0000</tt> on your client ; on your server, you need to use <tt>client-id 01cc.0512.bc00.00</tt>. So there's a 01 prefix to add on the server where 01 represents the Ethernet media type.


[[Category:cisco]]
[[Category:cisco]]

Revision as of 01:04, 22 October 2013

This configuration will be applied to Cisco 1941 with EHWIC-3G-HSPA+7 card and Light Weigh Access Point.

Basic DHCP config

Configure Cisco router as DHCP SERVER
configure terminal
 service dhcp
 ip dhcp pool LMA-POOL
  network 192.168.100.0 255.255.255.0
  default-router 192.168.100.254
  dns-server 192.168.100.254 8.8.8.8
  domain-name lma.gateway
  lease 0 8 '<--- 8 hrs lease -- number represents: Days Hours Minutes ---'
ip dhcp excluded-address 192.168.100.1 192.168.100.10
ip dhcp excluded-address 192.168.100.240 192.168.100.255
Cisco router interface configured to obtain an IP Address from DHCP server
configure terminal
r1-basic(config)#int gi 0/0
r1-basic(config-if)#ip address dhcp
r1-basic(config-if)#no shutdown
r1-basic(config-if)#end

once ip is assigned you will see

*Sep  1 22:08:50.003: %DHCP-6-ADDRESS_ASSIGN: Interface GigabitEthernet0/0 assigned DHCP address 192.168.1.66, mask 255.255.255.0, hostname r1-basicchanged state to up
Clear DHCP binding will clear the current assignment then resetting a client interface will trigger to re negotiate IP address
R1#clear ip dhcp binding ?
 *        Clear all automatic bindings
 A.B.C.D  Clear a specific binding
 vrf      DHCP vrf bindings

DHCP IP bindings

ip dhcp pool AP1
 host 10.0.99.1 255.255.255.128
 client-identifier 017c.69f6.e1d8.7d
 ! client-name does not work for me assigning the hostnaem to a client/AP
 client-name ap1

If you configure a Cisco router as a DHCP client, you'll notice that it uses weird client-id in its DHCP requests (assuming you care about client IDs on the DHCP server). Instead of using the interface MAC address as the client ID (as most workstations do), the client ID is the string 'cisco-dotted.mac.ascii-ifname' where the dotted.mac.ascii is the interface MAC address in ascii and the ifname is the short interface name.

debug dhcp detail

ote that if you have client-id cc05.12bc.0000 on your client ; on your server, you need to use client-id 01cc.0512.bc00.00. So there's a 01 prefix to add on the server where 01 represents the Ethernet media type.