in reply to Net::Telnet::Cisco Login Problem

This is a sloppy way of doing it, but it will work. I used this for Net::Telnet, but it should work for Net::Telnet::Cisco if it doesn't give Net::Telnet a try.

$session->waitfor('/password:/'); #change to what the cisco prompts $session->print("password"); $session->waitfor('/router>/'); #change to "hostname"> $session->print("login"); $session->waitfor('/username:/'); $session->print("user"); #change to username $session->waitfor('/password:/'); $session->print("pass"); #change to password $session->waitfor('/router#/'); #change to "hostname"> or # $session->print("enablepass"); #change to enable password $session->waitfor('/router#/'); #change to "hostname"# #you shouldn't have to enable if your user has high enough privilege.
Good luck
sk

Replies are listed 'Best First'.
Re: Re: Net::Telnet::Cisco Login Problem
by skaba9 (Beadle) on Sep 12, 2003 at 17:40 UTC
    I tested this out and it can be done a lot easier.

    $ok = $obj->print($firstpass); $ok = $obj->login($username, $password); $ok = $obj->enable($enablepass);
    I should have tested it first before posting.

    sk

    -- update - corrected typo