> For the complete documentation index, see [llms.txt](https://mamawhocode.gitbook.io/aws/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mamawhocode.gitbook.io/aws/services/network/transitgateway.md).

# Transit Gateway

a network transit hub to interconnect VPCs and on-premises

## Overview

* A network transit hub that you can use to connect your VPCs to on-premises network.&#x20;
* simplifies networking by acting as a regional virtual router.
* Your data is encrypted automatically, and NEVER travels over the public internet.

<figure><img src="https://docs.aws.amazon.com/images/vpc/latest/tgw/images/transit-gateway-overview.png" alt=""><figcaption><p>1 Transite gateway with 3 VPC attachments</p></figcaption></figure>

## Best practices

* Use seperate subnet for each transit gateway. For each subnet, use a small CIDR /28

## Trivia

* Transit gateway is a regional resource that resides *<mark style="background-color:yellow;">**outside**</mark>* the VPC.
* Routing through a transit gateway operate at Layer 3.

## Concepts

* [ASN](#concepts) (Autonomous System Number): is for the AWS side of a Border Gateway Protocol (BGP) session. You can use the default ASN, or you can specify a private ASN in the 64512-65534 or 4200000000-4294967294 ranges.
