cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1360
Views
0
Helpful
1
Replies

Need tcl script to reset interfaces

Hello everybody,

I´m pretty unaware of all this tcl scripting stuff so hopefully someone of you can help me out.

 

I need a tcl script that resets all interfaces on the system.

That means doing a "shutdown" and afterwards "no shutdown"

 

How can I dynamically fetch all system interfaces ?

does anybody have an idea ?

 

Best regards,

Steffen

 

1 Reply 1

Hello,

 

I found a solution together with my colleague.

Pretty simple if you know how to script, I guess :-)

 

set all_int [exec "show ip interface brief | ex Vlan"]


foreach gi_int [regexp -all -line -inline "(^\[A-Za-z]*\[0-9/]+)" $all_int] {
 ios_config "interface $gi_int" " shutdown" }

after 10000

foreach gi_int [regexp -all -line -inline "(^\[A-Za-z]*\[0-9/]+)" $all_int] {
 ios_config "interface $gi_int" "no shutdown" }

 

Best regards,

Steffen