cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5232
Views
0
Helpful
7
Replies

Reset an Interface is in down state

nsylaj
Level 1
Level 1

I am trying to figure out a script or SLA configuration which applies the Shut/No Shut command if an interface goes down on a cisco switch, 3750

 

Can anyone guide me on this issue ?

 

Below is what I have for the SLA Config, however,  the interface is an access vlan and I do not have an IP as far as tracking by IP.   Is it possible to track by Status/Protocol state ?

 

track 1 ip sla 10 reachability
delay down 10 up 10
!
ip sla 10
icmp-echo ?????? source-interface Fastethernet 1/0/12
frequency 30
ip sla schedule 10 life forever start-time now
!
event manager applet Link-Down
event track 1 state down
action 1.0 syslog msg "Reply timed out; Link is down"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface Fastethernet 1/0/12"
action 1.4 cli command "shut"
action 1.5 cli command "end"
action 1.6 syslog msg "interface Fastethernet 1/0/12 shutdown"
event manager applet Link-Up
event track 1 state up
action 1.0 syslog msg "Ping received; Link is up"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface Fastethernet 1/0/12"
action 1.4 cli command "no shut"
action 1.5 cli command "end"
action 1.6 syslog msg "interface Fastethernet 1/0/12 up"

 

3 Accepted Solutions

Accepted Solutions

Hi,

 

Below is the configuration that can be used: 

 

track 1 interface GigabitEthernet1/0/14 line-protocol
!

event manager applet TEST authorization bypass
event track 1 state down
 action 1.0 cli command "enable"
 action 2.0 cli command "config terminal"
 action 3.0 cli command "int GigabitEthernet1/0/14 "
 action 4.0 cli command "shutdown"
!

But then how do you bring it back up? There has to be a condition set on the switch that would trigger the EEM to run the script to "no shut" the interface. You can use something in the syslog to trigger that. But I am not sure what exactly you are trying to solve with this script.

View solution in original post

Then you would just need to add this line in the script I provided:

action 5.0 cli command "no shutdown"

 

View solution in original post

You can test both.

View solution in original post

7 Replies 7

cofee
Level 5
Level 5

Hi,

Is it possible to track by Status/Protocol state ? Yes, it is. As long as the feature is supported with the code you are using.

 

Did you try the script and is it not working?

This script needs an IP address to track ping, however, ping is disabled and  I just want to track the state/protocol and reset. 

 

 

icmp-echo ?????? source-interface Fastethernet 1/0/12

Hi,

 

Below is the configuration that can be used: 

 

track 1 interface GigabitEthernet1/0/14 line-protocol
!

event manager applet TEST authorization bypass
event track 1 state down
 action 1.0 cli command "enable"
 action 2.0 cli command "config terminal"
 action 3.0 cli command "int GigabitEthernet1/0/14 "
 action 4.0 cli command "shutdown"
!

But then how do you bring it back up? There has to be a condition set on the switch that would trigger the EEM to run the script to "no shut" the interface. You can use something in the syslog to trigger that. But I am not sure what exactly you are trying to solve with this script.

We have cell phone extenders that periodically go down.   Resetting the interface fixes the issue. 

I just wanted a shut/no shut process if the state is down.

Then you would just need to add this line in the script I provided:

action 5.0 cli command "no shutdown"

 

I think this might work ?

 

track 1 interface  Fastethernet 1/0/12 line-protocol
!
event manager applet Link-Down
event track 1 state down
action 1.0 syslog msg "Interface went down"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface Fastethernet 1/0/12"
action 1.4 cli command "shut"
action 1.5 syslog msg "interface Fastethernet 1/0/12 shutdown"
action 1.6 cli command "no shut"
action 1.7 cli command "end"
action 1.8 syslog msg "interface Fastethernet 1/0/12 up"
!

 

 

You can test both.

Review Cisco Networking for a $25 gift card