Home > Enterprise >  Elastic IP on NAT Gateway, but not on Internet Gateway
Elastic IP on NAT Gateway, but not on Internet Gateway

Time:04-07

I am wondering why do we attach an Elastic IP address to a NAT Gateway, but we do not attach one to an Internet Gateway.

The functionality of these two services is very similar. The NAT Gateway allows instances in my private network to initiate communication to the outside. The Internet Gateway extends this by allowing external devices to initiate communication also to the inside. So I would expect the Internet Gateway to require an Elastic IP address too at least, but this does not match the reality.

Is there any explanation to this?

CodePudding user response:

A NAT Gateway still uses an Internet Gateway to access the Internet. So they are not two exclusive, separate things like you indicate in your question. Also, an Internet Gateway is not just for allowing inbound connections from the Internet, as you state in your question, it is for allowing any Internet access inbound to your VPC or outbound from your VPC.

An Internet Gateway allows anything in the VPC with a public IP address to access the Internet. It's basically a bridge between your private network, and Amazon's Internet connection.

A NAT Gateway is one of those resources that gets a public IP address in order to access the Internet through the Internet Gateway. The NAT Gateway just serves as a route to the Internet for all the resources in the VPC that do not have a public IP address.

  • Related