Pinging network devices from a Linux system is a really common troubleshooting step for testing your internet connection or the connection to a particular device. If you’ve spent any time at all tinkering with computers and especially the Linux command line, you’re probably a little familiar with the
ping command already.
What you may not be so familiar with is IPv6 addresses. IPv6 is intended to replace the IPv4 network address standard – an ongoing process that’s been years in the making. And although IPv4 shows no sign of going away right now, IPv6 network addresses are becoming more prevalent.
In this guide, we’ll show you how to ping an IPv6 address from a Linux system. This is one of the most fundamental troubleshooting steps, and it’s changing a little as the new standard becomes widespread. Various Linux distributions may treat the addresses differently, so let’s take a look at how we can ping IPv6 addresses from some of the most popular distros.
In this tutorial you will learn:
- How to ping an IPv6 address on Linux
|Category||Requirements, Conventions or Software Version Used|
|System||Any Linux distro|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
Ping an IPv6 Address
First off, you need to have an IPv6 address on your own system in order to communicate (including ping) with other devices via IPv6. You can use our article on checking your local and public IP address to see yours. Chances are, though, that your ISP has indeed given you a public IPv6 address.
Many systems, like web servers, will run both IPv4 and IPv6 addresses. This can make testing a little more difficult, since we want to make sure that we’re pinging the IPv6 address and not IPv4. Google has made things convenient for us by hosting two servers
Obviously, then, the IPv6 server can be used for testing IPv6 connectivity between your system and theirs. Try the following
ping example from your own terminal:
$ ping ipv6.google.com PING ipv6.google.com(mia07s54-in-x0e.1e100.net (2607:f8b0:4008:80e::200e)) 56 data bytes 64 bytes from mia07s54-in-x0e.1e100.net (2607:f8b0:4008:80e::200e): icmp_seq=1 ttl=119 time=538 ms
You can also specify the full IPv6 address if you don’t have the hostname. Here are the results when we ping a test server that we’ve setup.
$ ping 2001:19f0:5:2ce9:5400:03ff:fe12:9809 PING 2001:19f0:5:2ce9:5400:03ff:fe12:9809(2001:19f0:5:2ce9:5400:3ff:fe12:9809) 56 data bytes 64 bytes from 2001:19f0:5:2ce9:5400:3ff:fe12:9809: icmp_seq=1 ttl=56 time=1293 ms
On the other hand, a ping to another hostname may result in IPv4 ping, assuming that the remote system and yours have an IPv4 address.
$ ping google.com PING google.com (184.108.40.206) 56(84) bytes of data. 64 bytes from lga15s46-in-f46.1e100.net (220.127.116.11)...
$ ping6 google.com
$ ping -6 google.com
In this guide, we learned how to ping an IPv6 network address from various Linux distributions. The tricky part is that many systems have both an IPv4 and IPv6 address, so it’s important to know how to force Linux to use IPv6 connectivity. The methods in this guide showed you two ways of doing that: one being to ping an IPv6-only server hosted by Google, and the other to use the
ping -6 commands from terminal.