03-20-2014 02:56 PM - edited 03-07-2019 06:47 PM
Hello,
Is there a way to configure a failover scenario for source based static NATs? I know it's possible with destination based static NAT's through the use of route-maps, but not sure if I'd use the same method for source based.
Basically this is what I want to achieve:
10.10.10.10 = internal server 1 (primary)
10.10.10.11 = internal server 2 (backup)
I have a static nat entry for server 1:
ip nat inside source static 10.10.10.10 222.222.222.222
Currently, when we want to failover to the backup server, I have to manually change this static NAT entry (ip nat inside source static 10.10.10.11 222.222.222.222)
I want to find a way to have the NAT failover automatically when we failover to the backup server (i.e. if 10.10.10.10 stops translating to 222.222.222.222, make 10.10.10.11 translate to 222.222.222.222)
I hope that makes sense, I'm not a network genius. I really appreciate any help/advice I can get. Thanks!
Z
Solved! Go to Solution.
03-22-2014 03:46 AM
Hello
conf t
ip sla 1
icmp-echo 10.10.10.10 source-ip x.x.x.x
exit
ip sla scheduled 1 start-time now life forever
track 1 ip sla 1 reachability
event manager applet NatPrimary-UP
event track 1 state up
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "no ip nat inside source static 10.10.10.11 222.222.222.222"
action 1.3 cli command "ip nat inside source static 10.10.10.10 222.222.222.222"
exit
event manager applet NatPrimary-Down
event track 1 state down
action 2.0 cli command "enable"
action 2.1 cli command "conf t"
action 2.2 cli command "no ip nat inside source static 10.10.10.10 222.222.222.222"
action 2.3 cli command "ip nat inside source static 10.10.10.11 222.222.222.222"
exit
res
Paul
03-21-2014 10:44 AM
You can probably accomplish this doing EEM scripting, but from a purely solution based view, I think assigning a VIP to 2 servers and configuring them for fail over may give you better results. In this scenario you have 2 servers sharing 1 virtual IP, depending on the server OS (windows clustering for example) when one fails the other takes up the load.
For 2008 server this is the info : http://blogs.technet.com/b/askcore/archive/2010/02/12/windows-server-2008-failover-clusters-networking-part-1.aspx
03-24-2014 02:00 PM
Thanks wmoronta, I hadn't even thought of EEM scripting. That's probably the only solution that will work for me as we don't have a very sophisticated server load balancing solution in place yet.
Thank you for taking the time to read my question and respond. Very much appreciated.
Best,
Z
03-22-2014 03:46 AM
Hello
conf t
ip sla 1
icmp-echo 10.10.10.10 source-ip x.x.x.x
exit
ip sla scheduled 1 start-time now life forever
track 1 ip sla 1 reachability
event manager applet NatPrimary-UP
event track 1 state up
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "no ip nat inside source static 10.10.10.11 222.222.222.222"
action 1.3 cli command "ip nat inside source static 10.10.10.10 222.222.222.222"
exit
event manager applet NatPrimary-Down
event track 1 state down
action 2.0 cli command "enable"
action 2.1 cli command "conf t"
action 2.2 cli command "no ip nat inside source static 10.10.10.10 222.222.222.222"
action 2.3 cli command "ip nat inside source static 10.10.10.11 222.222.222.222"
exit
res
Paul
03-24-2014 02:02 PM
Thanks so much for writing that config out for me Paul. I think EEM is the way to go for us on this one. I really appreciate you taking the time to read my question and write out a detailed reply.
Best,
Z
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