Ping IPv6 IP Address With ping6 Command

I‘m unable to ping an IPv6 address. I’m getting error:

ADVERTISEMENTS

ping 2001:db8::1428:57ab
ping: unknown host 2001:db8::1428:57ab

My network and Linux based operating system is configured for IPv6 IP address. How do I ping an IPv6 address on Linux?

Tutorial details
Difficulty Easy (rss)
Root privileges No
Requirements ping6
Time Less than a minute
Regular ping command only works with IPv4 address. Use ping6 command to send ICMPv6 ECHO_REQUEST packets to network hosts from a host or gateway. This command uses the ICMPv6 protocol’s mandatory ICMP6_ECHO_REQUEST datagram to elicit an ICMP6_ECHO_REPLY from a host or gateway. ICMP6_ECHO_REQUEST datagrams (pings) have an IPv6 header, and ICMPv6 header formatted as documented in RFC2463. The ping6 command available on Linux, BSD, Apple OS X and other Unix-like operating systems. MS-Widows user can use ping -6 command as described here.

ping to IPv6 host example

Type the command as follows:
$ ping6 localhost
$ ping6 host.domain.com
$ ping6 IPv6-address
$ ping6 2001:4860:b002::68

The best way is to ping global website such as ipv6.google.com, enter:
$ ping6 ipv6.google.com
Sample outputs:

ping6 ipv6.google.com
PING ipv6.google.com(2001:4860:b002::68) 56 data bytes
64 bytes from 2001:4860:b002::68: icmp_seq=0 ttl=59 time=58.4 ms
64 bytes from 2001:4860:b002::68: icmp_seq=1 ttl=59 time=56.4 ms
64 bytes from 2001:4860:b002::68: icmp_seq=2 ttl=59 time=62.1 ms
64 bytes from 2001:4860:b002::68: icmp_seq=3 ttl=59 time=56.8 ms
64 bytes from 2001:4860:b002::68: icmp_seq=4 ttl=59 time=56.5 ms
64 bytes from 2001:4860:b002::68: icmp_seq=5 ttl=59 time=59.5 ms

--- ipv6.google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5002ms
rtt min/avg/max/mdev = 56.443/58.329/62.150/2.045 ms, pipe 2

ping by an IPv6 IP address

First, use the host command to find out IPv6 address for www.cyberciti.biz, type:
$ host -t AAAA www.cyberciti.biz
Sample outputs:

www.cyberciti.biz has IPv6 address 2607:f0d0:1002:51::4

Type the following command:
$ ping6 2607:f0d0:1002:51::4
Sample outputs:

PING 2607:f0d0:1002:51::4(2607:f0d0:1002:51::4) 56 data bytes
64 bytes from 2607:f0d0:1002:51::4: icmp_seq=1 ttl=64 time=0.056 ms
64 bytes from 2607:f0d0:1002:51::4: icmp_seq=2 ttl=64 time=0.027 ms
64 bytes from 2607:f0d0:1002:51::4: icmp_seq=3 ttl=64 time=0.021 ms
64 bytes from 2607:f0d0:1002:51::4: icmp_seq=4 ttl=64 time=0.023 ms
^C
--- 2607:f0d0:1002:51::4 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3831ms
rtt min/avg/max/mdev = 0.021/0.031/0.056/0.015 ms

One more example:
$ host -t AAAA www.google.com
$ ping6 -c 4 2607:f8b0:4000:805::1010

Sample outputs:

Fig.01: ping6 command in action

Fig.01: ping6 command in action

How do I confirm that IPv6 is configured or working on my Linux based system?

Type the following commands (see How To Test Linux Operating System for IPv6 Networking Support for more info):

[ -f /proc/net/if_inet6 ] && echo 'IPv6 ready system!' || echo 'No IPv6 support found! Compile the kernel!!'

And

lsmod | grep -qw ipv6 && echo "IPv6 kernel driver loaded and configured." || echo "IPv6 not configured and/or driver loaded on the system."

Sample outputs:

Fig.02: Verifying Linux IPv6 support.

Fig.02: Verifying Linux IPv6 support.

A note about MS-Windows XP/7/8/server users

You can test an IPv6 connection by using the ping command. At a command prompt, type:
ping -6 www.cyberciti.biz
ping -6 2607:f0d0:1002:51::4

References

Read ping6 man page for more information:
$ man 8 ping6

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
16 comments… add one
  • dalia Jul 19, 2008 @ 12:49

    ping ipv6 between windows and linux

  • dalia Jul 19, 2008 @ 13:11

    ping ipv6 in windows

  • Sandi Apr 9, 2010 @ 19:33

    Try pinging the loopback 127.0.0.1 and see what you get.

  • Sandi Apr 9, 2010 @ 19:34

    or try ::1 which is correct for IPv6.

  • Brian May 26, 2010 @ 18:38

    I couldn’t get PING6 to work… but noticed that PING uses PING -6 #### to work…

    • barwnikk May 1, 2015 @ 14:23

      ping6 is for linux, ping -6 is for windows

  • sohbet May 9, 2011 @ 20:54

    Good and many many thanks buddy really nice great post and keep up the good work

  • Calle Jun 14, 2011 @ 20:20

    On Windoze you will use ‘PING -6’, on -NIX you will use ‘PING6’.

  • Antonello Jun 6, 2012 @ 9:15

    I got:
    $ ping6 ipv6.google.com
    connect: Network is unreachable

    Does it means my network didn’t give me an ipv6 address?
    On http://ipv6test.google.com/ I got:

    “No problems detected.
    You don’t have IPv6, but you shouldn’t have problems on websites that add IPv6 support.”

    • Hans Jun 12, 2013 @ 9:47

      Note the word ‘add’ in this misleading answer. It says, that your software is ready, but your ISP is not. But your computer will know how to ask for the IPv4-version of the site.

      • Antonello Jun 12, 2013 @ 11:36

        thank you .. by now I already changed ISP.. but I admit nothing to do with IPv6.. not yet on top of my priorities ;-)

  • jeremy wentworth Jul 25, 2013 @ 12:32

    On a mac, if you get “ping6: UDP connect: No route to host”
    Then, add your interface as an argument “ping6 -I en2 fe80::aa……..”

  • fadhil Feb 2, 2015 @ 10:39

    good share.. thanks

  • Cristiane Apr 30, 2015 @ 20:06

    How can I configure my IPv6 address on the file: /etc/sysconfig/network/ifcfg-lo on openSuse 13.2?

    I tryed:
    IPADDR_0=’2804:CC4::4/128′
    IPADDR_0=’IPV6′

    but it´s not working.
    When I add the address by command: ip -6 address add 2804:CC4::4/128 dev lo
    It works.

    Could ypu help me?

  • ukkir May 25, 2016 @ 17:42

    i ll try it.

  • benjamin Dec 20, 2016 @ 6:56

    I cannot ping without mentioning the interface

    $ ping6 fe80::20c:29ff:fe4e:691c
    connect: Invalid argument

    $ ping6 fe80::20c:29ff:fe4e:691c%eth1
    PING fe80::20c:29ff:fe4e:691c%eth1(fe80::20c:29ff:fe4e:691c) 56 data bytes
    64 bytes from fe80::20c:29ff:fe4e:691c: icmp_seq=1 ttl=64 time=0.031 ms
    64 bytes from fe80::20c:29ff:fe4e:691c: icmp_seq=2 ttl=64 time=0.036 ms

    Perhaps you have a single interface in your box?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.