Cannot ping AWS EC2 instance
I have an EC2 instance running in AWS. When I try to ping from my local box it is not available.
How can I make the instance pingable?
Add a new EC2 security group inbound rule:
- Type: Custom ICMP rule
- Protocol: Echo Request
- Port: N/A
- Source: your choice (I would select Anywhere to be able to ping from any machine)
A few years late but hopefully this will help someone else...
1) First make sure the EC2 instance has a public IP. If has a Public DNS or Public IP address (circled below) then you should be good. This will be the address you ping.
2) Next make sure the Amazon network rules allow Echo Requests. Go to the Security Group for the EC2.
- right click, select inbound rules
- A: select Add Rule
- B: Select Custom ICMP Rule - IPv4
- C: Select Echo Request
- D: Select either Anywhere or My IP
- E: Select Save
3) Next, Windows firewall blocks inbound Echo requests by default. Allow Echo requests by creating a windows firewall exception...
- Go to Start and type Windows Firewall with Advanced Security
- Select inbound rules
4) Done! Hopefully you should now be able to ping your server.
You have to edit the Security Group to which your EC2 instance belongs and allow access (or alternatively create a new one and add the instance to it).
By default everything is denied. The exception you need to add to the Security Group depends on the service you need to make available to the internet.
If it is a webserver you will need to allow access to port 80
for 0.0.0.0/0
(which means any IP address).
To allow pinging the instance you need to enable ICMP traffic.
The AWS Web Console provides some of the most commonly used options in the relevant dropdown list.