in reply to Re^2: Net Telnet Cisco
in thread Net Telnet Cisco

You should "enable" yourself in order to download the config and issue "reload" command

Replies are listed 'Best First'.
Re^4: Net Telnet Cisco
by spickles (Scribe) on Jul 24, 2008 at 02:24 UTC
    karavelov - This is a walled-off garden test lab, so passwords and security for this are default. I have placed on the vty lines privilege level 15 - no need for "enable". I had tried the 'waitfor' with the pound sign, but if you read the docs on Net::Telnet::Cisco, that is a prompt that is already recognized, and default is 'always_waitfor_prompt'. So I don't see how these additions would work. My use of the 'sleep 20' is at the very least reliable and repeatable.

    Regards,
    Scott
Re^4: Net Telnet Cisco
by Anonymous Monk on Jul 18, 2012 at 16:25 UTC
    Hi all: http://search.cpan.org/~joshua/Net-Telnet-Cisco-1.10/Cisco.pm#Backup_via_TFTP
    my $backup_host = "tftpserver.somewhere.net"; my $device = "cisco.somewhere.net"; my $type = "router"; # or "switch"; my $ios_version = 12; my @out; if ($type eq "router") { if ($ios_version >= 12) { @out = $session->cmd("copy system:/running-config " . "tftp://$backup_host/$device-confg\n\n\n"); } elsif ($ios_version >= 11) { @out = $session->cmd("copy running-config tftp\n$backup_host +\n" . "$device-confg\n"); } elsif ($ios_version >= 10) { @out = $session->cmd("write net\n$backup_host\n$device-confg +\n\n"); } } elsif ($type eq "switch") { @out = $session->cmd("copy system:/running-config " . "tftp://$backup_host/$device-confg\n\n\n"); }
    Norman