Catalyst IOS-XE Reserved (Static) DHCP Reservation

So, the documentation on this isn’t exactly a page-turner, and I figured I’d save you some headaches by showing how to configure IOS-XE Catalyst 9K devices for DHCP reservations based on MAC addresses.

First pro tip: Enable using the hardware address instead of the client identifier. Why? Well, figuring out the exact client identifier is like trying to find a specific grain of sand at the beach. It’s unnecessarily tricky. The MAC address, on the other hand, is like your favorite snack—standardized and always the same length. This becomes especially important with Cisco interfaces that like to use really long client identifiers, just to keep things fun.
To enable this sanity-saving mode, use the following command:
ip dhcp use hardware-address client-id
Next up, we’ll exclude certain addresses from the pool. You don’t want your default gateway or any other statically assigned IP addresses (like those for VRRP or HSRP) getting snatched up by the DHCP pool. That’d be like saving the best seat in the house, only to have someone else sit in it.
Exclude them with this command:
ip dhcp excluded-address 192.168.0.1 192.168.0.9
ip dhcp excluded-address 192.168.0.1 192.168.0.9
Now let’s create the pool. You can name it whatever you want. For automation purposes, though, I recommend either all CAPS or all lowercase—go bold or go home, right? For this example, we’ll go with LABPOOL.
ip dhcp pool LABPOOL
Here are some of the commonly used commands under the DHCP configuration. Not all of them are required, so check out the Cisco guide for more details:
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
dns-server 192.168.0.2 192.168.0.3
domain-name abc
Finally, our DHCP MAC snack, adding a line item for each DHCP reservation. I recommend using the following format:
address x.x.x.x hardware-address yyyy.yyyy.yyyy
Where x.x.x.x
is the IPv4 address you want to assign to the device, and yyyy.yyyy.yyyy
is the MAC address. The format of the MAC address is important, so make sure it’s in this exact format.
NOTE: Vendors like to mix things up, so if you see a MAC address in another format, convert it to the required syntax before you proceed.
Here’s a final summary and thank you to wrap it all up nicely:
ip dhcp use hardware-address client-id
ip dhcp excluded-address 192.168.0.1 192.168.0.9
ip dhcp pool LABPOOL
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
dns-server 192.168.0.2 192.168.0.3
domain-name ABC
address 192.168.0.12 hardware-address 0027.90aa.bbb4
address 192.168.0.13 hardware-address 0027.90aa.bbb6
You can verify these have been assigned with the following command:
show ip dhcp binding
In Summary: We’ve gone through how to configure DHCP reservations on IOS-XE Catalyst 9K devices, starting with using MAC addresses for simplicity, reserving IPs, creating a DHCP pool, and finally assigning IPs to specific devices based on their MAC addresses. By following these steps, your network will run smoother, and you’ll have fewer headaches when dealing with IP assignments.
Thanks for sticking with me to the end of this blog! I hope this guide helped make your DHCP configuration a little less daunting. If it did, feel free to share the love—or at least share the post. See you in the next one!