[j-nsp] How to extract all routes?

Michael Lyngbøl michael at lyngbol.dk
Thu Mar 4 12:13:24 EST 2004


On 04.03.2004 07:35:53 +0000, John Kristoff wrote:
> On Thu, 4 Mar 2004 08:24:02 -0500
> Dave Curado <davec at weezel.net> wrote:
> 
> > I think to do it using tftp would require (as Pekka suggested)
> > starting a shell, and doing a multi-step. 
> 
> A twist to what others have already suggested is to pull the data
> rather than push it.  You could setup an account on the juniper using
> a SSH public key that does not require a password (protect the key!)
> and run commands from a remote cron job.  You could then do something
> like this from script on a management station:
> 
>   ssh user at juniper.example.com "show route | save ..."
>   scp user at juniper.example.com:[filename] .

Use the jlogin(1) script from RANCID <http://www.shrubbery.net/rancid/>
and then:

$ /usr/local/rancid/bin/jlogin -c "show route tabel inet.0" -p SECRET -u joe router.example.com | tee output.save

The above will login (telnet or ssh) to the router 'router.example.com'
as joe/SECRET and run the command 'show route tabel inet.0'.

If you're picky about security you can create a login user on
router.example.com, only able to execute allow commands.

/Michael

-- 
Michael Lyngbøl -- michael at lyngbol dot dk
Network Architect, AS3292 TDC, IP·backbone


More information about the juniper-nsp mailing list