ping command doesn't work correctly after upgrade to 8-stream

Issues related to configuring your network
Post Reply
sorem
Posts: 2
Joined: 2022/01/21 12:52:10

ping command doesn't work correctly after upgrade to 8-stream

Post by sorem » 2022/01/21 14:24:13

hello,
I've upgraded my centos 8 test server (running on virtualbox 6.1.30 r148432 @ windows 10 host) to centos 8 stream and after the upgrade I can't ping any ip address neither local nor public.

Code: Select all

ping google.com
returns:
ping: socket: Address family not supported by protocol

Code: Select all

sudo ping -4 google.com
works fine:
PING google.com (142.250.185.142) 56(84) bytes of data.
64 bytes from fra16s50-in-f14.1e100.net (142.250.185.142): icmp_seq=1 ttl=56 time=16.10 ms
trying to go deeper, I've realized that there is a lot of errors in /var/log/messages regarding ipv6 from network manager:
]Jan 21 13:21:23 hostname NetworkManager[855]: <warn> [1642767683.7917] platform-linux: do-add-ip6-address[2: fe80::7ed7:ca1c:fa28:2338]: failure 95 (Operation not supported)
Jan 21 13:21:25 hostname NetworkManager[855]: <warn> [1642767685.7957] ipv6ll[d553e5beb18ea215,ifindex=2]: changed: no IPv6 link local address to retry after Duplicate Address Detection failures (back off)
this is also mentioned here - https://www.linode.com/community/questi ... s-8-stream

these were successfuly eliminated by disabling ipv6 in nmcli

Code: Select all

sudo nmcli con modify Wired\ connection\ 1 ipv6.method "disabled"
but it doesn't get ping working anyway.

kernel runs with ipv6.disable=1 option (even before upgrade), output of

Code: Select all

ip a | grep inet6
is empty, kernel version is:
Linux hostname 4.18.0-358.el8.x86_64 #1 SMP Mon Jan 10 13:11:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
anything else works fine including ssh, dnf, dig, etc.

anyone met this as well?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ping command doesn't work correctly after upgrade to 8-stream

Post by TrevorH » 2022/01/21 14:53:02

It's a known bug in Stream 8 due to the iputils maintainer pushing an updated iputils package that requires an unpublished systemd update. They removed the CAP_NET_ADMIN flag from the ping executable and the alternative method of allowing it to work is not yet out.

The fix (other than waiting for them to push the package with the actual fix in it) is to set a sysctl like so

Code: Select all

net.ipv4.ping_group_range = 0 2147483647
If you set that using the sysctl command then I suspect it wants quotes round the data but if it's done from a file in /etc/sysctls.d then it should work as-is.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

sorem
Posts: 2
Joined: 2022/01/21 12:52:10

Re: ping command doesn't work correctly after upgrade to 8-stream

Post by sorem » 2022/01/21 15:18:23

many thanks for explanation, TrevorH!

now ping works as it should.

the solution is:

1/ create the file in /etc/sysctl.d/:

Code: Select all

sudo vim /etc/sysctl.d/70-ping.conf
2/ add:

Code: Select all

net.ipv4.ping_group_range = 0 2147483647
into it.

3/ reload sysctl by:

Code: Select all

sudo sysctl --load /etc/sysctl.d/70-ping.conf
4/ check if ping works:

Code: Select all

ping google.com
have a nice day!

Post Reply