Wednesday, April 6, 2022

[SOLVED] EC2 instances cannot ping each other

Issue

I have 2 EC2 Ubuntu instances. They are sharing same VPC, subnet and Security Group. Instances' firewall was turnoff. But I still can't ping each other by private IP. How to allow those instances ping each other?


Solution

In the security group, add "Custom ICMP" rule for "Echo Request" -- or -- "All ICMP Traffic" -- and as the source IP, instead of an address or block, add the security group's identifier, sg-xxxxxxxx.

Simply being in the same security group doesn't mean the instances can communicate among themselves. It only means they follow the same set of rules... but security group membership is a source attribute as well, on traffic originating from instances that are members of the group.

Hence, the above.



Answered By - Michael - sqlbot
Answer Checked By - Katrina (WPSolving Volunteer)