AWS - Transit Gateway

 

In this post, We will see what is an AWS Transit Gateway. In the last post, we saw about VPC peering. One of the major problems with VPC peering is creating a peering connection as VPC's grows.



Imagine you have 3 VPC's A, B and C with peering as A -> B and B -> C. You cannot connect from VPC-C to VPC-A via VPC-B.

This problem is addressed via Transit Gateway. This is like a typical L3 Router where it learns about the network(VPC) it is associated with and updates the route table accordingly.


We have 2 VPC's.

VPC1 - 10.0.0.0/16 -> Subnet -> 10.0.1.0/24
VPC2 - 198.0.0.0/16  -> Subnet -> 198.0.1.0/24

I have created two Internet Gateways and attached them to VPC1 and VPC2.

Updated the routing table of VPC1 to reach 0.0.0.0/0 via Internet Gateway1 and VPC2 to reach 0.0.0.0/0 via Internet Gateway2.

The above discussed are basic steps. So, I am going to proceed with creating a Transit Gateway.


Once TGW(Transit Gateway) is created. Proceed to create a TGW attachment. 

Imagine a TGW attachment as a cable to connect VPC to TGW.

So, I have two TGW attachments VPC1 -> TGW and VPC2 -> TGW.



Repeat the same for other VPC.


Both attachments are ONLINE. TGW will have a route table attached to it.




We are done with the TGW setup.

Finally, We need to update the VPC route table as below:





Now, I have 2 Ec2 instances created one per VPC. We will try to telnet Ec2 on port 22 from VPC1 to VPC2.


Yay!!! 

FYI: I already updated the security group to allow incoming traffic on port 22.







Comments

Popular posts from this blog

SRE/DevOps Syllabus

AWS Code Commit - CI/CD Series Part 1

Docker - Preventing IP overlapping