Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
2 views
by (19.1k points)

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.

1 Answer

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

Browse Categories

...