Change the same configuration command on Multiple Cisco switches

Source: Internet
Author: User

Q: Are there any simple tools and methods? Run the script automatically on N or so cisco switches according to the script, and then return the result?
Method 1: Download and modify the vswitch configuration file and upload it to N vswitches. Restart or copy start run.
Method 2: Create a bat file under windows. The content in the file is the same as the command you used to telnet to the vswitch for modification, except that the IP address needs to be N times, which is troublesome. Then run the bat file.
Method 3: Use ciscoworks 2000 for configuration once. This method has certain restrictions, such as configuring SNMP in each switch first. If it is a newly enabled switch, or SNMP is not configured), if the password of each switch is different, you still cannot configure it.
Method 4: Use Perl to write a small script, although it takes one or two days for beginners. But it is definitely worth it.
#! /Usr/bin/perl
Use strict;
Use Net: Telnet: Cisco;
My $ infile = "input.txt"; # Cisco Device List
My $ username = "user"; # login username
My $ passwd = "password"; # login password
Open (INFILE, "$ infile") | die "Can't open $ infile $! ";
While (my $ ip = <INFILE> ){
Chomp $ ip;
My $ t = Net: Telnet: Cisco-> new (Timeout => 10, Input_log => "input. log ");
$ T-> open ($ ip );
$ T-> login ($ username, $ passwd );
$ T-> enable ($ passwd );
$ T-> cmd ('TERM length 0 ');
$ T-> cmd ('sh ver '); # you can change the command sh ver to your command
$ T-> close;
}
Close INFILE;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.