AWS inbound rules not working for security group

Assuming Server A is trying to ping Server B and Server B's security group grants inbound access from Server A's security group...

You need to make sure Server A is pinging Server B via Server B's Private DNS Address (or Private IP Address) instead of Server B's public (or elastic) address.

According to the documentation:

Incoming traffic is allowed based on the private IP addresses of the instances that are associated with the source security group (and not the public IP or Elastic IP addresses).


If you select an instance from the Instances page on the EC2 Dashboard you can see the instance's public and private addresses.

enter image description here