LoginSignup
1
2

More than 3 years have passed since last update.

AWS Transit Gateway 試してみた

Posted at

1.環境の準備

各VPCから双方向に通信を実施してみたいと思います。以下のように2つの環境を準備しておきます。

--- A B
VPC 10.0.0.0/16 172.16.0.0/16
subnet 10.0.0.0/24 172.16.0.0/24
EC2 10.0.0.10 172.16.0.20
SG icmp 172.16.0.0/24 icmp 10.0.0.0/24

2.Transit Gatewayの作成

Transit Gateway を作成する。
image.png

3.Transit Gateway Attachmentの作成

Transit Gateway にVPC/subnetを紐づける。

A
image.png

B
image.png

4.Transit Gateway Route Tableの作成および設定

今回は【2.Transit Gatewayの作成】で、
Default route table assciation 
Default route table propagation
にチェックを入れてましたので、既に作成されています。

[Assciation] 【3.Transit Gateway Attachmentの作成】でアタッチしたVPC/subnetがルートテーブルにひもづいていることがわかります。
image.png

[Propagations] アタッチメントしたリソース間で通信が可能になります。
image.png

[Routes] を確認しておきましょう。
image.png

5.サブネットへのRoute Tableの編集

A
172.16.0.0/24 tgw
image.png

B
10.0.0.0/24 tgw
image.png

6.pingテストしてみる

A→B

[ec2-user@ip-10-0-0-10 ~]$ ping -c 3 172.16.0.20
PING 172.16.0.20 (172.16.0.20) 56(84) bytes of data.
64 bytes from 172.16.0.20: icmp_seq=1 ttl=254 time=3.16 ms
64 bytes from 172.16.0.20: icmp_seq=2 ttl=254 time=2.77 ms
64 bytes from 172.16.0.20: icmp_seq=3 ttl=254 time=2.81 ms

B→A

[ec2-user@ip-172-16-0-20 ~]$ ping -c 3 10.0.0.10
PING 10.0.0.10 (10.0.0.10) 56(84) bytes of data.
64 bytes from 10.0.0.10: icmp_seq=1 ttl=254 time=3.13 ms
64 bytes from 10.0.0.10: icmp_seq=2 ttl=254 time=2.76 ms
64 bytes from 10.0.0.10: icmp_seq=3 ttl=254 time=2.74 ms
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2