How to view IPv6 IP address and ping it on Linux ?
Let us have a look how to view IPv6 addresses in Linux.
For this, we can use the same “ifconfig” command.
1. Viewing IPv6 Address
[root@ngelinux ]# ifconfig -a enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255 inet6 fe80::4ebb:d12f:c486:4700 prefixlen 64 scopeid 0x20 ether 08:00:27:fa:bc:09 txqueuelen 1000 (Ethernet) RX packets 110 bytes 9748 (9.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 283 bytes 24771 (24.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2. Ping IPv6 Address
We can use “ping6” command in Terminal to ping an IPV6 address in Linux.
Let us have a look at the command example.
[root@ngelinux ]# ping6 -c 4 -I enp0s3 fe80::4ebb:d12f:c486:4700 PING fe80::4ebb:d12f:c486:4700(fe80::4ebb:d12f:c486:4700) from fe80::4ebb:d12f:c486:4700%enp0s3 enp0s3: 56 data bytes 64 bytes from fe80::4ebb:d12f:c486:4700%enp0s3: icmp_seq=1 ttl=64 time=0.053 ms 64 bytes from fe80::4ebb:d12f:c486:4700%enp0s3: icmp_seq=2 ttl=64 time=0.058 ms 64 bytes from fe80::4ebb:d12f:c486:4700%enp0s3: icmp_seq=3 ttl=64 time=0.079 ms 64 bytes from fe80::4ebb:d12f:c486:4700%enp0s3: icmp_seq=4 ttl=64 time=0.060 ms --- fe80::4ebb:d12f:c486:4700 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3000ms rtt min/avg/max/mdev = 0.053/0.062/0.079/0.012 ms [root@ngelinux ]#
3. Tracing path of IPv6 address.
tracepath6 command can be used for this scenario.
[root@ngelinux ]# tracepath6 fe80::4ebb:d12f:c486:4700 1?: [LOCALHOST] 0.015ms pmtu 65536 1: ngelinux 0.075ms reached 1: ngelinux 0.078ms reached Resume: pmtu 65536 hops 1 back 1 [root@ngelinux ]#
If you observed, most of the IPv6 commands are same as of IPv4 commands with a suffix of “6”.