Install Rancid# yum install rancidConfiguration1.Edit /etc/rancid/rancid.conf# vi /etc/rancid/rancid.conf2.Find this line in rancid.conf:#LIST_OF_GROUPS=”sl joebobisp”And,underneath it add the following line: Here we adding group Switches in to which we are adding all over networks switchesLIST_OF_GROUPS=”SWITCHES”We want to use Subversion for our Version Control System, and not CVS, so find the line with the parameter RCSSYS:RCSSYS=cvs; export RCSSYS And,change it to: RCSSYS=svn; export RCSSYS and the line with CVSROOT:CVSROOT=$BASEDIR/CVS; export CVSROOTAnd,change it to: CVSROOT=$BASEDIR/svn; export CVSROOTNote:the lowercase “svn”. Now exit and save the file.3. Change to the rancid user:# su -s /bin/bash rancidChec kthat you ARE the rancid user:$ id4.Create /var/rancid/.cloginrc. Replace ip with device IP address, you can use "*" if you want to use same method for large number of devices.for example, 10.1.*.*$ vi /var/rancid/.cloginrc add user <ip> ssh_username add password <ip> ssh_user_pass enable_pass add method <ip> [ssh|telnet]$ chown rancid:rancid /var/rancid/.cloginrc$ chmod 600 /var/rancid/.cloginrc5.Test login to the router of your group:$ /usr/libexec/rancid/clogin rtrX.bdnog.org[After successful execution, you will be login to router enable mode]6.Initialize the SVN repository for rancid:$ /usr/libexec/rancid/rancid-cvs7. Create the router.db file: Here "SWITCHES" is the group we created .$ vi /var/rancid/SWITCHES/router.dbAdd below link, replacing ip with actual device IP addressesip:cisco:up8.Run rancid!$ /usr/libexec/rancid/rancid-run9.Look at the configs. The backed up configs will be saved in /var/rancid/<GROUP_NAME>/configs.$ cd /var/rancid/bdnog/configs $ less SWITCHES
10.Check the rancid log files:$ cd /var/log/rancid $ ls -llEmail Alert Configuration1.Edit /etc/rancid/rancid.confAdd this to the /etc/aliases file: (group names have to be named rancid-admin-<group listed in rancid.conf file) and rancid-<group listed in rancid.conf file>). Replace "noc@systemadvise.com" with correct email addrsss of you choice.# Groups for rancid rancid-admin-all: noc@systemadvise.com rancid-all: noc@systemadvise.comSave the file and run#newaliasesCRON Schedule1.For automated backup, you can setup CRON schedule. Please note that cron need to configured under user RANCID.# su -s /bin/bash rancid # crontab -e # m h dom mon dow command 0 0 * * * /usr/libexec/rancid/rancid-run gInstall WEBSVN# yum install websvnConfiguration1.Fix permissions. The web server must be able to read the SVN (Subversion) folder# chgrp -R apache /var/rancid/svn # chmod g+w -R /var/rancid/svn2.Change ownership of web files:# chown apache:apache /usr/share/websvn3.Add the following virtual host entry to your apache configuration file /etc/httpd/conf.d/websvn.conf:Alias /websvn /usr/share/websvn <Directory /usr/share/websvn/> DirectoryIndex index.php Options FollowSymLinks Options FollowSymLinks MultiViews Order allow,deny Allow from all <IfModule mod_php4.c> php_flag magic_quotes_gpc Off php_flag track_vars On </IfModule> </Directory>5.Reload apache and try to browse the websvn: http://<ip_address>/websvn.Check you can access the WebSVN.6.Now we add RANCID repository sites. Edit websvn configuration file.# vi /usr/share/websvn/include/config.php// Local repositories (without and with optional group): // $config->addRepository(‘BDNOG’, ‘file:///var/rancid/svn/’);
Linux, Systems, LoadBalancer, F5, Cisco, Juniper,ASA, Firewalls, Switches, Routers, MainFrames, Unix, Solaris