Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Elastic IP Network vpc is not attached to any internet gateway

Tags:

I have given a limited access to a AWS account.

I already created an EC2 instance but when I try to associate an elastic ip, I got the error below:

An error occurred while attempting to associate the address Network vpc-(security id) is not attached to any internet gateway 
like image 340
richersoon Avatar asked Feb 28 '15 06:02

richersoon


People also ask

Is not attached to any Internet gateway Elastic IP?

This error occurs because the VPC is not associated with an Internet Gateway. To solve this: Go to VPC, then click on Internet Gateway. If none exists, Create one(probably will need admin permission) and then attach it to the target VPC-id. And try again associating the Elastic IP address to the EC2 instance.

How do I connect VPC to Elastic IP?

To tag an Elastic IP address Open the Amazon VPC console at https://console.aws.amazon.com/vpc/ . In the navigation pane, choose Elastic IPs. Select the Elastic IP address and choose Tags. Choose Manage tags, enter the tag keys and values as required, and choose Save.


2 Answers

You are using the new Amazon Virtual Private Cloud instead of the EC2 Classic. The cloud you are using lacks the internet gateway virtual component that is necessary for the cloud to be reachable from the public internet.

You need to add an internet gateway to your private cloud for it to be able to connect to internet; with that in place, you can use Elastic IPs (after all, they are internet addressable; your VPC instances can have static instance IPs), and add a routing entry for internet addresses (0.0.0.0/0, or a narrower space).

like image 138

This error occurs because the VPC is not associated with an Internet Gateway. To solve this: Go to VPC, then click on Internet Gateway. If none exists, Create one(probably will need admin permission) and then attach it to the target VPC-id. And try again associating the Elastic IP address to the EC2 instance. Hope it helps :)

like image 43
Patty Avatar answered Oct 02 '22 01:10

Patty