in reply to IPV6 ping code not working

my $ping = Net::Ping->new('icmpv6', 'ipv6');

That is not a valid call to the constructor:

$ perl -MNet::Ping -e 'my $ping = Net::Ping->new(q/icmpv6/, q/ipv6/);' Protocol for ping must be "icmp", "udp", "tcp", "syn", "stream", or "e +xternal" at -e line 1.

at least not in version 2.43 which is what I have installed here.

Replies are listed 'Best First'.
Re^2: IPV6 ping code not working
by amanjal (Novice) on Nov 30, 2017 at 15:18 UTC
    Following code with 2.63
    IPV4 ping # perl -MNet::Ping -e 'my $ping = Net::Ping->new(q/icmp/, 10,q//,q//,q +//,q//,q/ipv4/);print("ping successfull") if $ping->ping(q/Virt-titan +-17/)' ping successfull IPV6 ping perl -MNet::Ping -e 'my $ping = Net::Ping->new(q/icmpv6/, 10,q//,q//,q +//,q//,q/ipv6/);print("ping successfull") if $ping->ping(q/Virt-titan +-17/)' ' virt-titan-17:~ #

      Looks like there is a bug report open for this. Check the latest comment (6th Aug 2017) which also includes a proposed patch that you might like to test.

        Thank you, patch seems to be working right now, appreciate your help.

      Does the hostname virt-titan-17 actually resolve to a v6 address?

      In other words, can you successfully ping6 virt-titan-17 successfully?

        yes it does.
        virt-titan-29:~ # ping6 Virt-titan-17 PING Virt-titan-17(virt-titan-17) 56 data bytes 64 bytes from virt-titan-17: icmp_seq=1 ttl=0 time=0.217 ms 64 bytes from virt-titan-17: icmp_seq=2 ttl=0 time=0.205 ms 64 bytes from virt-titan-17: icmp_seq=3 ttl=0 time=0.221 ms 64 bytes from virt-titan-17: icmp_seq=4 ttl=0 time=0.234 ms 64 bytes from virt-titan-17: icmp_seq=5 ttl=0 time=0.214 ms