我有一个在AWS中运行的EC2实例。当我试图从我的本地盒子ping它是不可用的。
我如何能使实例pingable?
我有一个在AWS中运行的EC2实例。当我试图从我的本地盒子ping它是不可用的。
我如何能使实例pingable?
当前回答
当ping两个系统时,默认启用SSH(如果您通过putty或终端连接)。为了允许ping,我为每个实例(入站)添加了安全组。
其他回答
terrraform安全组的特定指令,因为-1对我来说不明显。
resource "aws_security_group" "Ping" {
vpc_id = "${aws_vpc.MyVPC.id}"
ingress {
from_port = -1
to_port = -1
protocol = "icmp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
}
我想提到一些ISP引起的罕见问题。我偶尔也会用BSNL。这是一个奇怪的问题,它占用了你日常生活中的几个小时。在这种情况下,人们可能会提出与ISP或更换ISP的问题。
Amazon实例可以从浏览器访问(所有开放端口) 控制台无法ping通 SSH / Telnet也不能正常使用。
当访问ec2实例中的新端口时。你要在两个地方相加。 1. 安全组入端口。 2. 防火墙设置入站规则。
1.Go to EC2 Dashboard and click "Running Instances" on "Security Groups"
2.select the group of your instance which you need to add security.
3.click on the "Inbound" tab
4.Click "Edit" Button (It will open an popup window)
5.click "Add Rule"
6.Select the "Custom ICMP rule - IPv4" as Type
7.Enter the "0.0.0.0/0" as Source or your public IP
7.点击“保存”
添加一个新的EC2安全组入站规则:
类型:自定义ICMP规则 协议:Echo Request 端口:N / A 来源:你的选择(我会选择任何地方,以便能够从任何机器ping)