Introduction
This document provides a sample configuration for using EEM with the IOS-XR releases for the ASR9000. Though EEM is found in other XR platforms also, this example is specifically tested and demonstrated for hte ASR9000.
Core Issue
Using LAG or Link Aggregation or what IOS calls EtherChannel you have the ability to use the "min-links" feature. It allows the system to shut down the whole bundle when there are not enough members available, hence aggregated bandwidth to support the traffic.
There are cases where you cannot use or don't want to use LAG, but rather use ECMP, Equal Cost Multipath, to support more aggregated bandwidth.
In that case, when a certain number of path disappears, there is no way to automatically shut other paths to instantiate failover to a redundant ECMP path.
This document will show how to use EEM to detect an ECMP member going down and automatically shut the other members of that path.
Resolution
a) Preparation
b) XR configuration
c) Setting up interfaces to Monitor
d) How to determine if the script was invoked
e) Sample Operation
a) Preparation:
1) Setup the interfaces that are to be shut when this script kicks in. Edit the minlinks_ecmp.tcl file with a file editor such as notepad. In the top of the script there is a section that provides these variables. Change the interface names as if you’d configure them yourself.
#Interfaces of the ECMP bundle that need to be shut
set _if_1 "interface g0/0/0/29"
set _if_2 "interface g0/0/0/28"
set _if_3 "interface g0/0/0/27"
set _if_4 "interface g0/0/0/26"
2) copy the saved and modified tcl file to the disk0:
RP/0/RSP0/CPU0:Viking-Top#copy tftp://3.0.0.1/minlinks_ecmp.tcl disk0:
b) XR configuration:
(exec cfg)
event manager environment _syslog_pattern .*(GigabitEthernet)(0/0/0/0|0/0/0/20).*(changed state to Down)
event manager directory user policy disk0:
event manager policy minlinks_ecmp.tcl username eem type user
aaa authorization eventmanager default local
(admin cfg)
username eem
group root-system
group cisco-support
!
c) Setting up the interfaces to monitor
The syslog pattern is currently setup for monitoring Gigabit Ethernet interfaces 0/0/0/0 and 0/0/0/20.
If you’d like to monitor TenG interfaces TenGigE0/3/0/0 and TenGigE0/7/0/1 then change the line to:
event manager environment _syslog_pattern .*(TenGigE)(0/3/0/0|0/7/0/1).*(changed state to Down)
Note that everything is case and space sensitive.
d) How to determine if the script was invoked
A SYSLOG message will be printed everytime the script is invoked!
RP/0/RSP0/CPU0:Jan 25 09:57:41.248 : minlinks_ecmp.tcl[65814]: ECMP DISTRIBTION SHUTDOWN ON THIS ROUTER!
e) Sample operation :
We are receiving an event of a interface down that we are monitoring:
LC/0/0/CPU0:Jan 25 10:07:31.742 : ifmgr[171]: %PKT_INFRA-LINK-3-UPDOWN : Interface GigabitEthernet0/0/0/0, changed state to Down
LC/0/0/CPU0:Jan 25 10:07:31.742 : ifmgr[171]: %PKT_INFRA-LINEPROTO-5-UPDOWN : Line protocol on Interface GigabitEthernet0/0/0/0, changed state to Down
RP/0/RSP0/CPU0:Jan 25 10:07:31.758 : ospf[314]: %ROUTING-OSPF-5-ADJCHG : Process CORE, Nbr 172.16.1.1 on GigabitEthernet0/0/0/0 in area 0 from FULL to DOWN, Neighbor Down: interface down or detached,vrf default vrfid 0x60000000
RP/0/RSP0/CPU0:Viking-Top#
!EEM is kicking in to admin shut the pre defined interfaces:
RP/0/RSP0/CPU0:Viking-Top#
LC/0/0/CPU0:Jan 25 10:07:37.931 : ifmgr[171]: %PKT_INFRA-LINK-5-CHANGED : Interface GigabitEthernet0/0/0/26, changed state to Administratively Down
LC/0/0/CPU0:Jan 25 10:07:37.931 : ifmgr[171]: %PKT_INFRA-LINK-5-CHANGED : Interface GigabitEthernet0/0/0/27, changed state to Administratively Down
LC/0/0/CPU0:Jan 25 10:07:37.931 : ifmgr[171]: %PKT_INFRA-LINK-5-CHANGED : Interface GigabitEthernet0/0/0/28, changed state to Administratively Down
LC/0/0/CPU0:Jan 25 10:07:37.932 : ifmgr[171]: %PKT_INFRA-LINK-5-CHANGED : Interface GigabitEthernet0/0/0/29, changed state to Administratively Down
RP/0/RSP0/CPU0:Jan 25 10:07:38.238 : config[65815]: %MGBL-CONFIG-6-DB_COMMIT : Configuration committed by user 'eem'. Use 'show configuration commit changes 1000000656' to view the changes.
** Note the config changes made by the username as per configuration
RP/0/RSP0/CPU0:Jan 25 10:07:38.739 : config[65815]: %MGBL-SYS-5-CONFIG_I : Configured from console by console on vty100 (0.0.0.0)
** Syslog message is printing
RP/0/RSP0/CPU0:Jan 25 10:07:39.007 : minlinks_ecmp.tcl[65812]: ECMP DISTRIBTION SHUTDOWN ON THIS ROUTER!
RP/0/RSP0/CPU0:Viking-Top#
Related Information
XR EEM standard documentation.
Additional note, XR 4.0 and XR4.01 have a bug that will be fixed in 4.1 that prevents proper invokation of TCL upon syslog events. Please consult TAC for ddts and resolution prior to 4.1
Xander Thuijs, CCIE #6775
Sr Tech Lead ASR9000