Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)
recategorized by

I am facing this issue. My EC2 instance is not getting internet access. Also, Instances are not communicating within  subnet and vpc

Here are the details below.

Region: All the region

Security group inbound rules

Type      Protocol     Port Range          Source Description

HTTP     TCP              80                         0.0.0.0/0

HTTP     TCP               80                         ::/0

SSH        TCP              22                         0.0.0.0/0

HTTPS    TCP            443                        0.0.0.0/0

HTTPS   TCP            443                          ::/0

Security group outbound rules

Type                  Protocol   Port Range            Destination               Description

ALL Traffic         ALL           ALL                          0.0.0.0/0

ALL Traffic        ALL          ALL                             ::/0

NACL Inbound rules

Rule #                Type               Protocol             Port Range                Source                 Allow / Deny

100                     SSH (22)        TCP (6)                22                               0.0.0.0/0             ALLOW

101                    HTTP (80)      TCP (6)                80                               0.0.0.0/0              ALLOW

102                   HTTPS (443)  TCP (6)                443                             0.0.0.0/0              ALLOW

*                        ALL Traffic    ALL                   ALL                                  0.0.0.0/0               DENY

NACL outbound rules

Rule #                Type                               Protocol             Port Range                Destination           Allow / Deny

100                    ALL Traffic                    ALL                         ALL                               0.0.0.0/0                 ALLOW

101                   ALL Traffic                     ALL                          ALL                            ::/0                            ALLOW

*                        ALL  Traffic                    ALL                         ALL                               0.0.0.0/0                 DENY

Instance's Subnet associated route tables routes

Destination            Target                                        Status              Propagated

10.10.0.0/16           local                                        Active                No

0.0.0.0/0               igw-099d16ab56df3a8e8      Active                 No

I have checked with different DHCP option sets, internet gateway and also with different AMIs.

2 Answers

0 votes
by (44.4k points)

First ping your instances public IP from local machine to check whether internet works. If you have not enabled public IP, then create another machine under the same VPC and try pinging the private IP from that instance.

If this doesn't work, check whether your instance is created under the right VPC and Subnet. If not, try using your default VPC. 

Also, you need a NAT gateway to create communication between your instances in a private subnet. Internet gateways cannot provide internet to an instance under a private subnet, so make sure to add a NAT gateway if your instance is in a private subnet.

If the above information does not solve your issues, you can check out these references

  1. EC2 Internet connectivity
  2. VPC Internet Gateway connections
  3. VPC NAT Gateway connections
0 votes
ago by (2.8k points)

Here with the reference to provided information, it’s clear that all the setup has been done for the connection of EC2 instance, but you can also check with your VPC once, if that is properly connected to the internet or not. Additionally try verifying your subnet has auto-assign IP enabled or not since maybe your EC2 can expect some public IPs. If you don’t want to provide the same, you may consider going for the elastic IPs. Moreover, look if you have assigned the instance to the correct security group or not. After this also, if you still face similar issues, check for the Network interface configuration

Related questions

+1 vote
1 answer
Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...