Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol network.
Here is an example, I have an Linux EC2 Instance say, private IP is 10.10.10.10, public IP is 22.214.171.124.
Inside the instance, I could successfully ping its private IP(10.10.10.10) and localhost. However, I cannot ping its public IP(126.96.36.199).
Why can’t I ping an EC2 instance public IP from inside of instance itself? Whenever you are faced with this issue, apply the solution below by adding the following rule to the security group of the instance.
Simply added the EIP of the instance to allow echo reply and request to the Public IP