bcwhyte has asked for the wisdom of the Perl Monks concerning the following question:
I tried adding the following before all the commands and it still did not work. $cisco_session->cmd('login\nusername\npassword'); Any help would be appreciated.sub tftp_to_router { #connect a telnet session to the router my $cisco_session=Net::Telnet::Cisco->new(Host=>$router); #Login $cisco_session->login($username,$password); #Enable $cisco_session->enable($password); #ok we are in. Let's do our copy #tftp the file over #NONE OF THESE COMMANDS WORK BECAUSE AT THIS POINT, I AM #CONNECTED TO THE ROUTER, BUT NOT IN ENABLE MODE $cisco_session->cmd('copy tftp slot0'); $cisco_session->cmd('xxx.xxx.xxx.xxx'); $cisco_session->cmd('Source filename'); $cisco_session->cmd('Destination filename'); #Go to the directory on the router containing the startup-config file $cisco_session->cmd('cd slot0:'); #Erase it $cisco_session->cmd('erase startup-config'); #Copy the file we just tftp'd over to the startup-config $cisco_session->cmd('copy source startup-config'); #Copy that file to the slaveslot0: too $cisco_session->cmd('copy source slaveslot0:');
Thanks,
Brian Whyte
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::Telnet::Cisco Login Problem
by bobn (Chaplain) on Sep 12, 2003 at 13:34 UTC | |
|
Re: Net::Telnet::Cisco Login Problem
by skaba9 (Beadle) on Sep 12, 2003 at 14:43 UTC | |
by skaba9 (Beadle) on Sep 12, 2003 at 17:40 UTC |