> For the complete documentation index, see [llms.txt](https://karansingh.gitbook.io/aws-saa-c02/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://karansingh.gitbook.io/aws-saa-c02/virtual-private-cloud-vpc/internet-gateways-and-route-tables.md).

# Internet Gateways & Route Tables

## Internet Gateways

* It is a **horizontally scaled, redundant, and highly available** VPC component that **allows communication between your VPC and the internet**.<br>
* It **serves two purposes:**
  * Provide a **target in your VPC route tables** for internet-routable traffic.<br>
  * Perform **network address translation (NAT) for instances** that have been assigned public IPv4 addresses.<br>
* You can **only have 1 Internet Gateway per VPC**.

## Enabling internet access

1. **Create an internet gateway**.<br>
2. **Attach the internet gateway** to your VPC.<br>
3. **Add a route to your subnet's route table** that **directs internet-bound traffic to the internet gateway**.<br>
4. Ensure that **instances in your subnet have a globally unique IP address** (public IPv4 address, Elastic IP address, or IPv6 address).<br>
5. Ensure that your **network access control lists and security group rules allow the relevant traffic** to flow to and from your instance.

## Route Tables

* A route table **contains a set of rules**, called routes, that are **used to determine where network traffic from your subnet or gateway is directed**.

## Main Route Table

* When you create a VPC, it **automatically has a main route table**.<br>
* The main route table **controls the routing for all subnets that are not explicitly associated with any other route table**.<br>
* You **cannot delete a main route table**.
