cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1010
Views
0
Helpful
5
Replies

How to tracking L2port

yutan8888
Level 1
Level 1

I want to enable EEM. Trigger event is to down L2accessport in Another Switch.

SwitchA,SwitchB assigment Tunkport(g1/1)and accessport(g1/2)

Trunkport(g1/1) is directly connected each other.


When it detects a down accessport(g1/2) in SwitchA, Enable EEM and shutdown the accessport(g1/2) of SwitchB.

Interface g1/2 is L2 accessport.
It can't use IPSLA because accessport(g1/2) is not routed port.

How to monitoring and tracking to the accessport each other?

IOS 12.2.53-SG1, 12.2(33r)SRD2

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

I think I understand what you're asking, but I have a few questions to ask for clarity.  You want

to remotely instruct switchB to shutdown its Gi1/2 port if port Gi1/2 on switchA goes down, correct?  What version of code

are each of these switches running?  That is, which switch runs 12.2(52)SG1, and which runs SRD2?

I want to how to detect goes down switchport each other.

When switchA G1/2 goes down ,switchB detect the down G1/2 of switchA and shutdown G1/2 by itself.

SwitchA version is SRD2,SwitchB is 12.2(52)SG1.

Your code versions will make this tricky, but I do have one EEM script which can probably be adapted to work here.  It will take me some time to put thins together, though.

I was not going to use Metro Ethernet in this case.  I was not under the impression that this was a MetroE setup.  I thought you wanted to take down gi/12 on either switch if the respective port went down on the peer switch.  In that case, this solution should work.

You will need to install the no_easy_shell.tcl EEM Tcl policy on both switches.  Create a directory on each switch's flash called "policies", then copy this Tcl policy into them.  Then, configure the EEM policy directory, and register the policy:

event manager directory user policy flash:/policies

event manager policy no_easy_shell.tcl

Then, copy the attached cmd.dat file to switches.  This file should be put in the root on the flash.  You will first need to edit this file, and replace the word ENABLE with the enable password of each switch.  That is, the cmd.dat file you upload to switchA should have the enable password of switchB in it (and vice versa).

Then, on switchA, upload a file with the following contents.  Call this file input.bat:

-h switchB -t ios -P telnet -u USER -p PASS -f flash:/cmd.dat

Where switchB is the IP address of switchB, USER is the username used to login to switchB (if you only use VTY passwords leave out the -u USER option altogether), and PASS is the password used to login to switchB.  Note: this requires telnet to work between the two switches.  SSH is not supported.

On switchB, upload a file with the following contents.  Call this file input.bat:

-h switchA -t ios -P telnet -u USER -p PASS -f flash:/cmd.dat

Where switchA is the IP address of switchA, USER is the username used to login to switchA (if you only use VTY passwords leave out the -u USER option altogether), and PASS is the password used to login to switchA.

Next, one each switch, you need to define an EEM environment variable to tell the no_easy_shell.tcl policy where to find its input file:

event manager environment easy_shell_batch_file flash:/input.bat

Finally, you will need to create an applet policy on each switch to watch for port Gi1/2 to go down:

event manager applet port-down

event syslog pattern "LINEPROTO-5-UPDOWN.*Line protocol on Interface GigabitEthernet1/2, changed state to down"

action 1.0 policy no_easy_shell.tcl

If everything goes right, when port Gi1/2 goes down on either switch, that switch will login to the other switch, temporarily unconfigure the applet policy, and take down port Gi1/2.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: