[c-nsp] modify cisco router config with scripting?

chip chip.gwyn at gmail.com
Thu Jun 16 11:26:28 EDT 2011


One way we've done things like this is to generate all the config
changes required and throw it in a plain text file.  Then you use
another script to log into the router and copy the file up to the
router via tftp.  This allows you to make almost any kind of changes
you need while only having to automate the tftp part on the router.
You can get fancy with the "copying up" part depending on your level
of paranoia, check interfaces, check routing protocol sessions, etc...
and compare before/after to make sure nothing unexpected happens.
Then you can take this a step further and compare the config
before/after to make sure the changes that happened were the changes
you expected.  But as with anything, the more functionality you add
the more complicated it gets.

For easy-mode, as others have suggested, use rancid's clogin to tftp
the file up and "wr mem".

--chip

On Thu, Jun 16, 2011 at 10:56 AM, d tbsky <tbskyd at gmail.com> wrote:
> Hi:
>    thanks for all the information about the scripting problem.
> I find now basically there are two kind of method to do the work.
>
> 1.interactive CLI, with 3rd party tools or expect-like perl modules.
>
> 2. snmpset. but it can not be done directly, snmpset just trigger the
> tftp procedure.
>
> I think I may use perl-expect to do this job. it is ugly but seems simple.
>
>   thanks again for all the suggestion!!
>
> Regards,
> tbskyd
> _______________________________________________
> cisco-nsp mailing list  cisco-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/
>



-- 
Just my $.02, your mileage may vary,  batteries not included, etc....



More information about the cisco-nsp mailing list