06-15-2021 01:00 AM
Hello team,
I want provide little tuning of nat statements .
Situation:
host a.a.a goest to -----> x.x.x ---->DNAT to y.y.y (everything works)
BUt in situation when is DNAT y.y.y unrecheable i want change nat statement to :
host a.a.a goest to -----> x.x.x ---->DNAT to z.z.z
Is this possible with ip sla track ? OR EEM scripting is necesary ?
Solved! Go to Solution.
06-16-2021 02:27 AM
Its funny but i did it exactly the same way few hrs ago
06-15-2021 02:18 AM
yes possible, you need to clear NAT table with EEM Script
use below thread for example :
https://community.cisco.com/t5/routing/static-nat-for-two-internet-connect/td-p/3925675
06-16-2021 02:02 AM - edited 06-16-2021 02:02 AM
Hello
@prestigio391 wrote:
BUt in situation when is DNAT y.y.y unrecheable i want change nat statement to :
host a.a.a goest to -----> x.x.x ---->DNAT to z.z.z
Is this possible with ip sla track ? OR EEM scripting is necesary ?
You can use both ipsla and eem.
Example:
ip sla 1
icmp-echo <to y.y.y > source-interface xxx
ip sla schedule 1 life forever start-time now
track 10 rtr 1 reachability
event manager applet DNAT1_down
event track 10 state down
action 5.0 cli command "enable"
action 5.1 cli command "conf t"
action 5.2 cli command "no ip nat inside source static x.x.x.x y.y.y.y "
action 5.3 cli command "clear ip nat translation inside x.x.x.x y.y.y.y"
action 5.4 cli command "ip nat inside source static x.x.x.x z.z.z.z"
action 5.5 cli command "end"
event manager applet DNAT1_Up
event track 10 state up
action 5.6 cli command "enable"
action 5.7 cli command "conf t"
action 5.8 cli command "no ip nat inside source static x.x.x.x z.z.z.z "
action 5.9 cli command "clear ip nat translation inside x.x.x.x z,z,z,z"
action 6.0 cli command "ip nat inside source static x.x.x.x y.y.y.y"
action 6.1 cli command "end"
06-16-2021 02:27 AM
Its funny but i did it exactly the same way few hrs ago
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