Probably you were surprised when you tried to ping your server with the IPv4 Public IP with a command like:
# Ping a domain related to your server ping www.myserver.com # Or ping the IP ping 123.45.67
The request will always fail, although everything is working in order with your server. In this article, we'll explain why does this happens and how to allow the execution of ping to your aws EC2 instance.
Allow ICMP inbound traffic
To solve this issue, you will need to allow specifically the Echo Request and Echo Reply protocol in the ICMP inbound traffic of your EC2 instances. This can be done accesing the NETWORK & SECURITY menu in the left panel of AWS, then Security Groups and selecting the group that belongs to the instance with the issue. From the list select the group and edit Inbound Rules, this will display a dialog with all the rules of traffic of your server:
In this dialog you need to add 2 new Custom ICMP (IPv4 or IPv6 according to your needs) and choose the Echo Reply and Echo Request protocols for every item. Finally save the changes and you will be able now to ping your server or domains associated to your IP.
Happy networking !