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 Answers
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
EXPERT
answered 9 months ago
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
EXPERT
answered 9 months ago
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
EXPERT
Steve_M
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions