週末趣味のAWS
Transit Gateway での経路制御
免責事項
本資料並びにセッションでの発言は私個人の調査や情報
収集および実践に基づいて構成したものです
したがって所属企業やAWS等、私個人以外の如何なるも
のの意見を代表するものではありません
本セッションでの内容に起因して損害が生じた場合におい
ても、発表者はその責任を負うことができません
氏名:難波 和生
株式会社リゾーム 所属
Twitter:@kazu_0
職業:情シス管理者
:サーバ・NWのインフラ担当
:レイヤー 0~4 までの人です
好きなAWSサービス
:Transit Gateway/VPC/DX
:Global Accelerator
Transit Gateway とは
• Amazon Virtual Private Cloud (VPC) や
オンプレミスネットワーク(VPN・DX GW)を
単一のゲートウェイに接続できるようにするサービス
今まで TGW
メッシュ型 スター型
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
Transit Gateway の特徴
• 異なるAWS アカウントの VPC を接続できる
• AWS アカウント A が作成した Transit Gateway に
AWS アカウント B と C の VPC を接続
例:自社AWSアカウントのTGWへ
お客様AWSアカウントのVPCや
オンプレミス環境をVPN接続
Transit Gateway の特徴
• 複数のルートテーブルを持てる
• VRF【 Virtual Routing and Forwarding 】に近いイメージ
複数の経路表を構成することができる
Transit Gateway の用語
• Route Table
• Attachments
• Associations
• Propagations
Transit Gateway の用語
• Route Table
• ルートテーブル:経路表 (複数のRTを設定可能)
• Attachments
• Transit GatewayにVPC/VPN/DX-GWを「アタッチ:接続」
• Associations
• 接続したAttachmentsを 1つの ルートテーブル へ「関連付け」
• Propagations
• 複数 ルートテーブル へ接続したAttachmentsの「経路を伝搬」
Transit Gateway 経路制御のシナリオ
自社アカウント
• AWSアカウント A
• 顧客向け WEBサービス を展開している
• AWSアカウント B
• アカウント A のWEBサービスとデータ連携する自社サービスが稼働している
• サービス提供にはステートレス 通信が必要
お客様アカウント
• AWSアカウント C
• アカウント A の WEBサービスとVPCで稼働する売管システムとのデータ連係
• VPN 接続
• アカウント A の WEBサービスへオンプレミスから使用
• オンプレミスで稼働する売上管理システムとのデータ連係
AWSアカウント C と VPN接続 の通信はNG
シナリオの 構成図
AWSアカウントA AWSアカウントB
Transit Gateway
Account-A
Destination Target
172.28.0.0/14 TGW
10.1.0.0/16 TGW
172.28.0.0/16 local
Destination Target
172.28.0.0/14 TGW
172.29.0.0/16 Local
VPC-A VPC-B
VPC-C
Destination Target
172.28.0.0/14 TGW
172.30.0.0/16 local
Attachments B
VPC-B Route table
VPC-C Route table
VPC-A Route table
Attachments A
Attachments C Attachments VPN
VPN
Destination Target
BGP received-
routes
TGW
10.1.1.0/24 local
on-premise Route table
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アカウントC オンプレ VPN接続
シナリオの 構成図
AWSアカウントA AWSアカウントB
Transit Gateway
Account-A
Destination Target
172.28.0.0/14 TGW
10.1.0.0/16 TGW
172.28.0.0/16 local
Destination Target
172.28.0.0/14 TGW
172.29.0.0/16 Local
VPC-A VPC-B
VPC-C
Destination Target
172.28.0.0/14 TGW
172.30.0.0/16 local
Attachments B
VPC-B Route table
VPC-C Route table
VPC-A Route table
Attachments A
Attachments C Attachments VPN
VPN
Destination Target
BGP received-
routes
TGW
10.1.1.0/24 local
on-premise Route table
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アカウントC オンプレ VPN接続
Common Service RT
172.28.0.0/16 Via Attachments A
シナリオの 構成例
AWSアカウントA AWSアカウントB
Transit Gateway
Account-A
Destination Target
172.28.0.0/14 TGW
10.1.0.0/16 TGW
172.28.0.0/16 local
Destination Target
172.28.0.0/14 TGW
172.29.0.0/16 Local
VPC-A VPC-B
VPC-C
Destination Target
172.28.0.0/14 TGW
172.30.0.0/16 local
Attachments B
VPC-B Route table
VPC-C Route table
VPC-A Route table
Attachments A
Attachments C Attachments VPN
VPN
Destination Target
BGP received-
routes
TGW
10.1.1.0/24 local
on-premise Route table
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アカウントC オンプレ 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
Transit Gateway の注意点
TGW環境作成時
• TGW-RTで経路制御したい時は
下記2つのチェックを外す
• Default route table association
• Default route table propagation
• TGW作成後に外すことができないので
修正には環境の再作成が必要
Transit Gateway の注意点
VPCのルーティングテーブル
• TGWへ向かう戻り経路をVPCのRTに設定必要
VPNのルーティングテーブル
• CGWはBGPでTGWへ向かう戻り経路を学習
• オンプレミス側の経路にTGWへ向かう経路を再広報
シナリオの 構成図(再掲)
AWSアカウントA AWSアカウントB
Transit Gateway
Account-A
Destination Target
172.28.0.0/14 TGW
10.1.0.0/16 TGW
172.28.0.0/16 local
Destination Target
172.28.0.0/14 TGW
172.29.0.0/16 Local
VPC-A VPC-B
VPC-C
Destination Target
172.28.0.0/14 TGW
172.30.0.0/16 local
Attachments B
VPC-B Route table
VPC-C Route table
VPC-A Route table
Attachments A
Attachments C Attachments VPN
VPN
Destination Target
BGP received-
routes
TGW
10.1.1.0/24 local
on-premise Route table
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アカウントC オンプレ VPN接続
Transit Gateway の注意点
アドレス重複を避けるIPアドレス設計
Longest match での重複回避も検討
ステートレス通信のみの場合は
Private Linkの使用を検討
Transit Gateway の注意点
リージョン越えできない(2019年8月現在)
• TGW単体ではクロスリージョン構成はできません
コスト面の話
• 通常の VPN接続(VPC S2S VPN)よりコスト高い
• トータルコスト = VPN接続 料金 + TGW 使用料
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.
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
Transit Gateway のユースケース
等価コスト マルチパス (ECMP) によるVPN帯域向上
Direct Connect のバックアップ回線
FSx for Windows File Server の閉域アクセス回線
Transit Gateway のユースケース
等価コスト マルチパス (ECMP) によるVPN帯域向上
AMC でのECMP 経路確認
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 0 i
*> 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
*> 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
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
!
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
Transit Gateway のユースケース
Route 53 ResolverとPrivateLink によるDNS 一元管理
https://aws.amazon.com/jp/blogs/networking-and-content-delivery/centralized-dns-management-of-hybrid-cloud-with-amazon-
route-53-and-aws-transit-gateway/
参考URL
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
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
まとめ
TGWで複数のルートテーブルによる経路制御
TGWの用語4つ
Route Table/Attachments/Associations/Propagations
等価コスト マルチパス (ECMP) によるVPN帯域向上
ご清聴ありがとうございました
Transit Gateway での経路制御

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

  • 1.
  • 2.
  • 3.
  • 4.
    Transit Gateway とは •Amazon Virtual Private Cloud (VPC) や オンプレミスネットワーク(VPN・DX GW)を 単一のゲートウェイに接続できるようにするサービス 今まで TGW メッシュ型 スター型
  • 5.
    Transit Gateway とは Next-GenerationNetworking with AWS Transit Gateway and Shared VPCs https://medium.com/slalom-technology/next-generation-networking-with-aws-transit-gateway-and-shared-vpcs-9d971d868c65
  • 6.
    Transit Gateway の特徴 •異なるAWS アカウントの VPC を接続できる • AWS アカウント A が作成した Transit Gateway に AWS アカウント B と C の VPC を接続 例:自社AWSアカウントのTGWへ お客様AWSアカウントのVPCや オンプレミス環境をVPN接続
  • 7.
    Transit Gateway の特徴 •複数のルートテーブルを持てる • VRF【 Virtual Routing and Forwarding 】に近いイメージ 複数の経路表を構成することができる
  • 8.
    Transit Gateway の用語 •Route Table • Attachments • Associations • Propagations
  • 9.
    Transit Gateway の用語 •Route Table • ルートテーブル:経路表 (複数のRTを設定可能) • Attachments • Transit GatewayにVPC/VPN/DX-GWを「アタッチ:接続」 • Associations • 接続したAttachmentsを 1つの ルートテーブル へ「関連付け」 • Propagations • 複数 ルートテーブル へ接続したAttachmentsの「経路を伝搬」
  • 10.
    Transit Gateway 経路制御のシナリオ 自社アカウント •AWSアカウント A • 顧客向け WEBサービス を展開している • AWSアカウント B • アカウント A のWEBサービスとデータ連携する自社サービスが稼働している • サービス提供にはステートレス 通信が必要 お客様アカウント • AWSアカウント C • アカウント A の WEBサービスとVPCで稼働する売管システムとのデータ連係 • VPN 接続 • アカウント A の WEBサービスへオンプレミスから使用 • オンプレミスで稼働する売上管理システムとのデータ連係 AWSアカウント C と VPN接続 の通信はNG
  • 11.
    シナリオの 構成図 AWSアカウントA AWSアカウントB TransitGateway Account-A Destination Target 172.28.0.0/14 TGW 10.1.0.0/16 TGW 172.28.0.0/16 local Destination Target 172.28.0.0/14 TGW 172.29.0.0/16 Local VPC-A VPC-B VPC-C Destination Target 172.28.0.0/14 TGW 172.30.0.0/16 local Attachments B VPC-B Route table VPC-C Route table VPC-A Route table Attachments A Attachments C Attachments VPN VPN Destination Target BGP received- routes TGW 10.1.1.0/24 local on-premise Route table 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アカウントC オンプレ VPN接続
  • 12.
    シナリオの 構成図 AWSアカウントA AWSアカウントB TransitGateway Account-A Destination Target 172.28.0.0/14 TGW 10.1.0.0/16 TGW 172.28.0.0/16 local Destination Target 172.28.0.0/14 TGW 172.29.0.0/16 Local VPC-A VPC-B VPC-C Destination Target 172.28.0.0/14 TGW 172.30.0.0/16 local Attachments B VPC-B Route table VPC-C Route table VPC-A Route table Attachments A Attachments C Attachments VPN VPN Destination Target BGP received- routes TGW 10.1.1.0/24 local on-premise Route table 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アカウントC オンプレ VPN接続 Common Service RT 172.28.0.0/16 Via Attachments A
  • 13.
    シナリオの 構成例 AWSアカウントA AWSアカウントB TransitGateway Account-A Destination Target 172.28.0.0/14 TGW 10.1.0.0/16 TGW 172.28.0.0/16 local Destination Target 172.28.0.0/14 TGW 172.29.0.0/16 Local VPC-A VPC-B VPC-C Destination Target 172.28.0.0/14 TGW 172.30.0.0/16 local Attachments B VPC-B Route table VPC-C Route table VPC-A Route table Attachments A Attachments C Attachments VPN VPN Destination Target BGP received- routes TGW 10.1.1.0/24 local on-premise Route table 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アカウントC オンプレ 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
  • 14.
    Transit Gateway の注意点 TGW環境作成時 •TGW-RTで経路制御したい時は 下記2つのチェックを外す • Default route table association • Default route table propagation • TGW作成後に外すことができないので 修正には環境の再作成が必要
  • 15.
    Transit Gateway の注意点 VPCのルーティングテーブル •TGWへ向かう戻り経路をVPCのRTに設定必要 VPNのルーティングテーブル • CGWはBGPでTGWへ向かう戻り経路を学習 • オンプレミス側の経路にTGWへ向かう経路を再広報
  • 16.
    シナリオの 構成図(再掲) AWSアカウントA AWSアカウントB TransitGateway Account-A Destination Target 172.28.0.0/14 TGW 10.1.0.0/16 TGW 172.28.0.0/16 local Destination Target 172.28.0.0/14 TGW 172.29.0.0/16 Local VPC-A VPC-B VPC-C Destination Target 172.28.0.0/14 TGW 172.30.0.0/16 local Attachments B VPC-B Route table VPC-C Route table VPC-A Route table Attachments A Attachments C Attachments VPN VPN Destination Target BGP received- routes TGW 10.1.1.0/24 local on-premise Route table 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アカウントC オンプレ VPN接続
  • 17.
    Transit Gateway の注意点 アドレス重複を避けるIPアドレス設計 Longestmatch での重複回避も検討 ステートレス通信のみの場合は Private Linkの使用を検討
  • 18.
    Transit Gateway の注意点 リージョン越えできない(2019年8月現在) •TGW単体ではクロスリージョン構成はできません コスト面の話 • 通常の VPN接続(VPC S2S VPN)よりコスト高い • トータルコスト = VPN接続 料金 + TGW 使用料
  • 19.
    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.
  • 20.
    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
  • 21.
    Transit Gateway のユースケース 等価コストマルチパス (ECMP) によるVPN帯域向上 Direct Connect のバックアップ回線 FSx for Windows File Server の閉域アクセス回線
  • 22.
    Transit Gateway のユースケース 等価コストマルチパス (ECMP) によるVPN帯域向上 AMC でのECMP 経路確認
  • 23.
    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 0 i *> 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 *> 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
  • 24.
    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 !
  • 25.
    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
  • 26.
    Transit Gateway のユースケース Route53 ResolverとPrivateLink によるDNS 一元管理 https://aws.amazon.com/jp/blogs/networking-and-content-delivery/centralized-dns-management-of-hybrid-cloud-with-amazon- route-53-and-aws-transit-gateway/
  • 27.
    参考URL Next-Generation Networking withAWS Transit Gateway and Shared VPCs https://medium.com/slalom-technology/next-generation-networking-with-aws-transit-gateway-and-shared- vpcs-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
  • 28.
  • 29.