Cisco Support Community

DHCP Option 82 and per-port DHCP

Hey Experts,

Have an odd-ball.

In our organization, each cube/desk/office is designated a certain IP address. This is mainly for mapping to the proper printers in the building etc.

I'm looking for a way to do per-port DHCP. I.E... I know that say port 5/25 is going to cube 4098. Cube 4098 should always have the IP of 192.168.x.98, no matter what device is there.

I've been poking around and it looks like Option-82 MAY be able to help me. I've gotten this labbed out with some success. I have enabled DHCP snooping, mapped a specific circuit-ID to a port and gotten IOS DHCP server to use dhcp classes to assign an IP based on circuit ID. Yay. Next Hurdle.... If I connect device A to a port with this configured, it gets assigned an IP address. If I disconnect device A and connect Device B, it will not get an ip address because the address range for that DHCP class is full, which is logical in a way.

Here's a config on Switch and IOS DHCP Server:

Switch (3750 in this case):

interface GigabitEthernet1/0/2

switchport access vlan 12

switchport mode dynamic desirable

ip dhcp snooping limit rate 100

ip dhcp snooping vlan 12 information option format-type circuit-id string D039

Router / IOS DHCP Server:

ip dhcp pool pool1


   class C1

      address range

ip dhcp class C1

   relay agent information

      relay-information hex 0106010444303339*

Error on Router when I connect device B to the same port after disconnecting device A:

DHCPD: no free address within the address range for class C1 in pool pool1

Can someone advise if I'm barking up the wrong tree here? Is there an alternate way of doing what I'm trying to do? I guess I could keep lease time real low, like 5 min or somthing. This is on a LAN, no WAN involved with this, so bandwidth wouldnt really be an issue, but is that the best option?

Switches are Mostly Cat 4500s and Cisco 3750s.

CreatePlease to create content