cisconf - Cisco configuration management via TFTP
cisconf -a <conf> cisconf -d <conf> cisconf -e <conf> [-n] cisconf -r <conf> cisconf -l <conf> cisconf -s <conf> [-w] cisconf -i cisconf -h cisconf -v
The cisconf utility allows to maintain a a set of Cisco router configurations as files. Configuration files can be loaded from routers or saved into routers by using a local TFTP server.
Usually you start with adding router configurations to the config file, ~etc_dir~/configuration. This is done by invoking
~etc_dir~/configuration
cisconf -a <conf>
where <conf> is a short and unique name for the configuration you like to add.
<conf>
The script will ask you some questions interactively and allow you to enter the new routers settings, in particular the IP address, the login username, the login and enable password, a description and a list of users that are allowed to manage the router.
You can remove a given router configuration with
cisconf -d <conf>
where <conf> is the name you gave the router when invoking cisconf -a <conf>.
Router configurations can be edited with
cisconf -e <conf> [-n]
This will invoke the editor from the environment variable EDITOR. If you didn't set this variable, the first editor from the editors list in the configuration file ~etcdir~/configuration is used.
~etcdir~/configuration
After you have modified the configuration, the revision control system will be invoked, unless you specify the option -n. Revision control will be done by using the command from the ci attribute in the configuration file.
-n
The command
cisconf -p <conf>
will print the configuration file of the given router to stdout.
The best starting point for creating a new configuration is of course loading the current configuration of the router. This is done by invoking the command
copy running-config tftp
on the router and storing the configuration on the local TFTP server. The command
cisconf -l <conf>
will do that for you, creating the file ~tftp_dir~/<conf<gt.conf>.
~tftp_dir~/<conf<gt
Of course this requires an appropriately configured TFTP server with write permissions in the directory ~tftp_dir~.
The counterpart of the -l option is
-l
cisconf -s <conf> [-w]
This will read the file ~etcdir~/<conf<gt.conf>, strip comments and empty lines and store the result in ~etcdir~/<conf<gt.conf>. The latter file will then be stored on the router by executing the command
~etcdir~/<conf<gt
copy tftp running-config
Note, that by default the new configuration is not written into the non-volatile memory of the router! The option -w modifies this behaviour by executing the command
-w
write memory
on the router, if the configuration has successfully be stored on the router.
cisconf -i
will print a list of all router configurations accessible by the current user.
You get a short help message by invoking
cisconf -h
cisconf -v
will print the programs version number and exit immediately.
This program is
Copyright (C) 1998 Jochen Wiedmann Am Eisteich 9 72555 Metzingen Germany Phone: +49 7123 14887 Email: joe@ispsoft.de
All rights reserved.
You may distribute this module under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
Cisco::Conf(3), Cisco::Conf::Install(3), tftpd(8)
EOF
require Cisco::Conf; my $config = Cisco::Conf->_ReadConfigFile('configuration');
require Config; $config->{'startperl'} = $Config::Config{'startperl'};
$script =~ s/\~(\w+)\~/$config->{$1}/eg;
if (!open(FILE, ">cisconf") || !print FILE ($script) || !close(FILE)) { die "Error while writing cisconf script: $!"; }
To install Cisco::Conf, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cisco::Conf
CPAN shell
perl -MCPAN -e shell install Cisco::Conf
For more information on module installation, please visit the detailed CPAN module installation guide.