Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access/ping a server located on AWS?

With what address should a server located on AWS be accessed?

I've created an AWS instance and installed a web server on it. However the server is not reachable via any of the:

  1. ec2-174-129-24-92.compute-1.amazonaws.com
  2. the IP address from instance's ifconfig
  3. an elastic IP address I've created on the AWS dashboard and associated with the instance

Surprisingly, ssh with [email protected] works fine.

What might be the problem and how to bind an address to the instance?

like image 651
Alex Avatar asked Sep 23 '09 10:09

Alex


People also ask

How do I find my AWS server?

To view server detailsOpen the AWS Transfer Family console at https://console.aws.amazon.com/transfer/ . In the navigation pane, choose Servers. Choose the identifier in the Server ID column to see the Server details page, shown following. You can change the server's properties on this page by choosing Edit.


4 Answers

In your security group open -1 to -1 on ICMP for range 0.0.0.0/0 and you'll be able to ping.

See my screenshot for a better view:

AWS Console Image

Image posted by @emostar below

like image 192
nowthatsamatt Avatar answered Oct 11 '22 03:10

nowthatsamatt


Updated for 2014 - the current Amazon UI no longer uses numbers for ICMP types, so the existing answer doesn't work anymore.

In your security group:

  • Click the inbound tab
  • Create a custom ICMP rule
  • Select echo request
  • Use range 0.0.0.0/0 for everyone or lock it down to specific IPs
  • Apply the changes

and you'll be able to ping.

AWS Console Image

like image 36
mikemaccana Avatar answered Oct 11 '22 04:10

mikemaccana


As nowthatsamatt said, you want to allow ICMP from all addreses.

To do this on the command line you can run:

ec2-authorize <group> -P icmp -t -1:-1 -s 0.0.0.0/0

Or if you prefer the AWS Console, this is what it would look like (current as of 2012-09-19):

AWS Console Image

like image 23
staackuser2 Avatar answered Oct 11 '22 04:10

staackuser2


Ping doesn't work with EC2 because ping runs over the ICMP protocol which is blocked in a typical EC2 security group configuration.

Here's a very nifty way to work around this by using tcping (a ping alternative that works over a TCP port):

tcping ec2-174-129-24-92.compute-1.amazonaws.com

tcping ec2-174-129-24-92.compute-1.amazonaws.com 22

It runs on port 80 (the first example) but you can also specify a different port (the second example) to be used to test connectivity.

like image 23
Jivko Petiov Avatar answered Oct 11 '22 02:10

Jivko Petiov