Cisco

Manage Cisco Configurations with RANCID

Материал перенесён из старой базы знаний ATC-IP и оформлен в едином стиле нового сайта.

Manage Cisco Configurations with RANCID
Essential
Open Source Network Administration Tools
1. Introduction
1.1. Document conventions
2. Install RANCID Prerequisites
2.1. Install MacPorts
2.2. Install Postfix
2.3. Apache and cvsweb setup
3. Install and Configure RANCID
3.1. Install RANCID
3.2. Edit the ~/.cloginrc file
3.3. Choose device groups
3.4. Edit the rancid.conf file
3.5. Install CVS/add devices
3.6. Modify device groups
4. Setup RANCID Email Aliases
4.1. Set device group aliases
4.2. Activate RANCID aliases
5. Start and Test RANCID
5.1. Check all groups
5.2. Check individual groups
5.3. View config and log files
5.4. Set cron to run RANCID
6. View RANCID CVS Webpage
7. Support Information
1. Introduction
Really Awesome New Cisco confIg Differ (
RANCID
) can automatically
archive backup copies of your Cisco configuration (config) files to a
Concurrent Versions System (
CVS
) repository, detect
updates and backup config file versions to CVS, and notify you of
individual command changes via email. These functions make RANCID an
important tool for disaster recovery; it is used at AOL, Global Crossing,
and many other corporations. RANCID can also manage network devices from
HP, Juniper, Foundry, Alteon, and others, but managing those devices is
not covered.
These instructions assume a basic knowledge of Cisco switches and
routers, the Unix command line (terminal) window, and basic text
editing.
1.1. Document conventions
Here are the conventions used to distinguish Unix terminal window
input and output.
%%
Commands to be typed into a terminal window.
Command output to a terminal window.
File text.
2. Install RANCID Prerequisites
In this section we install general prerequisites including the
Postfix Simple Mail Transport Protocol (SMTP) email server to deliver
RANCID notifications.
2.1. Install MacPorts
You may install the MacPorts package manager with
these
instructions
. Follow the instructions carefully and perform all
non-optional steps.
2.2. Install Postfix
In this section we’ll install and use the Postfix SMTP server
using MacPorts. You may also use a commercial SMTP server that supports
Sendmail emulation, such as:
Communigate Pro
Post.Office
, or
SurgeMail
(see
vendor documentation for installation instructions.)
%%
sudo port install postfix
Use the sample Postfix configuration files.
%%
cd /opt/local/etc/postfix
%%
sudo cp master.cf.sample master.cf
%%
sudo cp main.cf.sample main.cf
%%
sudo cp aliases.sample aliases
Run these commands to activate the Postfix aliases file.
%%
sudo postalias /opt/local/etc/postfix/aliases
%%
sudo newaliases
Redirect OS X’s Sendmail executable to the one from
MacPorts.
%%
sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.old
%%
sudo ln -s /opt/local/sbin/sendmail /usr/sbin/sendmail
Start Postfix and set it to run at system boot.
%%
sudo
launchctl load -w /Library/LaunchDaemons/org.macports.postfix.plist
Finally, test the SMTP server by sending a sample message.
%%
mail joe@exp.com
Enter text for the message body and then press Control-D on a
blank line to send the message. This test must succeed for RANCID email
notifications to be delivered. Make sure the SMTP server for the
receiving domain will allow mail from your RANCID workstation. If the
email does not arrive, check the mail log to see why as shown.
%%
tail /var/log/mail.log
2.3. Apache and cvsweb setup
The default Apache user and group for OS X is “www”. You may run
RANCID as user “www,” or you may create a new user for RANCID in the
Accounts pane of your Mac's System Preferences and set Apache to run as
that user. As long as you run RANCID as the same user as the Apache
user, RANCID web access will work fine.
Install and configure cvsweb.
%%
sudo port install cvsweb
Edit the cvsweb.conf file.
%%
sudo pico /etc/httpd/cvsweb.conf
Change the @CVSrepositories 'local' variable to point to the
path to your RANCID CVS repository as shown.
Позвонить +7 (343) 382-33-16