Telnet to cisco

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I need to write a telnet client through which I will connect to cisco
(router/switch) but it must be as much similar to normal telnet client
as possible - right now I wrote very simple telnet client but it doesn't
  work like I want e.g. when I send command "show ip bgp" which shows
whole bgp table normal telnet wait for space to show next page of
prefixes but my script doesn't work in this place
I need to use this script like a normal telnet client - is it possible?

Reason: I need to format some data which is send to console

This is the code which I found:
use IO::Socket;
$remote = IO::Socket::INET->new(
                         Proto   =>      "tcp",
                         PeerAddr=>      "remote-ip",
                         PeerPort=>      "23",
                 ) or die "cannot connect to remote-ip";

print STDERR "[Connected to $host:$port]\n";
die "can't fork: $!" unless defined($kidpid = fork());
if ($kidpid) {
         while (defined ($line = <$remote>)) {
             print STDOUT $line;
         kill("TERM", $kidpid);                  # send SIGTERM to child
     else {
         while (defined ($line = <STDIN>)) {
             print $remote $line;


Re: Telnet to cisco

On Mon, 21 Feb 2011 13:01:53 +0100, Bogus wrote:

Quoted text here. Click to load it

Use clogin from the rancid package, much easier.


Re: Telnet to cisco

On 2/21/2011 7:01 AM, Bogus wrote:
Quoted text here. Click to load it


Re: Telnet to cisco

W dniu 2011-02-21 13:01, Bogus pisze:
Quoted text here. Click to load it


I finally found what I was looking for:

this works just like normal telnet client without expect (I don't need
it) - after adding Term::ANSIColor I have what I want :)

Thanks to Martijn and John for their propositions

Site Timeline