05-20-2022 06:28 AM
i configure two routers R1-172.16.0.1 / R2-172.16.0.2 with virtual IP 172.16.0.3 for HSRP.
Now i would like to create a dhcp pool for dynamics IPs.
what should i do:
1/ip dhcp pool net1
network 172.16.0.3 255.255..0.0
(i select each router and give the virtual IP)
2/select each ip on each router and create the same dhcp pool
plz elp
Solved! Go to Solution.
05-20-2022 06:45 AM
You need to exclude the IP you used for HSRP and statically assign, then yoou need to create Pool using gateway as VIP 172.16.0.3
are you using same device as DHCP Server ?
Note : i would not suggest to use same device as DHCP server, i would suggest to do external DHCP sever
05-20-2022 08:37 AM
Hello,
I agree in this instance with @balaji.bandi.
Firstly: If you configure the DHCP pool on both routers (excluding the used addresses already) then they can cause conflicts as they could possibly hand out the same address. Only the active router would hand out addresses I believe as traffic flows through it. But once that fails and clients use the new active router then the DHCP pool is unaware of the addresses handed out by the previous active device. The DHCP pool usually pings to check for that but it could be cumbersome as you add clients.
Secondly. If you just configure the DHCP pool on one and that device goes down then you wont get new IPs and eventually the ones handed out expire. You could put half of the 172.16.0.0/16 pool on one and the other half of the pool on the other and exclude the addresses the opposite device is handing out, but again that causes issues as your clients increase because they would have to get a new address from the new "second" half of the pool" from the now active router.
BTW I have not tried these configs, its just theory on how it would functionally work.
A standalone external DHCP server that both HSRP devices point to to hand out IPs
Hope that helps
-David
05-20-2022 10:59 AM
Hello
Create the same dhcp pool on each rtr and then for the first half of the scope you assign to rtr 1 and for second half you assign to rtr 2 then exclude each part from either rtr -lastly I would suggest not to rely on ip conflict logging for successful ip allocation.
05-20-2022 06:45 AM
You need to exclude the IP you used for HSRP and statically assign, then yoou need to create Pool using gateway as VIP 172.16.0.3
are you using same device as DHCP Server ?
Note : i would not suggest to use same device as DHCP server, i would suggest to do external DHCP sever
05-20-2022 08:37 AM
Hello,
I agree in this instance with @balaji.bandi.
Firstly: If you configure the DHCP pool on both routers (excluding the used addresses already) then they can cause conflicts as they could possibly hand out the same address. Only the active router would hand out addresses I believe as traffic flows through it. But once that fails and clients use the new active router then the DHCP pool is unaware of the addresses handed out by the previous active device. The DHCP pool usually pings to check for that but it could be cumbersome as you add clients.
Secondly. If you just configure the DHCP pool on one and that device goes down then you wont get new IPs and eventually the ones handed out expire. You could put half of the 172.16.0.0/16 pool on one and the other half of the pool on the other and exclude the addresses the opposite device is handing out, but again that causes issues as your clients increase because they would have to get a new address from the new "second" half of the pool" from the now active router.
BTW I have not tried these configs, its just theory on how it would functionally work.
A standalone external DHCP server that both HSRP devices point to to hand out IPs
Hope that helps
-David
05-20-2022 10:59 AM
Hello
Create the same dhcp pool on each rtr and then for the first half of the scope you assign to rtr 1 and for second half you assign to rtr 2 then exclude each part from either rtr -lastly I would suggest not to rely on ip conflict logging for successful ip allocation.
05-20-2022 11:30 AM
Paul,
Would that not be inefficient. If the active router goes down the OP will lose half of their IP space since the standby which became active will only allocate the other half not being given out by the previous active router.
Secondly (Im asking because I have not configured this and genuinely curious) since traffic only flows through the Active router in HSRP, then only the Active router scope will handout IPs leaving the Standby router DHCP pool untouched.
Am I misunderstanding? I've never configured DHCP pools split like that. It seems a central DHCP server both Active/Standby devices can reach regardless if either goes down while still having access to the whole scope.
-David
05-20-2022 12:00 PM - edited 05-20-2022 12:01 PM
Hello David
Servicing dhcp for redundancy can be split between two dhcp servers as i have described at least it’s one way to do it and i have found in the past it’s a good way also-
You are correct if either server fails then between you noticing and activating the reserved scope your client will be without ip allocation however clients that are already assign ip from the failed scope will be able to continue to work until either they release /need to renew or require new allocation.
relying on io dhcp conflict logging i would say be not applicable as any conflict seen will be logged then will NOT be used either if that ip is eventually available unless the conflict logging is cleared.
05-20-2022 12:09 PM
Good to know its been implemented before.
On the second question I had, wont only the active router give out IPs since thats where traffic flows in HSRP? The standby wont give out IPs until it becomes active. Is that correct? So it cuts the scope where only half can be used?
As you mention to split the scope between the routers (RTR Active with first half of scope to hand out and RTR Standby with second half of scope to hand out)
Just trying to understand better.
05-20-2022 12:37 PM - edited 05-20-2022 12:38 PM
Hello
Okay apologies i now understand- although rtrs can perform and service dhcp it is highly recommended to use dedicated server for dhcp as suggested by @balaji.bandi they are intelligent enough to perform split scope failover
As for dhcp in general the server that responds first should allocate addressing as such if the first server (rtr) scope is exhausted then the secondary should begin serving - cisco has a feature called dhcp smart relay which can accommodate secondary addressing but again on a rtr or switch i would say its possible but not recommend.
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