【问题标题】:Unable ping AWS EC2 instance无法 ping AWS EC2 实例
【发布时间】:2020-08-19 14:59:59
【问题描述】:

我有一个在 AWS 中运行的 EC2 实例。但是,当我尝试从本地计算机 ping 时,请求总是超时

非常感谢任何帮助

以下是实例说明

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

【问题讨论】:

  • 您的实例的安全组设置是什么?
  • 虽然很多人喜欢使用 Ping 来测试网络连接,但实际上最好测试您尝试连接的“真实”事物。例如,假设您有一个 Web 服务器,并且您想测试该 Web 服务器(在端口 80 上)是否可访问。在这种情况下,最好直接测试 80 端口,因为如果它有效,您就没有更多工作要做了!如果您改为使用 Ping,则需要将安全组配置为允许 Ping。而且,即使 Ping 可以正常工作,也不意味着 80 端口可以正常工作。因此,除非您尝试调试棘手的配置,否则最好避免使用 Ping。

标签: amazon-web-services amazon-ec2


【解决方案1】:

默认情况下,AWS 弹性计算云 (EC2) 端口受称为安全组的应用层防火墙保护(您在启动实例之前指定了此设置)。

默认情况下,在安全组中,没有像响应 ping 的 icmp 端口那样打开默认入口端口。话虽如此,您想检查您的 EC2 实例安全组并查找入站规则“ICMP”端口,确保它正在接受来自您的公共 IP 地址的流量来启动 ping。

Reference:

【讨论】:

  • 此外,默认情况下,所有协议/端口组合都被隐式阻止以保护。
猜你喜欢
  • 1970-01-01
  • 2017-06-23
  • 2020-07-09
  • 1970-01-01
  • 1970-01-01
  • 2023-02-23
  • 2019-09-04
  • 2022-01-18
  • 1970-01-01
相关资源
最近更新 更多