---
title: 週末趣味のAWS Transit Gatewayでの経路制御
tags: 
author: [難波和生](https://www.docswell.com/user/4944428)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/GJWL69X1E2.jpg?width=480
description: JAWS-UG Okayama 2019 × SORACOM-UG Okayama vol.1
published: December 26, 22
canonical: https://www.docswell.com/s/4944428/57Q6JK-2022-12-26-002426
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/GJWL69X1E2.jpg)

週末趣味のAWS
Transit Gateway での経路制御


# Page. 2

![Page Image](https://bcdn.docswell.com/page/4EZMY96XJ3.jpg)

免責事項
本資料並びにセッションでの発言は私個人の調査や情報
収集および実践に基づいて構成したものです
したがって所属企業やAWS等、私個人以外の如何なるも
のの意見を代表するものではありません
本セッションでの内容に起因して損害が生じた場合におい
ても、発表者はその責任を負うことができません


# Page. 3

![Page Image](https://bcdn.docswell.com/page/Y76NDK2P7V.jpg)

氏名：難波 和生
株式会社リゾーム 所属
Twitter:@kazu_0
職業：情シス管理者
：サーバ・NWのインフラ担当
：レイヤー ０~４ までの人です
好きなAWSサービス
：Transit Gateway/VPC/DX
：Global Accelerator


# Page. 4

![Page Image](https://bcdn.docswell.com/page/G7553P2P74.jpg)

Transit Gateway とは
• Amazon Virtual Private Cloud (VPC) や
オンプレミスネットワーク（VPN・DX GW）を
単一のゲートウェイに接続できるようにするサービス
今まで
メッシュ型
TGW
スター型


# Page. 5

![Page Image](https://bcdn.docswell.com/page/9J2NZ64ZER.jpg)

Transit Gateway とは
Next-Generation Networking with AWS Transit Gateway and Shared VPCs
https://medium.com/slalom-technology/next-generation-networking-with-aws-transit-gateway-and-shared-vpcs-9d971d868c65


# Page. 6

![Page Image](https://bcdn.docswell.com/page/DEYPR9MNEM.jpg)

Transit Gateway の特徴
• 異なるAWS アカウントの VPC を接続できる
• AWS アカウント A が作成した Transit Gateway に
AWS アカウント B と C の VPC を接続
例：自社AWSアカウントのTGWへ
お客様AWSアカウントのVPCや
オンプレミス環境をVPN接続


# Page. 7

![Page Image](https://bcdn.docswell.com/page/VJN5DLWV78.jpg)

Transit Gateway の特徴
• 複数のルートテーブルを持てる
• VRF【 Virtual Routing and Forwarding 】に近いイメージ
複数の経路表を構成することができる


# Page. 8

![Page Image](https://bcdn.docswell.com/page/YE9YG4XVJ3.jpg)

Transit Gateway の用語
• Route Table
• Attachments
• Associations
• Propagations


# Page. 9

![Page Image](https://bcdn.docswell.com/page/GE86VQ247D.jpg)

Transit Gateway の用語
• Route Table
• ルートテーブル：経路表 （複数のRTを設定可能）
• Attachments
• Transit GatewayにVPC/VPN/DX-GWを「アタッチ：接続」
• Associations
• 接続したAttachmentsを 1つの ルートテーブル へ「関連付け」
• Propagations
• 複数 ルートテーブル へ接続したAttachmentsの「経路を伝搬」


# Page. 10

![Page Image](https://bcdn.docswell.com/page/LEL95X2VJR.jpg)

Transit Gateway 経路制御のシナリオ
◆自社アカウント
• AWSアカウント A
• 顧客向け WEBサービス を展開している
• AWSアカウント B
• アカウント A のWEBサービスとデータ連携する自社サービスが稼働している
• サービス提供にはステートレス 通信が必要
◆お客様アカウント
• AWSアカウント C
• アカウント A の WEBサービスとVPCで稼働する売管システムとのデータ連係
• VPN 接続
• アカウント A の WEBサービスへオンプレミスから使用
• オンプレミスで稼働する売上管理システムとのデータ連係
AWSアカウント C と VPN接続 の通信はNG


# Page. 11

![Page Image](https://bcdn.docswell.com/page/4JMZ3L8NEW.jpg)

シナリオの 構成図
AWSアカウントA
VPC-A
TGW route table
Associations
Propagations
Common Service
VPC-C,VPN
VPC-A
System Linkage
VPC-A,VPC-B
VPC-A,VPC-B, VPC-C, VPN
AWSアカウントB
Attachments A
Attachments B
VPC-A Route table
VPC-B
VPC-B Route table
Destination
Target
Destination
Target
172.28.0.0/14
TGW
172.28.0.0/14
TGW
10.1.0.0/16
TGW
172.29.0.0/16
Local
172.28.0.0/16
local
Transit Gateway
Account-A
AWSアカウントC
Attachments C
VPC-C
VPC-C Route table
オンプレ VPN接続
Attachments VPN
VPN
on-premise Route table
Destination
Target
Destination
Target
172.28.0.0/14
TGW
BGP receivedroutes
TGW
172.30.0.0/16
local
10.1.1.0/24
local


# Page. 12

![Page Image](https://bcdn.docswell.com/page/PJR6QK5479.jpg)

シナリオの 構成図
AWSアカウントA
VPC-A
TGW route table
Associations
Propagations
Common Service
VPC-C,VPN
VPC-A
System Linkage
VPC-A,VPC-B
VPC-A,VPC-B, VPC-C, VPN
AWSアカウントB
Attachments A
Attachments B
VPC-A Route table
VPC-B
VPC-B Route table
Destination
Target
Destination
Target
172.28.0.0/14
TGW
172.28.0.0/14
TGW
10.1.0.0/16
TGW
172.29.0.0/16
Local
172.28.0.0/16
local
Transit Gateway
Account-A
AWSアカウントC
Attachments VPN
Attachments C
VPC-C
VPC-C Route table
オンプレ VPN接続
Common Service RT
172.28.0.0/16 Via Attachments A
VPN
on-premise Route table
Destination
Target
Destination
Target
172.28.0.0/14
TGW
BGP receivedroutes
TGW
172.30.0.0/16
local
10.1.1.0/24
local


# Page. 13

![Page Image](https://bcdn.docswell.com/page/PEXM5LKZ7X.jpg)

シナリオの 構成例
AWSアカウントA
VPC-A
TGW route table
Associations
Propagations
Common Service
VPC-C,VPN
VPC-A
System Linkage
VPC-A,VPC-B
VPC-A,VPC-B, VPC-C, VPN
AWSアカウントB
Attachments A
Attachments B
VPC-A Route table
VPC-B
VPC-B Route table
Destination
Target
Destination
Target
172.28.0.0/14
TGW
172.28.0.0/14
TGW
10.1.0.0/16
TGW
172.29.0.0/16
Local
172.28.0.0/16
local
Transit Gateway
Account-A
AWSアカウントC
Attachments C
VPC-C
VPC-C Route table
Destination
Target
172.28.0.0/14
TGW
172.30.0.0/16
local
オンプレ VPN接続
Attachments VPN
System Linkage RT
172.28.0.0/16 Via Attachments A
172.29.0.0/16 Via Attachments B
172.30.0.0/16 Via Attachments C
10.1.1.0/24 Via Attachments VPN
VPN
on-premise Route table
Destination
Target
BGP receivedroutes
TGW
10.1.1.0/24
local


# Page. 14

![Page Image](https://bcdn.docswell.com/page/3EKG6L5VJD.jpg)

Transit Gateway の注意点
◆TGW環境作成時
• TGW-RTで経路制御したい時は
下記2つのチェックを外す
• Default route table association
• Default route table propagation
• TGW作成後に外すことができないので
修正には環境の再作成が必要


# Page. 15

![Page Image](https://bcdn.docswell.com/page/L73N631Q75.jpg)

Transit Gateway の注意点
◆VPCのルーティングテーブル
• TGWへ向かう戻り経路をVPCのRTに設定必要
◆VPNのルーティングテーブル
• CGWはBGPでTGWへ向かう戻り経路を学習
• オンプレミス側の経路にTGWへ向かう経路を再広報


# Page. 16

![Page Image](https://bcdn.docswell.com/page/87DWV4XWJG.jpg)

シナリオの 構成図（再掲）
AWSアカウントA
VPC-A
TGW route table
Associations
Propagations
Common Service
VPC-C,VPN
VPC-A
System Linkage
VPC-A,VPC-B
VPC-A,VPC-B, VPC-C, VPN
AWSアカウントB
Attachments A
Attachments B
VPC-A Route table
VPC-B
VPC-B Route table
Destination
Target
Destination
Target
172.28.0.0/14
TGW
172.28.0.0/14
TGW
10.1.0.0/16
TGW
172.29.0.0/16
Local
172.28.0.0/16
local
Transit Gateway
Account-A
AWSアカウントC
Attachments C
VPC-C
VPC-C Route table
オンプレ VPN接続
Attachments VPN
VPN
on-premise Route table
Destination
Target
Destination
Target
172.28.0.0/14
TGW
BGP receivedroutes
TGW
172.30.0.0/16
local
10.1.1.0/24
local


# Page. 17

![Page Image](https://bcdn.docswell.com/page/VJP9VMPXE8.jpg)

Transit Gateway の注意点
◆アドレス重複を避けるIPアドレス設計
◆Longest match での重複回避も検討
◆ステートレス通信のみの場合は
Private Linkの使用を検討


# Page. 18

![Page Image](https://bcdn.docswell.com/page/2EVMZ923EQ.jpg)

Transit Gateway の注意点
◆リージョン越えできない（2019年8月現在）
• TGW単体ではクロスリージョン構成はできません
◆コスト面の話
• 通常の VPN接続(VPC S2S VPN)よりコスト高い
• トータルコスト ＝ VPN接続 料金 ＋ TGW 使用料


# Page. 19

![Page Image](https://bcdn.docswell.com/page/57GG4ZRY7L.jpg)

Transit Gateway のユースケース
◆等価コスト マルチパス (ECMP) によるVPN帯域向上
◆同じコストの経路が複数存在するときにトラフィックを振り分ける
◆通常のVPNはトンネルあたり最大 1.25 Gbps のスループット
◆AWS さんで最大 50Gbps まではテスト済み
https://docs.aws.amazon.com/ja_jp/vpc/latest/tgw/transit-gateway-limits.html
・Maximum
bandwidth (burst) per VPC connection: 50 Gbps
・Maximum bandwidth per VPN connection: 1.25 Gbps
This is a hard limit. You can use ECMP to get higher VPN bandwidth
by aggregating multiple VPN connections.


# Page. 20

![Page Image](https://bcdn.docswell.com/page/4EQXGLV67P.jpg)

Transit Gateway のユースケース
◆等価コスト マルチパス (ECMP) によるVPN帯域向上
◆Customer Gateway の要件
◆Multi-Path BGP
◆ECMP support, amount of equal paths
◆reverse-path forwarding/spoofing check
◆Only supported with BGP, not static routing


# Page. 21

![Page Image](https://bcdn.docswell.com/page/KJ465DMM71.jpg)

Transit Gateway のユースケース
◆等価コスト マルチパス (ECMP) によるVPN帯域向上
◆Direct Connect のバックアップ回線
◆FSx for Windows File Server の閉域アクセス回線


# Page. 22

![Page Image](https://bcdn.docswell.com/page/LE1VWZ8Y7G.jpg)

Transit Gateway のユースケース
◆等価コスト マルチパス (ECMP) によるVPN帯域向上
◆AMC でのECMP 経路確認


# Page. 23

![Page Image](https://bcdn.docswell.com/page/GEWL69Z172.jpg)

Transit Gateway のユースケース
◆等価コスト マルチパス (ECMP) によるVPN帯域向上
◆CGW でのECMP 経路確認
#sh ip route
抜粋
B 172.30.0.0/16 [20/100] via 169.254.15.105, 09:04:50
[20/100] via 169.254.14.145, 09:04:50
[20/100] via 169.254.14.89, 09:04:50
[20/100] via 169.254.14.65, 09:04:50
----------------------------#sh ip bgp
抜粋
Network
Next Hop
Metric LocPrf Weight Path
0.0.0.0
0.0.0.0
0i
*&gt; 10.1.1.0/24
0.0.0.0
0
32768 i
*m 172.30.0.0
169.254.14.65
100
0 64512 e
*&gt;
169.254.14.89
100
0 64512 e
*m
169.254.15.105
100
0 64512 e
*m
169.254.14.145
100
0 64512 e


# Page. 24

![Page Image](https://bcdn.docswell.com/page/47ZMY91XE3.jpg)

Transit Gateway のユースケース
◆等価コスト マルチパス (ECMP) によるVPN帯域向上
◆CGW でのECMP 設定例
csr1000v#sh ru | begin bgp
router bgp 65002
bgp log-neighbor-changes
neighbor 169.254.14.65 remote-as 64512
neighbor 169.254.14.65 timers 10 30 30
neighbor 169.254.14.89 remote-as 64512
neighbor 169.254.14.89 timers 10 30 30
neighbor 169.254.14.145 remote-as 64512
neighbor 169.254.14.145 timers 10 30 30
neighbor 169.254.15.105 remote-as 64512
neighbor 169.254.15.105 timers 10 30 30
!


# Page. 25

![Page Image](https://bcdn.docswell.com/page/YJ6NDKLPJV.jpg)

Transit Gateway のユースケース
◆等価コスト マルチパス (ECMP) によるVPN帯域向上
◆ CGW でのECMP 設定例
address-family ipv4
network 10.1.1.0 mask 255.255.255.0
neighbor 169.254.14.65 activate
neighbor 169.254.14.65 default-originate
neighbor 169.254.14.65 soft-reconfiguration inbound
neighbor 169.254.14.65 prefix-list TGWRT out
neighbor 169.254.14.89 activate
neighbor 169.254.14.89 default-originate
neighbor 169.254.14.89 soft-reconfiguration inbound
neighbor 169.254.14.89 prefix-list TGWRT out
neighbor 169.254.14.145 activate
neighbor 169.254.14.145 default-originate
neighbor 169.254.14.145 soft-reconfiguration inbound
neighbor 169.254.14.145 prefix-list TGWRT out
neighbor 169.254.15.105 activate
neighbor 169.254.15.105 default-originate
neighbor 169.254.15.105 soft-reconfiguration inbound
neighbor 169.254.15.105 prefix-list TGWRT out
maximum-paths 4
exit-address-family


# Page. 26

![Page Image](https://bcdn.docswell.com/page/GJ553P1PJ4.jpg)

Transit Gateway のユースケース
◆Route 53 ResolverとPrivateLink によるDNS 一元管理
https://aws.amazon.com/jp/blogs/networking-and-content-delivery/centralized-dns-management-of-hybrid-cloud-with-amazonroute-53-and-aws-transit-gateway/


# Page. 27

![Page Image](https://bcdn.docswell.com/page/LE3N6316E5.jpg)

参考URL
◆Next-Generation Networking with AWS Transit Gateway and Shared VPCs
https://medium.com/slalom-technology/next-generation-networking-with-aws-transit-gateway-and-sharedvpcs-9d971d868c65
◆Transit Gateway ECMP for DMZ Deployment Limitation Test Validation
https://docs.aviatrix.com/HowTos/tgw_pan_ecmp.html
◆シングル および マルチホーム環境の BGP のロード シェアリング
https://www.cisco.com/c/ja_jp/support/docs/ip/border-gateway-protocol-bgp/13762-40.html


# Page. 28

![Page Image](https://bcdn.docswell.com/page/8EDWV4XM7G.jpg)

まとめ
◆TGWで複数のルートテーブルによる経路制御
◆TGWの用語4つ
Route Table/Attachments/Associations/Propagations
◆等価コスト マルチパス (ECMP) によるVPN帯域向上


# Page. 29

![Page Image](https://bcdn.docswell.com/page/V7P9VMPQJ8.jpg)

Transit Gateway での経路制御
ご清聴ありがとうございました


