Default DHCP client-id

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.

Obviously, if your ISP checks your MAC address (and at least most cable operators do), you might have a problem. To make the router behave like a workstation, use the ip address dhcp client-id interface-name configuration command. The new client ID will be the MAC address of the specified interface (which can be different from the interface you're configuring). You can inspect the actual client ID in ASCII and hex with the debug dhcp detail. This is a sample default DHCP request packet:
DHCP: SRequest attempt # 1 for entry:
Temp IP addr: 172.18.0.3 for peer on Interface: FastEthernet0/1
Temp sub net mask: 255.255.255.0
DHCP Lease server: 172.18.0.1, state: 5 Renewing
DHCP transaction id: 2578
Lease: 600 secs, Renewal: 300 secs, Rebind: 525 secs
Next timer fires after: 00:03:46
Retry count: 1 Client-ID: cisco-0016.c85e.fbc9-Fa0/1
Client-ID hex dump: 636973636F2D303031362E633835652E
666263392D4661302F31

Hostname: a1
... and this is a DHCP request packet after the client-id option has been attached to the ip address dhcp command.
Temp IP addr: 0.0.0.0 for peer on Interface: FastEthernet0/1
Temp sub net mask: 0.0.0.0
DHCP Lease server: 0.0.0.0, state: 9 Purging
DHCP transaction id: 5CD
Lease: 0 secs, Renewal: 0 secs, Rebind: 0 secs
Next timer fires after: 00:00:26
Retry count: 0 Client-ID: 0016.c85e.fbc9
Client-ID hex dump: 0016C85EFBC9

Hostname: a1

3 comments:

  1. Wow, i didn't know that. Thank you. I had blog about you several times in my blog.

    Hackathology

    http://hackathology.blogspot.com
  2. Yeah, dunno where the heck that came from - using "cisco" and the dotted MAC. Oh well.

    On a related note: the route that gets populated into the routing table has a distance of 254 - which is troublesome sometimes (ie: if you also have a static route with distance 254 pointing to null0, or if you want to use the DHCP route but are also receiving an alternate route via OSPF or EIGRP).

    The solution - use the "ip dhcp-client default-router distance" global config command, and set the distance to something more rational - I personally use 250.

    And no, messing with OSPF so the distance is 255 for received updates won't work - 255 is "unreachable" . . . ;)
  3. Note 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.
Add comment
Sidebar