Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling Ports through Script... (4006/6509)

Status
Not open for further replies.

MJewell

MIS
Jul 5, 2001
143
US
I need a little help... We are moving into a new building with 12 4006's all connected down to a 6509.

I need to write a script that will telnet into a switch and disable a block of ports (to say disable network access in a classroom when the students don't need to be playing on the internet)... Cisco says I can do it by writing a telnet script, but I don't know where to start... I'll only need to disable ports on 4006's, as the 6509 will only be 1gig trunks between the switches...

Any suggestions? Anyone else doing anything similar?
 
If you are using unix or in a dos window, I suggest creating 2 script files and redirect input from them...
To disable
telnet xxx.xxx.xxx.xxx < disable_script_file
And to enable...
telnet xxx.xxx.xxx.xxx < enable_script_file
your script files will basically look like this
--------------------------
read_only_password
enable
enable_password
set port disable 3/4-28
y
exit

--------------------------
and to enable...
--------------------------
read_only_password
enable
enable_password
set port enable 3/4-28
exit

--------------------------
The example above disables 25 ports, namely 4 through 28 on module 3.
replace the part that says read_only_password with the actual read-only password
and the enable_password with the actual enable password.
this should also work from a dos command prompt.
But be warned that your password will be viewable to anyone who gets access to these scripts.
 
Okay, then I think when we have the Tech come out to configure our ACS server we'll have him create 12 accounts with access to only 1 specific switch each to minimise the damage one could do if they did get into the script file...

Thanks,
-Mike
 
Check out the Cisco router forum...I noticed a similar request for auto execution of EXEC commands on a router and someone suggested some freeeware from kiwisyslog.com.
It runs Cisco EXEC commands to any number of devices (if you buy), otherwise you are limited to one or two devices..sounds like a cool solution
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top