AWS Transit Gateway
An AWS Transit Gateway is a central network transit hub that assists in connecting various networks, such as AWS Virtual Private Cloud (VPC) with other VPCs or on-premises networks. Maintaining interconnectivity with cross-regional and cross-account VPCs and with on-premises networks becomes challenging as the number of VPCs in a global network infrastructure rises. AWS Transit Gateway was introduced to reduce this overhead and offer simple maintenance, effective routing, and scalability.
Introduction to AWS Transit Gateway
Utilizing a network transit hub to which multiple attachments can be attached, AWS Transit Gateway enables simple and scalable interconnectivity with AWS cross-regional and cross-account VPCs as well as with on-premises networks. An AWS Transit Gateway serves as a central router by using a hub-spoke topology rather than the mesh networking topology that would otherwise be used for network connectivity.
In a mesh topology, a dedicated point-to-point link connects each device to every other device on the network.
In a hub-spoke topology, a central device (the hub) is interconnected with numerous other devices (the spokes).
Let's look at the example below to better understand the issue that the AWS Transit Gateway addresses:
Our goal is to connect the various AWS VPCs, Customer Gateway on our on-premises network, and AWS Direct Connect Gateway that make up our global network infrastructure. We can use VPN connections and AWS peering connections to connect all of these networks. The architecture that results will resemble what is depicted in the image below. As interconnections increase, routing and network management become difficult.
The AWS Transit Gateway, which employs a hub-and-spoke networking topology and reduces the number of interconnections made through transit connections, could be used as an alternative to the above solution.
Transit Gateway Use Cases
- Connectivity to AWS multi-region VPCs: By connecting to multi-region VPCs in AWS, AWS Transit Gateway can offer secure and highly available interconnectivity within the AWS network.
- Multiple VPN connections: AWS Transit Gateway can be used to establish Site-to-Site VPN connections with an on-premises network. Using a transit gateway device resolves the issue of managing multiple network connections.
- Connections from SD-WAN to AWS: SD-WAN is a software-defined method of managing WAN. On-premises networks managed by SD-WAN can also connect to AWS using the Transit Gateway, simplifying network monitoring.
- Device Interconnectivity: Using the AWS Transit Gateway, it is simple to connect AWS-managed resources, such as EC2, to on-premise hardware or devices.
Create the Transit Gateway
To create a Transit Gateway follow the below-mentioned steps:
- Log in to the Amazon VPC console.
- Select Transit Gateways from the navigation pane.
- Choose to Create a transit gateway.
- Enter the Name and Description.
- For Autonomous System Number (ASN), choose the default ASN.
- Click on Create transit gateway.
Attach your VPCs to Your Transit Gateway
To attach VPCs to the Transit Gateway follow the below-mentioned steps:
- Click Transit Gateway Attachments in the VPC navigation pane.
- Choose to Create a transit gateway attachment.
- Enter a name for the attachment.
- Select the transit gateway ID for the attachment.
- Select VPC as the attachment type.
- Select the VPC to which you want to connect the transit gateway for the VPC ID.
- Select one subnet for each Availability Zone that the transit gateway will use to route traffic.
- Select the Create transit gateway attachment option.
Add Routes Between the Transit Gateway and Your VPCs
To add routes between the transit gateway and your VPCs follow the below-mentioned steps:
- Select Route Tables from the VPC navigation pane.
- Select the route table that corresponds to your VPC.
- Select the Routes tab, then Edit Routes. Select the "Add" route.
- Enter the destination IP address range in the Destination column.
- Select Transit Gateway as the Target, and then enter the transit gateway ID.
- Select Save changes.
Test the Transit Gateway
- Launch a Linux-based EC2 instance in both VPCs.
- Connect to the EC2 instances using SSH.
- Use the ping command to verify the interconnectivity between both instances.
Delete the Transit Gateway
- Select Transit Gateways from the VPC navigation pane.
- Choose Actions, and Delete the transit gateway after selecting the transit gateway.
- Enter delete and press the Delete button.
Releases for Transit Gateways
Recent releases of transit gateways include:
- Support for Transit Gateway Flow Logs to monitor the network traffic.
- Inclusion of policy tables to set up dynamic routing.
- AWS Direct Connect is available for the attachments in the Transit Gateway attachments.
- AWS Transit Gateway now supports multicast traffic.
- Network Manager is enabled to visualize and monitor global networks from a single place.
- An AWS Transit Gateway is a hub that assists in connecting various networks, such as AWS Virtual Private Cloud (VPCs) with other VPCs or on-premises networks. It was introduced to reduce this overhead and offer simple maintenance, effective routing, and scalability.
- The Amazon Web Services (AWS) Transit Gateway is a hub-spoke router that connects VPCs and on-premises networks. It enables simple and scalable interconnectivity with AWS cross-regional and cross-account VPCs.
- AWS Transit Gateway can offer secure and highly available interconnectivity for multiple use cases such as connectivity to AWS multi-region VPCs, multiple VPN connections, connections from SD-WAN to AWS, and device interconnectivity
- AWS Transit Gateway now supports multicast traffic. Network Manager is enabled to visualize and monitor global networks from a single place. The inclusion of policy tables to set up dynamic routing has made it easier for customers to manage their transit networks in real time.