4

I am new in Linux. So, I am running dual boot Linux and Windows 11. All my OS is on the latest version. I try to ping google.com in Linux, but I get returned IPv6 instead of IPv4. Here is the ping result:

$ ping google.com
PING google.com(si-in-f100.1e100.net (2404:6800:4003:c04::64)) 56 data bytes
64 bytes from si-in-f100.1e100.net (2404:6800:4003:c04::64): icmp_seq=1 ttl=58 time=15.4 ms
64 bytes from si-in-f100.1e100.net (2404:6800:4003:c04::64): icmp_seq=2 ttl=107 time=15.2 ms
64 bytes from si-in-f100.1e100.net (2404:6800:4003:c04::64): icmp_seq=3 ttl=107 time=15.3 ms
64 bytes from si-in-f100.1e100.net (2404:6800:4003:c04::64): icmp_seq=4 ttl=58 time=15.1 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 15.147/15.242/15.356/0.075 ms

As you can see, I get IPv6 address. I expected I'll get IPv4. Maybe anyone could help me to ping IPv4. Thank you before :D

EDIT: It's already answered guys! Thank you so much by the way. Have a great day! :D

1 Answers1

5

To ping using IPv4, simply use the -4 option, e.g.

ping -4 google.com

The -4 option is used for many command line tools to force use of IPv4. To force use of IPv6, -6 can be used.

As you can see, I get IPv6 address. I expected I'll get IPv4.

I've yet to come across any pure IPv6 deployments in the wild. Almost all IPv6 deployments are dual stack with IPv4 and IPv6 connectivity.

vidarlo
  • 23,497