How to Install RANCID on EndeavourOS Latest
RANCID (Really Awesome New Cisco Config Differ) is an open-source tool used to manage network device configurations. In this tutorial, we will demonstrate how to install RANCID on EndeavourOS Latest using the command line.
Prerequisites
Before getting started you should:
- Have a fresh installation of EndeavourOS Latest.
- Have access to a terminal window or console.
- Have sudo or root user privileges.
Step 1: Update System Packages
Firstly, update the system packages to ensure all installed packages are in their latest versions. Run the following command:
sudo pacman -Syu
You may be prompted to enter your password.
Step 2: Install Dependencies
To install RANCID, we need to install some dependencies required for its function. Install the dependencies by running the following command:
sudo pacman -S cvs rcs perl-net-telnet-cisco perl-term-readkey perl-digest-md5 expect
Step 3: Download and Extract RANCID Package
The next step is to download and extract the RANCID package. Run the following command to download the tarball file from the official RANCID website:
sudo wget https://www.shrubbery.net/pub/rancid/rancid.tar.gz
Once downloaded, extract the tarball file using the following command:
sudo tar -xzvf rancid.tar.gz -C /opt/
Step 4: Configure the RANCID Package
Next, we need to configure the RANCID package. Navigate to the RANCID installation directory and run the following command:
cd /opt/rancid-3.14/
Now that we are in the right directory, run the following command to configure the package:
sudo ./configure --prefix=/usr/local/rancid
Step 5: Build and Install RANCID
After configuration, we need to build and install RANCID. Run the following commands:
sudo make
sudo make install
Step 6: Create the RANCID Configuration File
Now we need to create the RANCID configuration file. Run the following command to create and edit the file:
sudo vim /usr/local/rancid/etc/rancid.conf
Press i to enter insert mode, and copy the below sample configuration into the file:
## Sample rancid.conf, based on one by Erik Sherk:
#
# Health Check Script
#
LIST_OF_GROUPS="switch"
for GROUP in ${LIST_OF_GROUPS}
do
/usr/local/rancid/bin/rancid-health -r -g ${GROUP}
done
# Various Global Settings
#
TERM=vt100
export TERM
CVSROOT=/var/lib/rancid/cvsroot
export CVSROOT
HASHSIZE=65536
export HASHSIZE
BASEDIR=/var/lib/rancid
export BASEDIR
TMPDIR=${BASEDIR}/tmp
export TMPDIR
PATH=${PATH}:/usr/local/rancid/bin
export PATH
## Groups Users etc.
#
LIST_OF_GROUPS="switch"
LIST_OF_USERS="cisco guest"
PAR_COUNT=8
export LIST_OF_GROUPS LIST_OF_USERS PAR_COUNT
Replace the device group name switch and users cisco guest in the configuration with your desired values.
Press Esc key to exit insert mode, and then type :wq to save and exit the file.
Step 7: Create the RANCID Directories
Create the directory which will be used to store RANCID configuration files, logs, and repositories using the following command:
sudo mkdir /var/lib/rancid
sudo mkdir /var/lib/rancid/cvsroot
sudo chown -R rancid:rancid /var/lib/rancid
Step 8: Configure Cron Job for RANCID
Finally, we need to configure a cron job to automate the RANCID SNMP polling and configuration backups. Run the following command to edit the crontab file:
sudo crontab -e
Add the following lines at the end of the file:
# RANCID Backup Cron Job
0 0 * * * /usr/local/rancid/bin/rancid-run >/dev/null 2>&1
Save and exit the file by pressing Esc key followed by :wq command.
Conclusion
That's it! You have successfully installed RANCID on EndeavourOS Latest. You can now use RANCID to backup configuration files and manage network device configurations.