Last updated: Feb 26, 2024
Reading time·2 min
To ping an AWS EC2 instance from your local machine:
Security
and open the security group in a new browser tab.Custom ICMP - IPv4
Echo Request
N/A
Anywhere-IPV4
The security group rule allows Ping requests to the EC2 instance from any IP address in the world.
Source
select My IP
. This will only enable you to ping the instance from your current IP address.Details
tab, copy the Public IPv4 DNS
address of your instance.ping
command to ping your EC2 instance from your local machine.ping YOUR_EC2_PUBLIC_DNS
By default, a security group denies all inbound access, so anytime you want to enable access to your EC2 instance, you have to edit its security group.
In our case, to allow inbound ping requests to the instance, we had to add a new inbound security group to allow ICMP traffic.
You can learn more about the related topics by checking out the following tutorials: