casdr / rancid-cisco-sb

rancid-cisco-sb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Cisco Small Business in RANCID

Travis CI

Unmaintained. This repository is read-only. I can't continue evolving the script because I don't work with Cisco Small Business switches anymore. You are free to clone this repo and continue evolving it.

Introduction

I like using RANCID to manage a backup of all the network devices of a network: switches, routers, firewalls,... However, RANCID lacks of "official" support for Cisco SG300 series switches. These switches form part of Cisco's Small Business serie and although they are not based on Cisco IOS, they are provided with a CLI with some similar commands to Cisco IOS's ones.

By Googling I found how to backup a Cisco SRW2008P switch with RANCID. I have modified those files to support not only a SRW switch but also a SG300 switch.

These files add support to RANCID in order to backup Cisco Small Business switches that comes with an tenel/SSH CLI:

  • SRW series switches
  • SG series switches
  • SFE series switches

Caution! Not all switch models of the previous series comes with an telnet/SSH CLI and so they cannot be backed up with RANCID (see Issue #12).

Installation

For RANCID 2.x

  • Download src/csblogin and src/csbrancid files and put them in the RANCID's PATH (in my case, /opt/rancid/bin).
    • Give them execution permissions (a+rx).
    • Verify that shebangs are pointing to correct perl and expect executables.
  • Edit rancid-fe file located in the RANCID's PATH (in my case, /opt/rancid/bin/rancid-fe) and insert a new item in the %vendortable dictionary:
'cisco-sb'        => 'csbrancid',

For RANCID 3.x

  • Download src/csblogin and src/csbrancid files and put them in the RANCID's PATH (in my case, /opt/rancid/bin).
    • Give them execution permissions (a+rx).
    • Verify that shebangs are pointing to correct perl and expect executables.
  • In the configuration directory of RANCID (in my case, /opt/rancid/etc), add the following lines to the rancid.types.conf file (create it if necessary):
cisco-sb;script;csbrancid
cisco-sb;login;csblogin

Usage

  • Insert the device to backup in the router.db file:
test.example.com:cisco-sb:up:
  • Modify your .cloginrc file:
add user test.example.com	    {user}
add password test.example.com	    {password}
add autoenable test.example.com	    1
add method test.example.com	    ssh
#add method test.example.com	    ssh:2222	# SSH port TCP/2222
#add method test.example.com	    telnet	# For telnet default TCP port
#add method test.example.com	    telnet:2323	# For telnet port TCP/2323
add userprompt test.example.com	    {"User Name:"}
  • Enjoy it!

Christian Pinedo

About

rancid-cisco-sb


Languages

Language:Perl 100.0%