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

Route changes (interface shutdown) based on packet loss/udp jitter

kimsol2005
Level 1
Level 1

Hi I am trying to figure out the best way to write a script to change my routing by shutting down my LAN interface in which case my backup route will take over!

The purpose of this is VoIP and specifically what i am looking is a IP SLA based event tracking as my link at times can be quite unstabile.

What I would to do is

  1. shut down the LAN interface if 3 successive pings (packets) are lost (if this is possible)
  2. shut down the lan interface if more than 5 packets out of the last 100 are lost

I would like to turn on the interface only when packet loss are less than 10 packets out of the last 1000

I am not really sure what a scipt like this would like as i am (fairly) novice at eem scripting, nor am I sure if ICMP or udp jitter is the best approach for such a thing!

Ayone have any idea?

7 Replies 7

Joe Clarke
Cisco Employee
Cisco Employee

On the surface, it seems like IPSLA plus EEM would work for you, but you have one fundamental problem.  If you shutdown the interface, how can you automatically recover once stability has returned?

Topology is actually well developed.

Core switch connects to

1. MPLS router

2. VPN router

Routes are comming in from both paths with better metrics from MPLS path.

The idea above therefore is that MPLS router monitor the leased line and shut down the LAN interface (it can still monitor the leased line), but in that way blocking routes reaching the core switch which then used the backup routes.

EEM and IPSLA i agree would be the solution, i am just not sure how to trigger events such as describes above! 

What type of device will this be running on?  What version of IOS?

Hi Joseph

Do you any idea as to a good structure of the SLA part for packet loss?

It will run on ciscco 2951 IOS version 15.2M4

My main problem basically is defining the SLA monitors and the triggers associated so any input would be appreciated.

Hi

This will run on ciscco 2951 IOS version 15.2M4

My main problem basically is defining the SLA monitors and the triggers associated so any input would be appreciated.

You can only have one reaction per operation, but you could then use an EEM counter to track the overall dropped packets.  Here's a rough example of how this might work.

ip sla 1

icmp-echo 10.1.1.1

ip sla schedule 1 start now life forever

ip sla reaction-config 1 react timeout threshold-type consecutive 3 action-type trapOnly

!

event manager applet ipsla-react

event ipsla operation-id 1 reaction-type timeout

action 1.0 if $_ipsla_condition eq "Occurred"

action 2.0 cli command "enable"

action 3.0 cli command "config t"

action 4.0 cli command "int gi0/1"

action 5.0 cli command "shut"

action 6.0 cli command "end"

action 7.0 end

!

event manager applet ipsla-poll

event snmp oid 1.3.6.1.4.1.9.9.42.1.2.10.1.2.1 get-type exact entry-op ge entry-val 0 poll-interval 60 entry-type val

action 1.0 if $_snmp_oid_val eq 1

action 2.0 counter name ipsla_good op inc value 1

action 2.1 counter name ipsla_good_recover op inc value 1

action 3.0 else

action 4.0 counter name ipsla_bad op inc value 1

action 4.1 counter name ipsla_bad_recover inc value 1

action 5.0 end

!

event manager applet ipsla-good-recover-counter

event counter name ipsla_good_recover entry-op eq entry-val 1000 exit-op ne exit-val 1000

action 1.0 counter name ipsla_bad_recover op nop

action 2.0 if $_counter_value_remain lt 10

action 3.0 cli command "enable"

action 4.0 cli command "config t"

action 5.0 cli command "int gi0/1"

action 6.0 cli command "no shut"

action 7.0 cli command "end"

action 8.0 end

action 9.0 counter name ipsla_good_recover op set value 0

action 9.1 counter name ipsla_bad_recover op set value 0

!

event manager applet ipsla-bad-counter

event counter name ipsla_bad entry-op eq entry-val 5 exit-op ne exit-val 5

action 1.0 counter name ipsla_good op nop

action 2.0 if $_counter_value_remain le 100

action 3.0 cli command "enable"

action 4.0 cli command "config t"

action 5.0 cli command "int gi0/1"

action 6.0 cli command "shut"

action 7.0 cli command "end"

action 8.0 end

action 9.0 counter name ipsla_bad op set value 0

action 9.1 counter name ipsla_good op set value 0

!

event manager applet ipsla-bad-recover-counter

event counter name ipsla_bad_recover entry-op lt entry-val 0 exit-op gt exit-val 0

action 1.0 counter name ipsla_bad_recover op nop

!

event manager applet ipsla-good-counter

event counter name ipsla_good entry-op lt entry-val 0 exit-op gt exit-val 0

action 1.0 counter name ipsla_good op nop

Hi Joseph.

I will definetely try this out on a lab basis and see how it performs!

I am presently out of office but will revert once i have tested something like this out.

quite extensive script, and i thank you for the effort which i will try my best to "debug" so i can modify where and how needed

Best regards

kim

Review Cisco Networking for a $25 gift card