How to access/ping a server located on AWS?

前端 未结 10 1372
广开言路
广开言路 2021-01-30 13:49

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

相关标签:
10条回答
  • 2021-01-30 13:59

    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

    0 讨论(0)
  • 2021-01-30 14:02

    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

    0 讨论(0)
  • 2021-01-30 14:04

    If your instance uses a Windows AMI you need to make sure that both the security group on the AWS console AND the Windows Firewall are set up to accept connections on the port(s) you require.

    I had the same issue enabling http access until I configured the Windows firewall to allow connections on the ports I wanted. This is easily done in Windows by accessing Control Panel>System and Security>Windows Firewall>Advanced Settings. Then configure a new port rule to allow incoming TCP traffic to the port or port range you require.

    0 讨论(0)
  • 2021-01-30 14:07

    Give 2 rules in AWS security group (Inbound),

    Custom ICMP Rule       Echo Request          N/A            0.0.0.0/0
    
    Custom ICMP Rule       Echo Reply            N/A             0.0.0.0/0
    
    0 讨论(0)
  • 2021-01-30 14:09

    UPDATE for September 2014: After a while of not being able to apt-get without freezing, I tried to ping www.google.com. To my surprise I couldn't ping either. I followed the suggestion above by creating a new ICMP rule with an Echo Request for Inbound. This didn't work for me either. After much trying I created a new rule for Outbound with Echo Request. Now it works. Maybe AWS added this recently? Anyway, hope this helps somebody out there. Not being able to do something as simple as pinging could drive a person nuts.

    edit: now my apt-get works too!

    0 讨论(0)
  • 2021-01-30 14:13

    Eight years late but hopefully this will help someone else...

    The below shows how to enable the ports needed for pings.

    1) First make sure the EC2 instance has a public IP. It has a Public DNS or Public IP address then you should be good. This should also be the address you ping.

    2) Go to the Security Group that EC2 is using.

    • right click, select inbound rules
    • A: select Add Rule
    • B: Select Custom ICMP Rule - IPv4
    • C: Select Echo Request
    • D: Select either Anywhere or My IP (note: My IP is more secure then anyone but will only allow pings from your IP.)
    • E: Select Save

    3) Create a windows firewall exception.

    • Go to Start and type Windows Firewall with Advanced Security
    • Select inbound rules

    0 讨论(0)
提交回复
热议问题