TCL for packet loss - Shutdown BGP session

Unanswered Question
Sep 18th, 2008

Hi Guys,

Looking for a solution here. I am looking for a EEM/TCL script (or other idea) that when packet loss occurs on a certain path, we can shut down the BGP peering seesion, so that all traffic directs to another upstream ISP.

We had this problem yesterday, it affected our customers in terms of performance and we want to make sure that it does not happen again.

Thnaks in advance


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
stephen.stack Sun, 09/21/2008 - 08:00

hi Joesph,

Thanks for the idea. Since you mentioned it, we will looking to to PfR in more detail. I think it is a more scaleable and robust method of an 'intelligent' design than scripting!


Joe Clarke Mon, 09/22/2008 - 12:26

EEM would work well for this. If you still want to pursue a scripting option, let me know exactly how you are detecting packet loss, exactly what commands you want to run when loss is detected, and what IOS version you're using.

stephen.stack Mon, 09/22/2008 - 12:47


thanks for reply, and help. I am presenting my options to management soon. It would be good to have a number of solutions investigated.

So, i think the following would do me...

I have a 7206VXR c7200-is-mz.124-13a.bin

I am detecing packet loss by ping really. So, if the script could constantly ping out an interface, we'll say the next hop. If packet loss exceeds 10% then shut down the interface, while raising a log entry.

This way BGP will just failover to the other ISP automatically.

What do you think?



Joe Clarke Mon, 09/22/2008 - 13:30

This is doable. The best course of action will be to use IP SLA to do the ping. You could then have an EEM Tcl policy configured which would watch for an IP SLA timeout. If one occurs, it would look at the total number of successful completions, and compare that to the amount of time the IP SLA collector has been active. If the number of failures > 10%, then you could run the commands you need.

stephen.stack Mon, 09/22/2008 - 13:48

Makes sense to me.

Where would i start in writing the script. IO have a few scripting guys in the office here that could help me out. What would TCL compare to in terms of scripting?


Joe Clarke Mon, 09/22/2008 - 13:51

Tcl is like Tcl. It's flow is more akin to a shell script than to something like Perl. The EEM Tcl policy reference can be found at . There are some sample scripts available from . I am also hosting an EEM Ask the Expert session on the Network Management forum. If you have specific questions, feel free to ask there, and I'll help you out.


This Discussion