How to create reservations in Cisco DHCP Server
Ok, so I'm trying to remove DCHP entirely from my windows server and have my Cisco switches run it. Two of my VLANS have reservations on them for printers. I thought I had this fixed last night, but the reservations do not seem to be working anymore. Most of the research that I did told me to use the host command within the pool but that command does not work for me.
core.3750(dhcp-config)#host 192.168.135.53 255.255.255.0
% This command may not be used with network, origin, vrf or relay pools.
So, this is what I set up instead.
ip dhcp pool pool135 network 192.168.135.0 255.255.255.0 default-router 192.168.135.1 domain-name sctc.local dns-server 192.168.235.249 192.168.235.4 address 192.168.135.56 hardware-address 0000.74b8.6481 address 192.168.135.65 hardware-address 0000.74b8.6522 address 192.168.135.53 hardware-address 0000.74b8.6523
It does not look that complicated, but the three devices listed took .2, .3, and .4 when they were restarted. Can anyone tell me how I should set these reservations up?
Reduce Complexity & Optimise IT Capabilities.
You need to add something like this..
no ip cef no ip dhcp use vrf connected
ip dhcp excluded-address 18.104.22.168 22.214.171.124 ip dhcp excluded-address 126.96.36.199 188.8.131.52 ip dhcp excluded-address 184.108.40.206 ip dhcp excluded-address 220.127.116.11 18.104.22.168
ip dhcp pool DATA network 22.214.171.124 255.255.255.192 dns-server 126.96.36.199 188.8.131.52 default-router 184.108.40.206 domain-name mydomain.com netbios-name-server 220.127.116.11 18.104.22.168
Similar commands were included in another area of my configuration except for the cef command. That is actually set to something other than no. I will try to find out what it is for.
ip subnet-zero ip routing ip cef load-sharing algorithm universal 5C956F4C no ip dhcp use vrf connected ip dhcp excluded-address 192.168.239.1 ip dhcp excluded-address 192.168.239.254 ip dhcp excluded-address 192.168.240.1 ip dhcp excluded-address 192.168.240.254 ip dhcp excluded-address 192.168.238.1 ip dhcp excluded-address 192.168.238.254 ip dhcp excluded-address 192.168.135.1 ip dhcp excluded-address 192.168.135.254 ip dhcp excluded-address 192.168.235.200 192.168.235.254 ip dhcp excluded-address 192.168.235.1 192.168.235.49
Eidt cef is Cisco Express Forwarding, and since this switch is actually acting as a router between my VLANs I would prefer not to turn it off.
Just for some extra info for anyone looking at it. I use a virtual interface on this switch for the DHCP server to use.
interface Vlan135 ip address 192.168.135.1 255.255.255.0
It is strange how reservations are done in global config mode not dhcp config mode.
Yes, it is a bit odd. The real kicker is that when I'm doing more than one trying do use it for more than one dhcp range on different VLANs it won't let me use the host command in global conifg. I'm still scratching my head on this one.
Create a separate DHCP pool for your static bindings. The error message is saying that you can't mix static bindings and a 'network' command within one pool so keep your existing pools per VLAN:
ip dhcp pool pool135 network 192.168.135.0 255.255.255.0 default-router 192.168.135.1 domain-name sctc.local dns-server 192.168.235.249 192.168.235.4
and then create a new one:
ip dhcp pool staticaddresses
host 192.168.135.56 /24
client-address 01 00.0074.b864.81
host 192.168.135.65 /24
host 192.168.135.53 /24
Note that the client-address is the MAC address prepended with 01 which denotes ethernet. The hardware-address command is used for bootp rather than dhcp. The complete dhcp reference guide is here Opens a new window
You won't need the excluded-address commands but you can keep them in for safety if you prefer. If you want to double check the client identifier the printers are using (Ricoh's by the look of things) then use the following:
debug ip dhcp server packet
Then reboot a printer and it'll display similar to this:
036325: Aug 10 15:48:18.814 CET: DHCPD: DHCPREQUEST received from client 0100.2304.348c.37.
Don't forget to:
David538 is spot on, thanks, it led me to the solution I needed for doing the same with a Cisco router (an 800 series in particular)
ip dhcp pool DHCP-POOL network 192.168.1.0 255.255.255.0 default-router 192.168.1.1 domain-name Pooponastick.yuck dns-server 192.168.1.1 lease 0 2 ! ip dhcp pool STATIC-ADDRESSES host 192.168.1.11 255.255.255.0 client-identifier 0178.2bcb.a700.71 ! Worked like a champ.
Actually, it is "Worked like a CHARM," not "champ."
Things that bug me:
Peoples' incorrect usage of standard well-known sayings & terms:
No such word as "NUKE-YOU-LER"
It is NUKE-LEE-ER - nuclear - say "Nu" then say "clear" - now, put them together.
Worked like a CHARM, not 'champ.' Fought like a champ. Won like champ, but correct line is: worked like a charm.
UK = "worked a treat."
BOAT-load of stuff, not "BUTT-LOAD." (if you have a BUTT-load of something; you're in trouble)
But YES, this, in the Global Config of my Cisco router, worked like a ** CHARM! ** Many thanks!
ip dhcp pool staticaddresses host 10.19.22.210 255.255.255.0 client-identifier 01xx.1c23.8a28.4c
Thanks for this!
Your rant is a childish and unproductive addition to a 2.5 year old post. Thank you, Champ.
Hi Guy's, I've been following this tread and have successfully configured one of my ap's with a static address but I am only able to add one ap. My script is below but the ap that gets added is the last one on the list, does anyone know why?
The router IOS is 12.4(15)T4
Ip dhcp pool lwap_static_addresses host aa.bb.cc.130 /24 client-identifier 0100.19e7.5ce1.ce host aa.bb.cc.131 /24 client-identifier 0100.19e7.5ce1.fe host aa.bb.cc.132 /24 client-identifier 0100.2304.2566.62 host aa.bb.cc.133 /24 client-identifier 0100.1aa1.e00c.26 host aa.bb.cc.134 /24 default-router aa.bb.cc.129 option 43 ascii “aa.bb.cc.202”
Thanks in anticipation.
From my experience, you have to create a separate pool for each static reservation. For that reason, your script is only hold the last entered address. You should rewrite your code like this:
ip dhcp pool lwap_static_address1
host aa.bb.cc.130 /24
option 43 ascii 201Caa.bb.cc.202201D
ip dhcp pool lwap_static_address2
host aa.bb.cc.131 /24
ip dhcp pool lwap_static_address3
host aa.bb.cc.132 /24
Hope that helps!
Even I'm wondering why it is taking the last command only.
One separate dhcp pool for each static binding is really insane.
There should have been some other simple solution.
- local_offer Tagged Items
It is a simple solution. One DHCP pool per required reserved address makes sense. It is long winded though, but that's not the same as complicated.
socia is an IT service provider.
Have a cuestion do i have to put my ip on my PC stactic to? thanks ill be waiting for a answer.
i used the same dhcp pool:
ip dhcp pool pool_name
network xxx.xxx.xxx.xxx 255.255.255.0
address xxx.xxx.xxx.xxx client-id yyxx.xxxx.xxxx.xx
where client-id you can see with "sh ip dhcp binding"
This topic has been locked by an administrator and is no longer open for commenting.
To continue this discussion, please ask a new question .
Read these next...
Some Websites doesnt load after domain migration
Hi all,I'm getting crazy cause of that issue.We have migrated from old to new domain and rejoined the devices successfully. Since then some websites are not responsive anymore - even I can reach them from the DNS Server itself, the endpoint is not able to...
Snap! -- Driving a Moon Rover, Lunar Data Centers, Robot Realtors, Brain Zappers
Your daily dose of tech news, in brief. Welcome to the Snap! Flashback: March 6, 2012: Google introduces Google Play (Read more HERE.) Bonus Flashback: March 6, 2009: NASA Launches Kepler, the first planet seeking space telescope (Read mo...
Interactive AI survey: Share and compare your opinions to earn 75 points!
Artificial technology has been making headlines in recent months, sparking discussion around the future impact of the technology. Recently, hundreds of your peers in Spiceworks shared their thoughts on how they believe artificial intelligence will affe...
Learning Enterprise Architecture - in Infrastructure.
Hi there,I have been in IT for 10+ years, worked as IT Support, System Admin, IT Admin etc. Looking forward to become Enterprise Architect, so was looking around for certification perspective to learn properly and get certified if possible. I found TOGAF,...
Spark! Pro series - 6th March 2023
Good day fellow inhabitants of the Spiceworld! It is my privilege to provide you with the first Spark! of the week to hopefully inform and entertain, raising a smile on your Monday. Don’t forget to spice it up if yo...
DHCP Static Binding on Cisco IOS
Cisco IOS devices can be configured as DHCP servers and it’s also possible to configure a static binding for certain hosts. This might sound easy but there’s a catch to it…in this lesson I’ll show you how to configure this for a Cisco router and Windows 7 and Linux host. This is the topology I’ll be using:
The router called “DHCP” will be the DHCP server, R1 and the two computers will be DHCP clients. Everything is connected to a switch and we’ll use the 192.168.1.0 /24 subnet. The idea is to create a DHCP pool and use static bindings for the two computers and R1:
- R1: 192.168.1.100
- Windows 7: 192.168.1.110
- Linux: 192.168.1.120
First we will create a new DHCP pool for the 192.168.1.0 /24 subnet:
Whenever a DHCP client sends a DHCP discover it will send its client identifier or MAC address. We can see this if we enable a debug on the DHCP server:
Cisco Router DHCP Client
Now we’ll configure R1 to request an IP address:
In a few seconds you will see the following message on the DHCP server:
When a Cisco router sends a DHCP Discover message it will include a client identifier to uniquely identify the device. We can use this value to configure a static binding, here’s what it looks like:
We create a new pool called “R1-STATIC” with the IP address we want to use for R1 and its client identifier. We’ll renew the IP address on R1 to see what happens:
Use the renew dhcp command or do a ‘shut’ and ‘no shut’ on the interface of R1 and you’ll see this on the DHCP server:
As you can see above the DHCP server uses the client identifier for the static binding and assigns IP address 192.168.1.100 to R1. If you don’t like these long numbers you can also configure R1 to use the MAC address as the client identifier instead:
This tells the router to use the MAC address of its FastEthernet 0/0 interface as the client identifier, you’ll see this change on the DHCP server:
Of course now we have to change the binding on the DHCP server to match the MAC address:
Do another release on R1:
And you’ll see that R1 gets its correct IP address from the DHCP server and is being identified with its MAC address:
So that’s how the Cisco router requests an IP address. Let’s look at the Windows 7 host now to see if there’s a difference.
Windows 7 DHCP Client
This is what you’ll find on the DHCP server:
Windows 7 uses its MAC address as the client identifier. We can verify this by looking at ipconfig:
That’s easy enough, we’ll create another static binding on the DHCP server so that our Windows 7 computers receives IP address 192.168.1.110:
Let’s verify our work:
This is what the debug on the DHCP server will tell us:
There you go, Windows 7 has received the correct IP address. Last but not least is our Linux computer which acts a little different.
Linux DHCP Client
Linux (Ubuntu) in my example acts a little different when it comes to DHCP client, let me show you:
The DHCP server shows this:
We see the MAC address of the linux server so we’ll create a static binding that matches this:
We’ll release the IP address on our Linux host:
Now take a good look at the debug:
That’s not good, even though we configured the client identifier it’s not working. Let’s double check the MAC address:
We're Sorry, Full Content Access is for Members Only...
If you like to keep on reading, Become a Member Now! Here is why:
- Learn any CCNA, CCNP and CCIE R&S Topic . Explained As Simple As Possible.
- Try for Just $1 . The Best Dollar You’ve Ever Spent on Your Cisco Career!
- Full Access to our 758 Lessons . More Lessons Added Every Week!
- Content created by Rene Molenaar (CCIE #41726)
645 Sign Ups in the last 30 days
Tags: DHCP , Network Services
Thanks for the info Rene As always complete posts!
how to reserve a single ip for pc in router ? ?
That is exactly what this lesson is about…
I have some challenges with CCNA R&S lab about DHCP/DHCP relay.The lab number is 10.1.3.3 assuming that you have access to the new CCNA R&S oficial course… The lab has two clients, two intermediary routers and another router connected to the intermediary routers via serials. Intermediary router are R1 and R3, the central router is R2. To R2 are connected via Ethernet GIgabit interfaces a DNS Seriver and the ISP The lab tell me to do the R2 a dhcp server for the two PC’s connected to the intermediary routers R1 and R2 so they receive an IP… The challenge
Your message wasn’t deleted but not approeved before, I do this manually because of spam. I think this example should help you:
If not, let me know.
15 more replies! Ask a question or join the discussion by visiting our Community Forum
Welcome to the Portal of Technology
Cisco DHCP configuration
July 31, 2011 Networking Jesin A Leave a Comment
A tutorial describing how to configure a Cisco router as a DHCP server, I’ll cover DHCP reservation and excluding of IP addresses as well. A DHCP server dynamically assigns IP addresses to hosts in a network, by creating DHCP reservations we can statically assign an IP address to a host based on its MAC address. IP address exclusion prevents conflicts among devices i certain hosts are manually assigned IP addresses. When configuring DHCP reservation it should be done differently for Windows DHCP clients and Linux DHCP clients because both of them make DHCP requests differently.
Configure a DHCP Pool on Cisco
On a Cisco router use the following commands to create a pool of IP addresses with a default gateway, DNS server and lease time.
The name of the pool is mynetwork1 which can be anything and it contains addresses from 192.168.0.1 to 192.168.0.254, the default gateway will be 192.168.0.1, DNS servers are 22.214.171.124 and 126.96.36.199 you can add more IP addresses by dividing them with spaces. Finally the lease time specifies how long the IP addresses will be valid before the client need to get them renewed. Here it is 4 days, 6 hours and 30 minutes.
DHCP IP address exclusion
Certain IP addresses like the IP address of the default gateway router and the DHCP server itself are assigned manually, since the DHCP pool covers the entire subnet containing the manually assigned IP address conflicts might occur. The following command excludes only one IP address
To exclude a range of IP addresses use the following command
Configure DHCP reservation
DHCP reservations are configured based on MAC addresses, an IP is statically assigned to a host with the specified MAC address. As said earlier DHCP reservations should be configured differently based on the DHCP client’s (the host TO which the IP will be assigned) Operating System.
DHCP reservation for Windows Clients
Follow these commands if you’re configuring a reservation for a windows host.
You need to create a separate pool for each DHCP reservation. The client-identifier is the MAC address of the host added with 01 at the beginning, so in this example the MAC address of the host is 080027d4e072 adding 01 at the beginning gives 01080027d4e072, divide four characters by a dot 0108.0027.d4e0.72
DHCP reservation for Linux Clients
The process is easy for statically assigning IP addresses to Linux hosts. Follow the commands below
the hardware-address is the MAC address of the Linux host, just enter it as it is. Create a pool for each DHCP reservation.
Useful Cisco DHCP commands
For displaying the IP addresses assigned to hosts use
Display IP conflicts in the network
Display DHCP events as they occur
Turn off debugging
Set an interval for cleaning up expired DHCP bindings
Manually clear a binding
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Cisco IOS Cookbook, 2nd Edition by Kevin Dooley, Ian Brown
Get full access to Cisco IOS Cookbook, 2nd Edition and 60K+ other titles, with a free 10-day trial of O'Reilly.
There are also live events, courses curated by job role, and more.
Allocating Static IP Addresses with DHCP
You want to ensure that your router assigns the same IP address to a particular device every time it connects.
The following commands ensure that the router assigns the same IP address to a device each time it requests one:
The router allows you to statically bind an IP address to a MAC address to ensure that a particular device always receives the same IP address. This is particularly useful for devices such as servers that must be available for access via a well-known IP address or DNS entry. Any device that accepts inbound sessions will probably require a static address. Being able to allocate these addresses via DHCP provides network administrator with greater control.
The configuration for a static DHCP mapping is slightly different than a dynamic pool. In particular, you must assign a separate dhcp pool for each static server. In our example, we created a pool named IAN to allocate a static IP address to user Ian. Also, instead of defining a network range of IP ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.
Don’t leave empty-handed
Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.
It’s yours, free.
Check it out now on O’Reilly
Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.
Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Reserve an IP for client on Cisco DHCP server
So I thought I knew how to set up my DHCP Server on my 3550 switch and reserve IP's for clients.
I go into the pool I need to reserve the IP in, but I do not have the address command as an option to do it like I have in the past on IOS.
Here is the DHCP pool config
When i go into dhcp pool configuration I do have the following available:
I just need to reserve an IP address for a specific MAC Address. I usually do Address xxx.xxx.xxx.xx Hardware-Address AABB.CC00.11FF
- Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide your own answer and accept it. – Ron Maupin ♦ Aug 7, 2017 at 0:01
2 Answers 2
There is a solution to avoid the multiple manual bindings.
Here is a link to Cisco documentation concerning DHCP origin and database files:
Essentially, you need a tftp/ftp server that records leases from the DHCP server in a database file (text file) on the Cisco device and reads the origin file (also a text file) in which you create all the manual bindings you need.
I use this as a disaster recovery tool in case of an unplanned reboot of the Cisco DHCP server:
- The binding database saves the network from a DHCP storm and consequent Denial of Service against the DHCP server (self-imposed in the case of not having the binding database).
- The origin file allows my static bindings to exist and can be edited programmatically as it is only a text file.
The above link contains examples and further reading links. For older IOS versions (back to at least 12.4) you can refer to similar online resources.
- I guess this would be my solution, fortunately I have upgraded that switch now and have the commands available to get this done. – veel84 Aug 7, 2017 at 15:14
You have to create another pool with client-identifier and your Client ID, which usually defaults to MAC prepended with 01 (Ethernet client), or hardware-address and your MAC like this:
If you prefer to configure it manually, please have a look at:
- Do I have to do a pool for each static IP i want to reserve on the server? – veel84 May 25, 2017 at 14:27
- @veel84 unfortunately, there are no other options available, unless you try an external DHCP server :( – Andriy Berestovskyy May 25, 2017 at 14:44
Sign up or log in, post as a guest.
Required, but never shown
Not the answer you're looking for? Browse other questions tagged cisco dhcp cisco-catalyst cisco-ios-12 or ask your own question .
- The Overflow Blog
- Five Stack Exchange sites turned ten years old this quarter!
- “Move fast and break things” doesn’t apply to other people’s savings (Ep. 544)
- Featured on Meta
- We've added a "Necessary cookies only" option to the cookie consent popup
Hot Network Questions
- Gunslinger Fake Out with Covered Reload
- Why did Chandrasekhar use 2.5 for molecular weight in 1931?
- Does Quantum Computers crack RSA and AES?
- Would Fey Ancestry affect Cutting Words?
- May I start a sentence with a verb "develop" or do I need to use "to"?
- Move duplicated folder name up one level
- Does the attacker need to be on the same network to carry out a deauthentication attack?
- Do Catholic anathemas apply to people who lived before it was codified?
- Why are aluminum frames painted at all?
- Forced to pay a customs fee for importing a used wedding dress into the Netherlands. Is there a way to avoid paying?
- Where can I get custom size closet doors, or how do I make one?
- Cat scared of me after bag incident
- Are there any medieval manuals relating to castle building?
- Should I put my dog down to help the homeless?
- Separating layers based on labels
- Google maps for Space exploration
- "Videre" is to "spectare" what "audire" is to...?
- Imtiaz Germain Primes
- Heating resistor - low current, high temperature
- What are the Stargate dial home device symbols used to dial Earth from Atlantis?
- Are you saving 'against' an effect if that effect applies when you successfully save?
- Are condensed sets (locally) cartesian closed?
- One-day-ahead prediction of S&P500 with Temporal Convolutional Networks
- Is Grogu the same species as Yoda?
How to configure DHCP reservation on Cisco 3750
Here is steps to configure DHCP reservation with MAC address on Cisco Catalyst 3750
IP Pool : 10.10.10.0/24 MAC#1 : 1111.2222.3333 MAC#2 : 4444.5555.6666
* You cannot use network range on MAC Address based reservation DHCP configuration
ip dhcp pool node1 host 10.10.10.50 255.255.255.0 client-identifier 0111.1122.2233.33 client-name node1 default-router 10.10.10.1
ip dhcp pool node2 host 10.10.10.51 255.255.255.0 client-identifier 0144.4455.5566.66 client-name node2 default-router 10.10.10.1
ip dhcp pool node1 host 10.10.10.50 255.255.255.0 hardware-address 0111.1122.2233.33 client-name node1 default-router 10.10.10.1
ip dhcp pool node2 host 10.10.10.51 255.255.255.0 hardware-address 0144.4455.5566.66 client-name node2 default-router 10.10.10.1
Leave a Reply Cancel reply
You must be logged in to post a comment.
- vSEC:CMS and Yubikey
- [Splunk] – Basic search fields and commands
- How to enable Syslog on the VMware/vCenter 6.5
- Syslog setting for Cisco IOS
- How to configure static IP address on Ubuntu Server
You would have to create a dedicated pool, with a single IP address, for each reservation you want to do; for example, if you have a /24 and you want to
each reservation is one separate pool. take care about hardware-address command because it will only work if the client-identifier is the MAC address otherwise
can you run debug dhcp detail and debug dhcp server events on the router and verify that the client identifier you have configured is actually
So, this is what I set up instead. ip dhcp pool pool135 network 192.168.135.0 255.255.255.0 default-router 192.168.135.1 domain-name sctc.local
cisco router dhcp server , cisco router dhcp reservation , cisco router dhcp lease time , how to configure dhcp on cisco router , cisco
The router called “DHCP” will be the DHCP server, R1 and the two computers will be DHCP clients. Everything is connected to a switch and we'll use the 192.168.
Configure DHCP reservation ... DHCP reservations are configured based on MAC addresses, an IP is statically assigned to a host with the specified
Selection from Cisco IOS Cookbook, 2nd Edition [Book] ... You want to ensure that your router assigns the same IP address to a particular device every time
Essentially, you need a tftp/ftp server that records leases from the DHCP server in a database file (text file) on the Cisco device and reads
Here is steps to configure DHCP reservation with MAC address on Cisco Catalyst 3750 ... default-router 10.10.10.1. ip dhcp pool node2