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

EEM script to minimize Tunnel Flapping

bforan
Level 1
Level 1

We have two Tunnel interfaces configured on a router Tunnel0 and Tunnel1 running BGP.  If Tunnel0 is consistenly bouncing over a set period of time and we received 5 BGP down messages in 180 seconds then shut, however first check the status of Tunnel1 and if down do nothing, but if up perform the shut on Tunnel 0.

I am guessing that during the scripts actions there is a way to show int Tunnel1 and record/set a variable for the interface status that I can then check against before I shut down the problem interface.

1 Reply 1

Dan Frey
Cisco Employee
Cisco Employee

This should do what you want.

event manager environment bgpneighbor 192.168.200.2

event manager applet tunnelflap
 event syslog occurs 5 pattern "neighbor $bgpneighbor is down" period 180
 action 010 cli command "enable"
 action 020 cli command "show ip int brief | inc Tunnel1"
 action 030 regexp "up                    up" "$_cli_result"
 action 040 if $_regexp_result eq 1
 action 050  cli command "conf t"
 action 060  cli command "int tunnel0"
 action 070  cli command "shutdown"
 action 080 end