How to Configure AWS Transit Gateway step by step

Kevin W Tech Notes
3 min readFeb 14, 2021

Summary

1. Create Transit Gateway

2. Create vpc attachement, attach VPC to Transite Gateway

3. Configure VPC subnet route table, destination is remote VPC subnet, gw is TGW.

Prerequisite

Note: I’ll skip the basic VPC and EC2 instance creation, if you’re not familiar with how to create VPC and EC2 instance on AWS, you can refer some of my other notes.

1. Create kw-vpc1, kw-vpc2

2. Create kw-vpc1-subnet1 and kw-vpc2-subnet1 in each VPC

3. Create route table for each VPC

4. Create IGW for each VPC

5. Configure default route point to IGW for each VPC

6. Create one EC2 instance in each VPC.

7. Create Transit Gateway

8. Create Attachment for both VPC

9. Configure route on VPC1 and VPC2 subnet, destination is remote VPC subnets and point to TGW

10 Verification

After configured route-table, then we’re able to ping from kw-vpc2-instance1 to kw-vpc1-instance1.

[ec2-user@ip-10-2-1-219 ~]$ ping 10.1.1.104 -c 10000
PING 10.1.1.104 (10.1.1.104) 56(84) bytes of data.
64 bytes from 10.1.1.104: icmp_seq=134 ttl=254 time=1.45 ms
64 bytes from 10.1.1.104: icmp_seq=135 ttl=254 time=1.20 ms
64 bytes from 10.1.1.104: icmp_seq=136 ttl=254 time=1.23 ms
64 bytes from 10.1.1.104: icmp_seq=137 ttl=254 time=1.23 ms
64 bytes from 10.1.1.104: icmp_seq=138 ttl=254 time=1.20 ms
64 bytes from 10.1.1.104: icmp_seq=139 ttl=254 time=1.22 ms
64 bytes from 10.1.1.104: icmp_seq=140 ttl=254 time=1.22 ms
64 bytes from 10.1.1.104: icmp_seq=141 ttl=254 time=1.21 ms

EC2 instance route table doesn’t have any change.

[ec2-user@ip-10-1-1-104 ~]$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.1.1.1 0.0.0.0 UG 0 0 0 eth0
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.169.254 0.0.0.0 255.255.255.255 UH 0 0 0 eth0

--

--