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?
terraform specific instructions for a security group because the -1 was not obvious to me.
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"]
}
}
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.
3) Next, Windows firewall blocks inbound Echo requests by default. Allow Echo requests by creating a windows firewall exception...
4) Done! Hopefully you should now be able to ping your server.
cidrIp: "0.0.0.0/0" ipProtocol: "icmp" toPort: -1 fromPort: 8
IpPermission
for the authorizeSecurityGroupIngress
endpoint. val PingPermission = { val range = IpRange.builder().cidrIp( "0.0.0.0/0" ).build() IpPermission.builder().ipProtocol( "icmp" ).ipRanges( range ).toPort( -1 ).fromPort( 8 ).build() }