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 .

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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠