Add Transit Gateway Routes to VPC Route Tables
Overview
ℹ️ Information: In this section, you will configure the route tables in each VPC to direct traffic through the Transit Gateway. This enables communication between VPCs through the Transit Gateway.
- Access VPC Route Tables
- Open VPC Management Console
- Select Route Tables in the left sidebar
- Identify the main route tables for each VPC:
- First VPC Main Route Table = Route Table of VPC1
- Second VPC Main Route Table = Route Table of VPC2
- Third VPC Main Route Table = Route Table of VPC3
- Fourth VPC Main Route Table = Route Table of VPC4

- Edit VPC1 Routes
- Select the route table for VPC1
- Click Edit routes

- Add Transit Gateway Route
- Destination:
172.16.0.0/16
- Target: Select your Transit Gateway
💡 Pro Tip: The CIDR block 172.16.0.0/16
covers all VPCs in this lab, enabling communication between them.

- Verify VPC1 Route
- Confirm the route is added successfully
- This enables VPC1 to route traffic to other VPCs through the Transit Gateway

- Edit VPC3 Routes
- Select the route table for VPC3
- Click Edit routes

- Add Transit Gateway Route
- Destination:
172.16.0.0/16
- Target: Select your Transit Gateway

- Verify VPC3 Route
- Confirm the route is added successfully
- This enables VPC3 to route traffic to other VPCs through the Transit Gateway

- Edit VPC2 Routes
- Select the route table for VPC2
- Click Edit routes

- Add Transit Gateway Route
- Destination:
0.0.0.0/0
- Target: Select your Transit Gateway
ℹ️ Information: The 0.0.0.0/0
route enables VPC2 to route all non-local traffic through the Transit Gateway.

- Verify VPC2 Route
- Confirm the route is added successfully
- This enables VPC2 to route traffic through the Transit Gateway

- Edit VPC4 Routes
- Select the route table for VPC4
- Click Edit routes

- Add Transit Gateway Route
- Destination:
0.0.0.0/0
- Target: Select your Transit Gateway

- Verify VPC4 Route
- Confirm the route is added successfully
- This enables VPC4 to route traffic through the Transit Gateway

Test Connectivity
- Test Internet Connectivity
- Connect to VPC1 instance via SSH
- Test internet connectivity:

- Test Inter-VPC Connectivity
- Ping instances in other VPCs
- Verify successful connectivity

- Connect to VPC2 Instance
- Use SSH to connect to VPC2 instance
- Use the key pair file:
chmod 400 <keypairname.pem>
ssh -i "<YourKey.pem>" ec2-user@<YourEC2IP>

- Verify Full Connectivity
- Test connectivity between all VPCs
- Confirm successful ping tests
🔒 Security Note: Ensure your security groups allow the necessary traffic between VPCs for your specific use case.
