Step 4: Create and Assign Route Tables
Route tables control how network traffic flows within your VPC. You will create two route tables: one for the public subnet and one for the private subnet.
Naming Convention
Use descriptive names that include subnet information to help with identification:
- PUBLIC ROUTE 10.0.1.x - For the public subnet
- PRIVATE ROUTE 10.0.2.x - For the private subnet
Create the Route Tables
- Navigate to VPC Dashboard and select Route Tables.
- Click Create Route Table.
- Enter PUBLIC ROUTE 10.0.1.x as the name tag.
- Select My-Company-VPC and click Create.
- Repeat steps 2-4 to create PRIVATE ROUTE 10.0.2.x.
Configure the Public Route Table
- Select PUBLIC ROUTE 10.0.1.x from the list.
- Click the Routes tab.
- Click Edit and then Add Another Route.
- Enter the following:
| Destination | Target |
|---|---|
| 0.0.0.0/0 | My-Company-IGW |
- Click Save.
- Click the Subnet Associations tab.
- Click Edit and check the box next to Public-Subnet (10.0.1.0/24).
- Click Save.
This configuration enables communication between your public subnet and the internet.
Configure the Private Route Table
- Select PRIVATE ROUTE 10.0.2.x from the list.
- Click the Subnet Associations tab.
- Click Edit and check the box next to Private-Subnet (10.0.2.0/24).
- Click Save.
Note: The private route table does not need an internet gateway route. Private subnet instances access the internet through a NAT gateway (optional, not covered in this guide).