RANCID Ubuntu Install Stage1

This is a brain dump of the RANCID install process that I’ve put together and fully tested using Ubuntu 11.04

Requirements:

o Ubuntu-Server 11.04 “ubuntu-11.04-server-i386.iso”
o username: notwork
o password: notworking

Notes:
_________________________________________________________________________________________________________________________________________

text preceeded by # is a command to be issued

text enclosed in a box ~~~~~~~~~~~# is the editing of a file

I personally use vi to edit text/config files remembering that “ESC” then “:wq!” will save the file (write,quit and force) and “i” will allow you to insert text.

_________________________________________________________________________________________________________________________________________

1)

Use apt-get to install the programs

Install Ubuntu following a standard build and at package selection only choose ssh server. Once the build has completed login as user notwork with a password of notworking (change username/password as you see fit). Once logged int the console enter the following:

o #sudo apt-get install apache2
o #sudo apt-get install expect
o #sudo apt-get install cvs
o #sudo apt-get install cvsweb
o #sudo apt-get install checkinstall
o #sudo apt-get install rancid-core rancid-util build-essential

This will have installed Rancid in /etc/rancid.

2)

We need to configure the /etc/rancid/rancid.conf file to create groups of devices. At least one group needs to be configured and adding multiple groups means that the names must be separated with a space. The example below will create the groups where all the device configurations will be stored:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

LIST_OF_GROUPS=”switches”

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

3)

The next step is to setup the CVS configuration with the following command:

o #sudo su -c /var/lib/rancid/bin/rancid-cvs -s /bin/bash -l rancid

There should be a new folder added in the /var/lib/rancid directory, this has been named after the group(s) you created earlier in 2). Navigate into this folder and open up the router.db with vi. Here you will specify what router/switches you want to add to your CVS. For example:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

192.168.0.25:cisco:up

procurve.foo.org:hp:up

192.168.0.35:juniper:down

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

4)

After this has been completed we then need to tell rancid how to access the devices. This is done by creating a .cloginrc script file in the /var/lib/rancid folder with the following commands:

#sudo touch .cloginrc
#sudo vi .cloginrc

Use the following example which will attempt to telnet to all devices with a username of user and a password of password. This file can be updated to meet many of your standard requirements or use multiple methods for varying examples.

add method * telnet
add user * user
add password * password

5)

We need to secure the .cloginrc file by changing the owner and file permission.

#sudo chown rancid:rancid /var/lib/rancid/.cloginrc
#sudo chmod 640 /var/lib/rancid/.cloginrc

6)

Lastly we should be done and should see if rancid is working correctly by running the process as the rancid user with the following command

#sudo -u rancid -H /usr/bin/rancid-run

You can check if the command was successful by checking the logs in /var/log/rancid/switches. It should say in the log message “All routers successfully completed.”.

See the Stage 2 post to install/configure the CVS web interface and Stage 2.5 to use rancid to update device configurations either in bulk or singularly.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s