Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 instances cannot ping each other

Tags:

amazon-ec2

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?

like image 295
user4344980 Avatar asked Sep 30 '15 10:09

user4344980


People also ask

Can 2 EC2 instances talk to each other?

We can place 2 instances in different network and then install a security rule. And, then assign a different IPs to the 2 EC2 instances. Both are able to talk with the internet.

Can you ping an EC2 instance?

The security group rule allows ping requests to the EC2 instance from any IP address in the world. If you want to scope down the IP addresses that are allowed to ping your EC2 instance, for Source select My IP . This will only enable you to ping the instance from your current IP address.

Does AWS block ping?

AWS security groups block ICMP (including ping, traceroute, etc.) by default. You need to explicitly enable it.


1 Answers

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.

like image 107
Michael - sqlbot Avatar answered Sep 22 '22 08:09

Michael - sqlbot