07-12-2013 05:42 PM - edited 03-07-2019 02:22 PM
I understand how to set up DHCP services on a router, but I have a need to have IP's handed out only if a reservation is in place. I would prefer to not have to take the approach of adjusting the pool size every time a new reservation is made. Perhaps if the Cisco router cannot perform this task there is a way to do so with another DHCP server platform?
Any advice is appreciated.
07-13-2013 04:49 AM
If you exclude all pool range then new devices will not acquire IP address automatically. For reserverd address you can use IP address in the excluded range. for example if pool range is 192.168.1.0/24 then you can exclude all range by:
ip dhcp-excluded address 192.168.1.0 192.168.1.255
07-13-2013 05:53 AM
Actually, if you want to use the Cisco IOS DHCP server, you don't even need to configure a dynamic scope nor exclude a range. Instead, you'll have to create a host pool for every manual binding, which can be unhandy depending on the number of bindings required.
An example:
ip dhcp pool MYCLIENT-10
host 192.168.0.10 255.255.255.0
client-identifier 01cc.0114.fc00.00
default-router 192.168.0.1
dns-server 192.168.0.2 192.168.0.3
domain-name MYDOMAIN
!
ip dhcp pool MYCLIENT-11
(...)
!
On the other hand, an additional pool with the dynamic scope completely excluded can save some repeating lines (the common options) in the host pools:
ip dhcp excluded-address 192.168.0.1 192.168.0.254
!
ip dhcp pool MYCLIENT-10
host 192.168.0.10 255.255.255.0
client-identifier 01cc.0114.fc00.00
!
ip dhcp pool MYCLIENT-11
(....)
!
ip dhcp pool EXCLUDED
network 192.168.0.0 /24
default-router 192.168.0.1
dns-server 192.168.0.2 192.168.0.3
domain-name MYDOMAIN
!
Configuring the Cisco IOS DHCP Server:
http://www.cisco.com/en/US/docs/ios-xml/ios/ipaddr_dhcp/configuration/12-4t/config-dhcp-server.html
Hope that helps
Rolf
07-15-2013 02:39 PM
Hi Rolf,
configuring host pools requires a parent dynamic pool as each host pool is considered a child pool which will inherit by default of the DHCP options of the parent pool unless specifically overidden in the child pool.
There is the origin file option for configuring static mappings too but I'm not sure if this one necessitates a dynamic parent pool though but I guess it does too( I haven't implemented this feature yet).
Regards
Alain
Don't forget to rate helpful posts.
07-15-2013 11:55 PM
Hi Alain,
thanks for your answer.
configuring host pools requires a parent dynamic pool as each host pool is considered a child pool which
That's what I thought too, but at least in gns3 it worked without a parent pool. Of course, this doesn't necessarily mean that it generally works this way.
There is the origin file option for configuring static mappings
This looks great, I didn't know that so far. I think this could be the perfect solution for the original question.
http://www.cisco.com/en/US/docs/ios/12_4t/ip_addr/configuration/guide/htdhcpsv.html#wp1114315
Thanks again,
Rolf
07-16-2013 12:44 AM
Update: I've tried hostpool only with gns3 once again and have to correct myself:
DHCPD: there is no address pool for 192.168.0.1.
Alain, you're correct: It doesn't work that way.
The first time I tried it with another IOS, but I think the real reason why it worked was that I initially had a parent pool which I deleted later when I wanted to try hostpools only.
My bad.
Best regards
Rolf
05-02-2017 11:42 AM
I tumbled across this question troubleshooting DHCP leases on a router running IOS 12.4.
Through trial & error, I found a couple things that helped me..I can't say these are cisco official or that they'll work for you, but it worked for me.
First - use one pool for the general dynamic addresses and then individual pools for reservations. Make sure your reservation pools come in the config BEFORE the dynamic pool.
Second, I also found that Windows devices respond better to the "client-identifier" command and Linux-based devices respond better to the "hardware-address" command.
In my case, I have a pool of 10.10.12.150-10.10.12.199 for general use and two reservations for 10.10.12.10 & 10.10.12.11.
ip dhcp excluded-address 10.10.12.1 10.10.12.149
ip dhcp excluded-address 10.10.12.200 10.10.12.254
!
ip dhcp pool ReservationLinux
host 10.10.12.10 255.255.255.0
hardware-address aaaa.bbbb.cccc
default-router 10.10.12.254
dns-server 208.67.222.222 208.67.220.220
lease 0 12
!
ip dhcp pool ReservationWindows
host 10.10.12.11 255.255.255.0
client-identifier 01aa.aabb.bbcc.cc <-- Note the 01 out front!
default-router 10.10.12.254
dns-server 208.67.222.222 208.67.220.220
lease 0 12
!
ip dhcp pool GeneralPool
network 10.10.12.0 255.255.255.0
default-router 10.10.12.254
dns-server 208.67.222.222 208.67.220.220
lease 0 12
I hope this helps somebody in the future.
.
08-13-2017 03:23 AM
Hi Kevin,
Just to say thanks for the tip on Windows and Linux clients. I have been headscratching over why my Centos webserver took its hardware-address OK but my Windows PC and other stuff like VOIP Box and PoE Switch simply ignored the reservations, using client-identifier works with Windows just fine.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide