How to Ping IPv6 on Linux
A ping is a popular tool to troubleshoot the network connectivity issues within a remote system. You can use the ping command with a variety of protocols and networks. The network infrastructure and the internet primarily use IPv4 as the network layer. At the same time, the new generational IPv6 is becoming popular due to its immense power and compatibility.
You can use the ping command for both IPv4 and IPv6. Here, we look at specifically pinging ipv6. For this, follow these steps:
First, check whether your system supports IPv6.
When you run the previous command, you see the “default via” in the output which means that you have a gateway IP set for IPv6. If it is not in the output, your system does not support IPv6.
To successfully ping an IPv6 address, you must enable the IPv6 on the system. If it is not enabled and you are trying to ping for IPv6, it will give you a “ping: connect: network unreachable” error.
Now, verify if IPv6 is enabled or not using the following command:
If your output is similar to the previous output, it means that IPv6 support is not enabled. In this case, you have to enable it first.
Now, you can ping IPv6 with the ping command. Although this command works with IPv4 addresses by default, you can also use it for IPv6 addresses.
Condition 1: Ping IPv6 with the Domain Name
You can use the ping command with the domain name to ping the address. But by default, it gives you the IPv4 address. To ping the IPv6 address using the ping command through the domain name, use the “-6” option to force the IPv6 address:
ping -6 <domain_name> (for Arch Linux and Red Hat-based distros)
Or
ping6 <domain_name> (for Debian-based distros, including Ubuntu)
Condition 2: Ping IPv6 with IPv6 Address
If you don’t have a domain name or hostname, you can use the ping command with the IPv6 address as follows:
Or
ping6 <IPv6_address>
You can also ping the IPv6 address which is directly hosted by the server. For this, use the following command:
Or
ping -6 ipv6.google.com
Conclusion
We explained the methods to ping an IPv6 address on Linux. Many Linux systems have both IPv4 and IPv6 addresses. In this condition, it is essential to ping IPv6 for connectivity. You can also ping the IPv6 address which is hosted by Google. We hope that with the help of this guide, you can successfully ping the IPv6 addresses on your Linux device.