Introduction

I wanted to add my Vyatta virtual router to my RANCID server as I was in the process of extensive testing for IPv6. Luckily I found this little gem and thanks to those who created the scripts:

https://github.com/natecarlson/vyatta-rancid

Now Nate’s post is pretty clear but there were some issues I ran into along the way as his post is for RANCID version 2.3.x whereas I am now using RANCID 3.2.

Resolution

Now I will assume you have put the scripts in the correct /bin directory as specified by Nate.

First off we need to set the permissions on those files. Now these commands need to be run as root or sudo and if you want to understand what is happening, go read this page by firewall.cx or the man pages.

#chown rancid:netadm /usr/local/rancid/bin/vlogin
#chown rancid:netadm /usr/local/rancid/bin/vrancid
#chmod 755 /usr/local/rancid/bin/vrancid
#chmod 755 /usr/local/rancid/bin/vlogin

These commands make those files executable and owned by the rancid user. The next step is to create and modify a required file as specified in the RANCID README file for this version. You need to create and modify the following file:

#touch /usr/local/rancid/etc/rancid.types.conf
#vim /usr/local/rancid/etc/rancid.types.conf

This file contains the info for your custom device and point to those scripts. You just need to add the following lines.

vyos;script;vrancid
vyos;login;vlogin

Pretty easy, you can check permissions and make them the same as the other files in that directory. At this point what you need to do is add credentials/certificates to the .cloginrc file in the home directory and test login. Once this is confirmed working as required then we need to follow the normal process of adding the device to the router.db for your group, mine is as so:

vyatta;vyos;up

Now in my case vyatta is the DNS name of my vyatta router but in your case it will be different or you may just use it’s IP, your call. I would suggest either using DNS or hosts file on the RANCID server.

Now you can test running the script for you group/groups.

Happy? Now one last issue I had to fix. I was getting uptime which meant every hour I was getting a config change! Yes very annoying. This relates to two posts I have made about this issue:

https://ip-life.net/rancid-3-x-supress-output-from-diffs/

https://ip-life.net/rancid-suppress-output-from-diffs/

Now in the case of the vyatta/vyos router it needs a change of the vrancid script:

#vim /usr/local/rancid/bin/vrancid

do a search for commandtable

/commandtable

and find this section:

# Main
 @commandtable = (
  {'show version' => 'ShowConfiguration'},
  {'show configuration' => 'ShowConfiguration'},
  {'show configuration commands' => 'ShowConfiguration'},
 );

All that’s needed is to delete the bold line completely from the file which will stop the command being run on the vyatta/vyos box.

Lovely stuff.

 

 

 

 

RANCID Scripts for VyOS/Vyatta
Tagged on:                 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.