Rancid

From HackerNet
Revision as of 21:41, 17 June 2015 by Helikopter (talk | contribs)
Jump to: navigation, search

Really Awesome New Cisco confIg Differ är ett verktyg för versionshantering av konfigurationsfiler på nätverksutrustning. Programvaran är skapad av Shrubbery Networks.

Rancid kan användas för följande:

  • Backing and storing configuration files
  • Configuration comparison
  • Configuration version archival

Rancid kan hjälpa till i arbetet med följande frågor:

  • How do you know when a change occurs?
  • What do you do when a change occurs?
  • Can you correlate network events with changes?
  • Do you enforce a baseline or set configuration standard?

Installation

sudo apt-get install rancid
sudo nano /etc/rancid/rancid.conf
# list of rancid groups
LIST_OF_GROUPS="routers switches"

Filer

/etc/rancid/ # Config file
/var/lib/rancid/ # Most other files
/var/lib/rancid/[gruppnamn]/router.db # Add devices
sudo chown -R rancid:rancid /var/lib/rancid
su - rancid

Add devices

nano /var/lib/rancid/switches/router.db
192.168.0.100:cisco:up
sw01.local:cisco:up
10.0.0.10:hp:up

CVS

Lagra i CVS repo. Går även att köra med subversion.

su – rancid 
/var/lib/rancid/bin/rancid-cvs

Schemaläggning

su - rancid
crontab -e
0 * * * * /opt/rancid/bin/rancid-run
0 1 * * * find /opt/rancid/var/logs -type f -mtime +30 -exec rm {} \; # Slang gamla loggar

CVSWeb

sudo apt-get install cvsweb
sudo cp /etc/cvsweb/cvsweb.conf /etc/cvsweb/cvsweb.conf.ORIGINAL
sudo nano /etc/cvsweb/cvsweb.conf
@CVSrepositories = (
'Rancid'  => ['Rancid Repository', '/var/lib/rancid/CVS'],
);
sudo ln -s /usr/share/cvsweb /var/www/html/css
wget http://people.freebsd.org/~scop/cvsweb/cvsweb-3.0.6.tar.gz ~ && tar xf ~/cvsweb-3.0.6.tar.gz
sudo mkdir /var/www/cgi-bin/ && sudo cp -a ~/cvsweb-3.0.6/cvsweb.cgi /var/www/cgi-bin/
sudo chmod 755 /var/www/cgi-bin/cvsweb.cgi && sudo service apache2 restart

Access CVSweb

http://server_url/cgi-bin/cvsweb

Mailnotifiering

WIP

Dokumentation

http://www.routereflector.com/2013/09/configuration-versioning-using-rancid/
https://networklore.com/rancid-getting-started/
http://www.itnotes.eu/?p=365
http://www.richardyau.com/?p=11