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

EEM Clear NAT translation? Define mail server for EEM alerts?

nick.szilagyi
Level 1
Level 1

I have a ISR WAN interface with cellular fail over (using IP SLA).

I want to create a script that checks periodically if WAN1 (gi0/0/0) is up, it will clear the NAT translations associated with the cellular interface.

Scenario

We have IP SLA in place pinging outbound to 8.8.8.8, when the timer threshold is reached, the route swings over the the cellular interface. However, we are seeing scenarios when gi0/0/0 flicks over to the cellular and back very quickly/briefly. This causes some of the clients on the LAN to stay NAT'd to the cellular outside IP address.

This is more than likely a bug, or some persistent/stateful connections remain. I want to create a script to check:

IF gi0/0/0 is up, clear NAT translations associated with Cellular0/0/0.

Check every 2 minutes.


My Script

event manager applet track-ip-sla-1
event track 1 state down
action 1.0 syslog msg "IPSLA collector 1 timed out"
action 2.0 mail from "nick@.com"" to "nick@.co.uk" subject "WAN1 IP SLA is down"
body "IP SLA from Fulham to Google DNS has timed out"

Any ideas for next steps? Also very stupid question - do I need to tell EEM to point to a mail server for action 2.0 to work?

1 Reply 1

nick.szilagyi
Level 1
Level 1

I'm a little further with this:

event manager applet clear-cellular-NAT
description if gi0/0/0 is up clear NAT Translations for Cell0/0/0
event track 2 state up

 ****condition here to check state 2 periodically***  ?????

action 1.0 syslog msg "EEM detected gi0/0/0 up"

action 1.5 cli command "en"

action 2.0 cli command "conf t"

action 2.5 cli command "int cellular0/0/0”

action 3.0 cli command "shut”
action 4.0 cli command "no shut"

action 4.5 cli command "exit"

action 5.0 cli command  “clear ip nat translation ????