Script(s) to administer my routers and switches.

polm

Diamond Member
May 24, 2001
3,183
0
0
I manage many many Cisco and Nortel routers and switches. We limit inbound access to the devices to telnet from a specific subnet.

The allowed subnet hosts a couple SSH servers. We SSH into one of these servers and from there we can telnet into the routers and switches.

I would like to create a script/prog that will allow me to run batch jobs (show, config, etc.) against any/all of my devices. The job would have to SSH first then kick of the telnet job(s).

I'm thinking Perl (Net::SSH, Net::Telnet, etc.).

Any suggestions?
 

polm

Diamond Member
May 24, 2001
3,183
0
0
Originally posted by: Nothinman
Perl's what I would use.

That's what I was thinking. Any experience with this Nothinman? Could you offer any code examples to help me get started?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Nothing handy, I usually find the examples in the man pages and cpan.perl.org to be enough to get me started.
 

polm

Diamond Member
May 24, 2001
3,183
0
0
Originally posted by: Nothinman
Nothing handy, I usually find the examples in the man pages and cpan.perl.org to be enough to get me started.

Yeah...i'm OK with the Net::Telnet directly from my script to the device. It's the damn SSH middle-man i have to contend with that's making things tricky.
 

polm

Diamond Member
May 24, 2001
3,183
0
0
Originally posted by: Nothinman
SSH middle-man?

We limit remote access to the routers/switches using an ACL that alloows inbound access from a single subnet.

That subnet hosts a few SSH servers. To admin a device I must SSH into one of these servers, then I can telnet from there into the router/switch I need to administer.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Ah, yea that's a little strange. If the SSH server is a normal unix box you might want to put the perl telnet scripts on them and just run those via SSH.
 

polm

Diamond Member
May 24, 2001
3,183
0
0
Originally posted by: Nothinman
Ah, yea that's a little strange. If the SSH server is a normal unix box you might want to put the perl telnet scripts on them and just run those via SSH.

Sorry to say they are not. Just simple 2600 routers running SSH services.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yea, that does complicate things. If you have an sshd on your local box you could try to use SSH's port forwarding and then telnet to the local port that SSH opens to the destination telnet port.