cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2783
Views
5
Helpful
5
Replies

DHCP Server Backup using Cisco IOS

mkchandak
Level 1
Level 1

Hi,

I have a requirement where there is a need to use Local DHCP Server when there is a WAN failure (Small site connected by a Single WAN link)

Setup: Client ---- Switch ---- Router ---- WAN ----- Centralized DHCP Server. There is only 1 L3 device on remote site with a single WAN link.

During Normal Operations: When client sends a DHCP Request, the same should be sent to Central DHCP Server.

During WAN Failure: When client sends DHCP Request, the router should issue an IP Address using local DHCP pool.

When I have an DHCP Pool configured on the router along with IP helper address configured on int fa, the router does not send a DHCP Discover until the router exhausts the local pool. Therefore, unable to force the router to become a backup server. I've been able to introduce a delay in the amount of time the router takes to extend the offer by using ip dhcp ping packets number and ip dhcp ping timeout milliseconds commands. But even after doing this, the issue is with the router does not send IP Helper Address without exhausting local pool options.

Is there a way to force the router to send a DHCP Discover to IP Helper Address when local DHCP pools are configured

OR

Is there a way to force the Local DHCP server (IOS DHCP Server) to work as a backup to Central DHCP Server ?

Thanks for your help in advance.

1 Accepted Solution

Accepted Solutions

Hello Richard

That does look feasable with EEM, however I am wondering how would yu be able to track for dupplicate addressing? - I guess we could have a different dhcp scope?

Maybe something like this?

ip sla 10

icmp-echo x.x.x.x source-IP  x.x.x.x

timeout 200

frequency 5

ip sla schedule 10 life forever start-time now

track 1 rtr 10 reachability

event manager applet DHCP-DOWN

event track 1 state down

action 5.0 cli command "enable"

action 5.1 cli command "conf t"

action 5.2 cli command "service dhcp"

action 5.3 cli command "ip dhcp excluded-address 10.10.10.1"

action 5.4 cli command "ip dhcp pool backup"

action 5.5 cli command "network 10.10.10.1 /24"

action 5.6 cli command "default-router 10.10.10.1"

action 5.7 cli command "lease 0 12"

action 5.8 cli command "exit"

action 5.9 cli command "end"

event manager applet DHCP-UP

event track 1 state up

action 6.0 cli command "enable"

action 6.1 cli command "conf t"

action 6.2 cli command "no ip dhcp pool backup"

action 6.3 cli command "no ip dhcp excluded-address 10.10.10.1"

action 6.4 cli command "end"

res

Paul

Please don't forget to rate any posts that have been helpful.

Thanks.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

5 Replies 5

Richard Burts
Hall of Fame
Hall of Fame

In general when there is a DHCP pool configured the router will use it and not be just backup to the corporate server. I have not used this but I wonder if you could write something using EEM that would check for loss of connectivity over WAN and would then configure the DHCP pool. And when the WAN is working again then have EEM delete the DHCP pool.

HTH

Rick

HTH

Rick

Hello Richard

That does look feasable with EEM, however I am wondering how would yu be able to track for dupplicate addressing? - I guess we could have a different dhcp scope?

Maybe something like this?

ip sla 10

icmp-echo x.x.x.x source-IP  x.x.x.x

timeout 200

frequency 5

ip sla schedule 10 life forever start-time now

track 1 rtr 10 reachability

event manager applet DHCP-DOWN

event track 1 state down

action 5.0 cli command "enable"

action 5.1 cli command "conf t"

action 5.2 cli command "service dhcp"

action 5.3 cli command "ip dhcp excluded-address 10.10.10.1"

action 5.4 cli command "ip dhcp pool backup"

action 5.5 cli command "network 10.10.10.1 /24"

action 5.6 cli command "default-router 10.10.10.1"

action 5.7 cli command "lease 0 12"

action 5.8 cli command "exit"

action 5.9 cli command "end"

event manager applet DHCP-UP

event track 1 state up

action 6.0 cli command "enable"

action 6.1 cli command "conf t"

action 6.2 cli command "no ip dhcp pool backup"

action 6.3 cli command "no ip dhcp excluded-address 10.10.10.1"

action 6.4 cli command "end"

res

Paul

Please don't forget to rate any posts that have been helpful.

Thanks.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello Again,

Well have have just  tested the EEM config and it works- 

Not to sure in about having this in a live production environment though!

res

Paul

Please don't forget to rate any posts that have been helpful.

Thanks.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Thanks for the details Paul. Will try and let you know.

Paul

Thanks for testing and confirming that this does work.

In looking at the logic in your post and thinking about it I believe that the weakness in the concept is  when it is working the router will be handing out addresses (so far so good). But when the link comes back up and we start to use the central DHCP server again there will be some addresses assigned that it does not know about. So there is the possibility that it will assign an address that duplicates an address assigned by the router.

Perhaps one workaround might be possible if the address pool used by the central DHCP is smaller than a /24. In that case it might be possible to configure a (somewhat smaller) pool on the router that uses address space different from what the server uses.

HTH

Rick

HTH

Rick
Review Cisco Networking products for a $25 gift card