Sitemap

How to Enable Peering Between Multiple (Inter-Region) VPCs via Transit Gateway?

5 min readNov 9, 2021

Enabling peering between multiple VPCs on AWS can be difficult. It can be much more difficult if they are in different regions.

I will walk you through the process of enabling peering between multiple VPCs.

Press enter or click to view image in full size
Photo by Truman Adrian Lobato De Faria on Unsplash

I have 2 VPCs. One is in Frankfurt (eu-central-1), the other one is in Sydney (ap-southeast-2).

Let me share my VPC configurations:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

The subnet configurations:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

I attached an internet gateway to each VPC.

0.0.0.0/24 is forwarded to the internet gateway.

I created two different EC2 servers. One is in Frankfurt, and the other in Sydney.

I tried to ping 8.8.8.8. It works.

I tried to ping each other via private IP addresses and they can’t ping each other via private IP addresses as expected:

Press enter or click to view image in full size
Press enter or click to view image in full size

The basic VPC configurations are set.

Let’s get started

Open the VPC Management Console. Find the Transit Gateways in the sidebar:

Press enter or click to view image in full size

I will create the transit gateways (Transit Gateways>Create Transit Gateway):

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

I will wait until the state of the transit gateway is Available:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

I will create a transit gateway attachment in Frankfurt and in Sydney.

Thus, I will enable communication between these transit gateways:

Press enter or click to view image in full size
This screenshot is from Frankfurt

I will wait until the state of the transit gateway is Pending Acceptance:

Press enter or click to view image in full size
This screenshot is from Frankfurt

I will now go to the Sydney region accept the peering request on the Transit gateway attachments page:

Press enter or click to view image in full size
This screenshot is from Sydney

(Actions -> Accept transit gateway attachment -> Accept)

I will wait until the state of the transit gateway is Available:

Press enter or click to view image in full size
This screenshot is from Frankfurt

I will create a gateway attachment for VPC-01 in Frankfurt and another gateway attachment for VPC-02 in Sydney:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

I will wait until the state of the transit gateway attachment is Available:

Press enter or click to view image in full size
Press enter or click to view image in full size

I will create a route table for each transit gateway:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

Waiting until they are available:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

For each route table, I will create an association for peering

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

I will also create an association for each route table:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

Waiting until they are associated:

Press enter or click to view image in full size
This screenshot is from Frankfurt
Press enter or click to view image in full size
This screenshot is from Sydney

I will create static routes for each transit gateway:

Press enter or click to view image in full size
This screenshot is from Frankfurt

I’d like to remind you that we have the 10.0.0.0/24 IP range in Frankfurt. It should be forwarded to VPC-01 itself.

Press enter or click to view image in full size
This screenshot is from Frankfurt

I’d like to remind you that we have the 192.168.0.0/24 IP range in Sydney. It should be forwareded to VPC-02 itself.

Press enter or click to view image in full size
This screenshot is from Sydney

In Frankfurt, I will forward the 192.168.0.0/24 IP Range to the peering attachment gateway. So the requests sent to 192.168.0.0/24 will be forwarded to Sydney:

Press enter or click to view image in full size
This screenshot is from Frankfurt

In Sydney, I will forward the 10.0.0.0/24 IP Range to the peering attachment gateway. So the requests sent to 10.0.0.0/24 will be forwarded to Frankfurt:

Press enter or click to view image in full size
This screenshot is from Sydney

Is that all? Nope

In Frankfurt, I will create a routing rule in the VPC’s own route table. The VPC is attached to the EC2 server. The requests sent to 192.168.0.0/24 will be forwarded to the transit gateway, which will forward the requests to Sydney.

Press enter or click to view image in full size
This screenshot is from Frankfurt

In Sydney, I will create a routing rule in the VPC’s own route table. The VPC is attached to the EC2 server. The requests sent to 10.0.0.0/24 will be forwarded to the transit gateway, which will forward the requests to Frankfurt.

Press enter or click to view image in full size
This screenshot is from Sydney

Let’s try to ping each other over private IP addresses:

creative-commons-by-21pxcreative-commons-nc-21pxcreative-commons-sa-21px

--

--