no internet in ec2 but i am able ssh to ec2 using aws console

0

wget google.com only leads to resolution of domain. then keeps on waiting for connecting.

ssh into server from public ip = not working

ssh into server using ec2 website console = working

same problem with lightsail

only in mumbai region. new instance also same problem .

已提问 10 个月前302 查看次数
3 回答
0

What are the settings for the security groups configured on EC2?
Does the SSH port allow connections?
By the way, do you get any errors when you connect via SSH?
For Lightsail, you need to check the firewall settings.

The following documents contain troubleshooting instructions for each error.
Please check once.
https://repost.aws/knowledge-center/ec2-linux-ssh-troubleshooting

profile picture
专家
已回答 10 个月前
0

Hi it sounds like you have Security Groups and Network Access Control lists in place that block the connection, verify the following:

1: Your EC2 instance is in a public subnet and has a public IP address.

2: Verify that any NACLs on the subnet allow outbound traffic on ports 80, 443.

3: Verify that any NACLs allow incoming traffic on port 22 and all ephemeral ports

4: Verify that any SG allow incoming traffic on port 22 from your IP address.

profile picture
专家
已回答 10 个月前
0

As you cannot get in using the public IP address, and when you're in using the console you can't get out onto the internet, I'm wondering if there is a routing issue.

Is the EC2 instance provisioned in the default VPC, or a VPC you have created? If the EC2 is in the default VPC then is it in a pre-existing subnet, or in a subnet you have created?

If it's in a pre-existing subnet in the default VPC then the routing should be fine, so ensure you've got TCP port 22 open inbound from your IP (actually, allow it from 0.0.0.0/0 while you're troubleshooting). And allow outbound to all destinations over TCP ports 80 & 443.

If it's in a new subnet and/or new VPC then make sure it has a route directly to an internet gateway (without this you won't be able to connect inbound to its public IP). in AWS Console -> VPC -> Subnets -> [subnet] -> Route table and it needs to have an entry for destination 0.0.0.0/0 with target igw-abcd1234.

Once this is confirmed to be in place, then the same comment about ports on the security group.

profile picture
专家
Steve_M
已回答 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则