It is possible that the firewall on CentOS is blocking the ICMP Ping requests.
To check if there is a rule in place, you can run (as sudo) iptables -L
You want to look at the chain labeled INPUT and see what policy is set. If it is set to DENY, then unless there is a rule specifically allowing ping requests, it will get dropped.
To quickly disable the firewall to check if this is the issue, you can run (as sudo) iptables -P INPUT ACCEPT
. But be warned, this will allow everything in without an explicit rule denying it. You can set the policy back to drop after troubleshooting iptables -P INPUT DROP
.
To allow ping to be responded to, you will need to add a new rule such as described here: https://www.cyberciti.biz/tips/linux-iptables-9-allow-icmp-ping.html
But these changes will exist only until next reboot unless you have a method for maintaining persistent iptables rules across reboots.