Hey guys,

I found this neat TCL script to flap interfaces in a lab technology to simulate 
link flap..

Just dump these into tclsh:

proc sleep {n} {
   after [expr {int($n*1000)}]
}

proc simFlap args {
   set data [split $args " "]
   set numtimes [lindex $data 2]
   regsub -all {[^0-9A-Za-z]} $numtimes "" numtimes
   for {set i 0} {$i<[expr {int($numtimes)}]} {incr i} {
      ios_config "interface [lindex $data 0]" "shutdown"
      sleep [lindex $data 1]
      ios_config "interface [lindex $data 0]" "no shutdown"
      sleep [lindex $data 1]
   }
}

Then you run it with " simFlap se0/0 5 10"  <-- 10 times with 5sec between each 
flap.. you can change the interface name and timer values as you please.. and 
then practice dealing with flapping links in the topology :) not sure if this 
will be useful for the real labs but it sure is cool..



Bestu kveðjur / Regards
Áki H. Barkarson
Sérfræðingur Netkerfi | Network Engineer - CCNP/CCIP/CCDP
Tel: (+354) 563 3124 / Mob: (+354) 863 0753
E-mail: [email protected]<mailto:[email protected]>
___________________________________________
[cid:[email protected]]
Grensásvegur 10, 108 Reykjavík, Iceland
Tel: +354 563 3000 Fax: +354 568 8487
www.ejs.is<http://www.ejs.is/> / Skilmálar / 
Disclaimer<http://www.ejs.is/?pageid=1371>


<<inline: image001.jpg>>

_______________________________________________
For more information regarding industry leading CCIE Lab training, please visit 
www.ipexpert.com

Reply via email to