Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

IPv6 Supported Perl Modules

by sameerb (Initiate)
on Jul 01, 2010 at 02:21 UTC ( #847439=perlquestion: print w/replies, xml ) Need Help??
sameerb has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

Does Net::SSH2 , Net:SSH::Expect and Net::Telnet supports IPv6 ?

Thanks in advance

Replies are listed 'Best First'.
Re: IPv6 Supported Perl Modules
by salva (Abbot) on Jul 01, 2010 at 07:22 UTC
    I don't know about those you are asking, but Net::OpenSSH does support IPv6.
Re: IPv6 Supported Perl Modules
by sflitman (Hermit) on Jul 01, 2010 at 04:30 UTC
    The most instructive answer I can give you is--check CPAN:

    Net::SSH2 -- Net::SSH::Expect -- Net::Telnet

    The most direct answer is-- YES. Nearly every Net::* module is built on top of internal OS routines which can work with IPv4 or IPv6. This is especially true of any module which accepts a domain name for host, since then under the hood it will DNS resolve to IPv4 or IPv6 depending on the hardware and router. I believe that IPv6 is still rare, but it is obviously up and coming.
      Nearly every Net::* module is built on top of internal OS routines which can work with IPv4 or IPv6.

      I think that's worded slightly too optimistically. There are certainly some modules which don't work with IPv6.  See also State of IPv6.

      Note to the OP: instead of trying to get an authoritative theoretical answer, why not just try?  If a certain module doesn't work with IPv6, you'll usually realize rather soon.

Re: IPv6 Supported Perl Modules
by VinsWorldcom (Parson) on Oct 25, 2012 at 17:54 UTC

    Net::Telnet does support IPv6 - although not natively. By that, I mean, you can't do a:

    Net::Telnet-new(host => '');

    I've been corresponding with Jay Rogers - author of Net::Telnet - to add native IPv6 support. He gave me a brilliant workaround that is very easy and not at all kludgey as many workarounds go.

    Use the 'fhopen' argument of the new() constructor to take in an IPv6 connection (from say IO::Socket::IP). This is the example that works brilliantly for me:

    use IO::Socket::IP -register; use Net::Telnet; ... my $socket = IO::Socket::IP->new( PeerHost => $IPv4orv6Host, PeerPort => 23, Family => AF_INET # or AF_INET6 ) or die "not connected\n"; my $session = Net::Telnet->new( fhopen => $socket ); ...

    That will continue to work legacy is $IPv4orv6Host is an IPv4 host or hostname that resolves to an IPv4 address and will also support IPv6 hosts - since IO::Socket::IP can handle the IPv4/v6 address families. The Net::Telnet 'fhopen' argument simply operates on the open $socket handle.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://847439]
Approved by planetscape
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2018-04-23 04:13 GMT
Find Nodes?
    Voting Booth?