Why i can't ping to my AWS EC2 Instances ?

This short article delivers you an answer for one of the questions came to me from my blog users.

Why i can't ping to my newly created EC2 instance ? Did i miss something when creating ? Do i need to do anything to make it work ?

Yes. There's a way to make this as fix. This ping is disabled by default from the security group in AWS. Its under EC2 dashboard.

What is a security group ?

A security group is a virtual firewall for your instance. It controls the traffic that comes to your instance. You can allow or deny any kind of traffic which comes to the instance or going out from the instance. When creating the instance we can create our own security group or can be used the default security group and can change the type of traffic as your need by adding rules. Any change done to the security group will affect for it's instances at a glance.

So why i can't ping to my instances ?

It's because ping is blocked my default. We have to enable it. Normally we know what happens when we ping to a server. We send ICMP packets to the host and the destination sends back a reply. So, here we have to enable ICMP packets from the security group.

1) First go to the security group.

I have created a new security group and it's name is "my-security-group". Currently only ssh is enabled to my instance.

2) Add a new rule in Inbound

Select Custom ICMP Rule-IPv4

Select Echo Request

Select Anywhere or Your IP as the Source. Click save.


Now you should be able to ping to your EC2 instance.



Popular posts from this blog

Different types of users in linux

How to setup a wordpress website on AWS EC2 within few minutes