Need help?

Our experts have had an average response time of 11.7 minutes in August 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Can’t Connect EC2 Instance to Internet using an Internet Gateway

by | Jul 16, 2021

Can’t Connect EC2 Instance to the Internet using an Internet Gateway? We can help you.

To prevent this error, we need to verify the instance meets all prerequisites, has a public IP, and ensure the firewall isn’t blocking access.

Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.

Today, let us see how to fix this error.


Can’t Connect EC2 Instance to the Internet using an Internet Gateway

In this article, our Support Techs discuss each method to fix this error in detail.


Verify that the instance meets all prerequisites

The instance must meet the following conditions:

  1. The route table that associate with the instance’s subnet should have a default route to an internet gateway (
  2. The internet gateway that associate with the route should not delete.
  3. The security group that attaches to the instance’s elastic network interface has rules allowing outbound internet traffic ( for the ports and protocols.
  4. The network ACL has rules that allow both outbound and inbound traffic to the internet.


Verify that the instance has a public IP address

Suppose, the instance doesn’t have a public IP address but has an internet gateway. In such a case, the instance isn’t accessible outside of the virtual private cloud that it resides in.

To allow the instance connectivity, we allocate an Elastic IP address and associate it with the instance.

Or, we can enable the public IPv4 addressing attribute in the subnet.

This means that instances we launch in the subnet attribute to public IP addresses at launch.


Verify that a firewall isn’t blocking access

If the instance issues persist, then we try the following:

  1. FSPTest the accessibility of the site or location from a known working instance or device using the ping or curl tools.
  2. FSPVerify that any firewall devices or software allow traffic over HTTP or HTTPS.

To verify that there aren’t rules blocking traffic, we run:

$ sudo iptables -L
$ sudo iptables -L -t nat

Suppose it indicates blocked traffic. Then we remove the rule or add a rule to allow traffic for that specific port.

For example,

$ sudo iptables -D examplerule
$ sudo iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT

Here, we replace examplerule with the new rule and port 80 with the specific port number.


Windows Server:

When it comes to Windows Server default firewalls, we run:

netsh advfirewall firewall show rule name=all

If the output indicates blocked traffic, then we remove the old rule or add a new rule to allow traffic for that specific port.

For example,

netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80

Here, we replace port 80 with the specific port number.

[Need help with the fix? We are here for you]



In short, we saw how our Support Techs fix the ‘Can’t Connect EC2 Instance’ error.


Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.


var google_conversion_label = "owonCMyG5nEQ0aD71QM";


Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center


Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]


Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid


Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie


These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.