cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1280
Views
0
Helpful
1
Replies

Clearing a NAT using EEM

d.poppleton
Level 1
Level 1

I have this configuration:

 

event manager applet clear_nat_1
event track 1 state any maxrun 40
action 1.0 wait 35
action 2.0 cli command "enable"
action 3.0 cli command "clear ip nat trans *"
action 4.0 syslog msg "WAN Failover, cleared NAT"

 

I have the maxrun and wait because we have this:

track 1 ip sla 1 reachability
delay down 30 up 30

 

The problem is that it isn't actually clearing the NAT. What am I missing?

1 Reply 1

Wizard4777
Level 1
Level 1

Use this commands and it should work

***************

track 1 ip sla 1 reachability
delay down 30 up 30

ip sla 1
icmp-echo 8.8.8.8 source-interface <interface?
frequency 6
ip sla schedule 1 life forever start-time now

event manager applet clear_nat_up
event track 1 state up maxrun 40
action 1.0 wait 35
action 2.0 cli command "enable"
action 3.0 cli command "clear ip nat trans for"
action 4.0 syslog msg "WAN Failover, cleared NAT"

event manager applet clear_nat_down
event track 1 state down maxrun 40
action 1.0 wait 35
action 2.0 cli command "enable"
action 3.0 cli command "clear ip nat trans for"
action 4.0 syslog msg "WAN Failover, cleared NAT"

 

**************

Review Cisco Networking for a $25 gift card