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

TCL Script for shutting interfaces

steve.orphanos
Level 1
Level 1

I wanted to know if anyone can help me create a TCL script that can shut down interfaces when the script is executed.

7 Replies 7

Joe Clarke
Cisco Employee
Cisco Employee

What version of IOS are you using? What arguments should the script take?

Hello,

The IOS version is 12.2(33). I would like to create a script that when executed would execute the following commands.

Interface Gig 1/1

Shut

Interface range Gig 2/1 - 6

Shut

Interface Gig 2/20

shut

Interface range Gig 2/23 - 24

Shut

Then have another script to turn those interfaces up.

This should do it for you:

Switch#tclsh flash:bounce-ports.tcl shut

Switch#tclsh flash:bounce-ports.tcl noshut

Do i just copy the file bounce-ports.tcl to the cisco router? If so where does the file get placed?

Thanks again for all your help

You can copy it to the local flash of the switch, or leave it on a network server. For example, the script can be run directly from TFTP:

Switch#tclsh tftp://10.1.1.1/bounce-ports.tcl shut

I found a stupid typo in the noshut case. Here is a fixed version.

Thanks again for all your help. I greatly appreciate it.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco