- Newest
- Most votes
- Most comments
Hello.
Can you confirm that the route table for the subnet where EC2 is running has a route destined for the internet gateway?
It is possible that you are editing the route table for a different subnet.
Also, do your EC2 security group's inbound rules allow the required communication?
For example, if you want to access via HTTP, you need to allow HTTP as described in the document below.
https://repost.aws/knowledge-center/connect-http-https-ec2
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#updating-security-group-rules
Is the instance in a private or public subnet? If it is in a private subnet, you need to create a NAT GW and use that to route to the internet as private addresses are not routable on the internet. If it is a public subnet, make sure you have a public/EIP assigned to the instance. https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html#subnet-types https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html
Here are the steps to configure an EC2 instance to have internet access in AWS:
- Create a VPC with a public subnet. Use the VPC wizard in the AWS console to create a VPC with a public subnet. This will automatically create an internet gateway and attach it to the VPC.
- Launch the EC2 instance in the public subnet. When launching the EC2 instance, select the public subnet you created as the subnet to launch the instance into. This will assign a public IP address to the instance.
- Configure a security group. When launching the instance, configure a security group that allows inbound traffic on ports that you need to access, such as SSH, HTTP etc. This will allow that traffic to reach the instance.
- Optionally, you can assign an Elastic IP. Though not required, you can allocate an Elastic IP and associate it with the instance to give it a static public IP address.
The key steps are creating a public subnet with an internet gateway, launching the instance into the public subnet, and configuring the security group to allow required inbound traffic. Following these steps will ensure your EC2 instance can be reached from the internet.
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 5 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 months ago
Thanks Riku, I have updated with above mentioned Ports but still not getting internet access on EC2. i think something missing from route table or internet gateway.
Note: i have turned off the windows firewall as well as