Hello All,

I am attempting to use Net::Telnet::Cisco to connect to my router and then from there connect to port 25 on a mail server. However, I am running into strange issues with it. The error is:

command timed-out at ciscomailtester.pl

#!/usr/bin/perl use strict; use Net::Telnet::Cisco; my ($router, $mail, $line, $routeruser, $routerpass); $router = "1.1.1.1"; $routeruser="user"; $routerpass="pass"; $mail = Net::Telnet::Cisco->new(Host => "$router"); $mail->login("$routeruser", "$routerpass"); $mail->cmd('telnet 2.2.2.2 25'); $mail->close;
Please keep in mind I can run all other router commands and get the results I would expect, but when telneting out using the cmd() it gives the time out error. Note: The command does work if I do exactly what the script is doing.. i.e. telnet to my router login with the user and pass and then telnet to my mail server via the identical command. So this leads me to believe the problems lie's within Net::Telnet::Cisco. I also tried putting the command inside $mail->print('telnet 2.2.2.2 25');, however I did not have any luck this route either. Please let me know if you have any ideas.

Thanks,
YpCat

In reply to Net Telnet Cisco Complications by ypcat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.