Per port IP address assignment

I was looking at setting up our out of band network and was wondering if I could configure DHCP on the switch and have it hand out an address to a specific port. For example I would like port gi1/0/1 to get the IP of, port gi1/0/27 to get IP In doing some searching I found a config guide for doing exactly that. It’s called ‘DHCP Server Port-Based Address Allocation’. Here’s an example:

Global Config Commands-

ip dhcp use subscriber-id client-id
ip dhcp subscriber-id interface-name

ip dhcp pool PortDHCPPool
lease 8
address client-id "Gi1/0/9" ascii
address client-id "Gi1/0/10" ascii

Under each interface you need to add-

ip dhcp server use subscriber-id client-id

You can verify by running the following command-

Switch#sho ip dhcp pool PortDHCPPool

Pool PortDHCPPool :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0 
Total addresses : 254
Leased addresses : 0
Excluded addresses : 2
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased/Excluded/Total - 0 / 2 / 254 
2 reserved addresses are currently in the pool :
Address Client Gi1/0/9 Gi1/0/10

Here you can see I have two ports configured and each is associated with it’s matching interface. Under the DHCP server, the client id should start with either Gi or gi.