2
votes

I have an EC2 instance running in AWS. However when I tried to ping from my local computer, but the request always times out

Greatly appreciate any help

following is the instance description

Instance ID
i-0a94ae92b852256a9
Public DNS (IPv4)
ec2-3-15-2-190.us-east-2.compute.amazonaws.com
Instance state
running
IPv4 Public IP
3.15.2.190
Instance type
t2.xlarge
IPv6 IPs
-
Finding
Opt-in to AWS Compute Optimizer for recommendations. Learn more
Elastic IPs
Private DNS
ip-172-31-5-133.us-east-2.compute.internal
Availability zone
us-east-2a
Private IPs
172.31.5.133
Security groups
launch-wizard-1. view inbound rules. view outbound rules
Secondary private IPs
Scheduled events
No scheduled events
VPC ID
vpc-90caf4f8
AMI ID
Cannot load details for ami-0ca3e3965ada31684. You may not be permitted to view it.
Subnet ID
subnet-1a80a672
Platform details
-
Network interfaces
eth0
Usage operation
-
IAM role
-
Source/dest. check
True
Key pair name
Migite
T2/T3 Unlimited
Disabled
Owner
387291111076
EBS-optimized
False
Launch time
May 4, 2020 at 4:30:51 PM UTC+8 (18 hours)
Root device type
ebs
Termination protection
False
Root device
/dev/sda1
Lifecycle
normal
Block devices
/dev/sda1
Monitoring
basic
Elastic Graphics ID
-
Alarm status
None
Elastic Inference accelerator ID
-
Kernel ID
-
Capacity Reservation
-
RAM disk ID
-
Capacity Reservation Settings
Open
Outpost Arn
-
Placement group
-
Partition number
-
Virtualization
hvm
Reservation
r-01180bee9620140ae
AMI launch index
0
Tenancy
default
Host ID
-
Host resource group name
-
Affinity
-
State transition reason
-
State transition reason message
-
Stop - Hibernation behavior
Disabled
Number of vCPUs
1
What are the settings for security group of your instance?Marcin
While many people like to use Ping to test network connectivity, it's actually better to test the "real" thing you are trying to connect. For example, let's say you have a web server and you would like to test whether the web server (on port 80) is accessible. In this case, it is better to directly test port 80 because, if it works, you have no further work to do! If you instead use Ping, then you'll need to configure the Security Group to allow Ping. And, even if Ping works, it doesn't mean that port 80 will work. So, unless you're trying to debug a tricky configuration, Ping is best avoided.John Rotenstein

1 Answers

4
votes

By default AWS Elastic Compute Cloud (EC2) ports are protected by Application Layer firewall called Security Group (you specified this setting prior launching the Instance).

In the Security Group by default there are no default ingress ports open like icmp ports that respond to ping. Having said that you would like to check your EC2 Instance security group and look for InBound Rule "ICMP" port make sure that it's accepting traffic from your public IP address that initiate the ping.

Reference: