IBM Cloud: Transit Gatewayを使って異なるアカウント間のClassic Infrastructureを接続する


1. はじめに

過去にTransit Gatewayを使ったアカウント間接続の記事を書いたことがあるが、この時にはClassic Infrastructure同士は接続できなかった。今回新たにClassic Infrastructure同士も接続可能になったため、検証してみた。目指す接続形態はシンプルに以下である。

2. Transit Gatewayの注文

ドキュメントはこちら。Classic InfrastructureはVRFに変更されている必要がある

  1. メニューより、Interconnectivity -> Transit Gatewayより、Create Transit Gatewayを選択。
  2. TransitGatewayの名称を入力して、まずはTransit Gatewayを作成(Connectionはオプションなので後から作成することにする)。今回はLocal Routingを選択した。Classic Infrastructure同士の接続であれば、Classic InfrastructureのDC間が相互に通信可能のなっているため、利用するTransit GatewayがたとえLocal Routingであっても、どこのDCとも通信可能であることが確認できるはずであり、その確認をするためである。

3. Transit Gatewayの設定

作成したTransit Gatewayにconnectionを追加する。以下からAdd connectionを選択。

3.1 自アカウントのClassic Infrastructureへの接続

  • 自アカウントへの接続なので、Add new connection in this account
  • Network Connection: Classic Infrastructure
  • Connection name: 任意

これでaddしてしばらく待っていると、Attached状態になる。

3.2 別アカウントのClassic Infrastructureへの接続

再度Add Connectionを選択。

  • 別アカウントへの接続なので、Request connection to a network in another account
  • Network Connection: Classic Infrastructure
  • Cloud Account ID: 接続先アカウントにて、Manage -> Account -> Account Settingsで表示されるIDを入力する。
  • Connection name: 任意

これでaddすると、以下のようにpending approval状態になる。

3-3. 接続先アカウントでの承認処理

接続先アカウントでは、以下のようにconnection requestが来ている。

  1. 対象のTransit Gatewayを選択する。
  2. Approveを押下。
  3. もう一度Approveを押下。
  4. 1-2分待っていると、Attached状態になる。

元アカウントの方でもAttached状態になっている。

4. TOK02のVSIからの接続テスト

  • Classic InfrastructureのVSIは10.0.0.0/8宛のパケットはBCRに転送されるようにstatic routingの構成が行われているため、特にrouting設定は必要ない。
  • IPアドレスのバッティングもない

ため、security groupなどでblockされていない限りは特に追加設定なしに接続が可能。
以下の検証では自アカウントのTOK02のVSIから、別アカウントの以下のVSIにpingで接続確認してみたが、この結果から分かる通り、Classic Infrastructure同士の接続であれば、Classic InfrastructureのDC間が相互に通信可能のなっているため、利用するTransit GatewayがたとえLocal Routingであっても、どこのDCとも通信可能であることが確認できた。

  • 接続元VSI(自アカウント)
  • 接続先VSI(別アカウント)

4-1. TOK02のVSI(自アカウント) -> TOK02のVSI(別アカウント): 接続可能

[root@syasudacentos7 ~]# ping 10.132.100.77 -c 3
PING 10.132.100.77 (10.132.100.77) 56(84) bytes of data.
64 bytes from 10.132.100.77: icmp_seq=1 ttl=59 time=0.644 ms
64 bytes from 10.132.100.77: icmp_seq=2 ttl=59 time=0.672 ms
64 bytes from 10.132.100.77: icmp_seq=3 ttl=59 time=0.794 ms

--- 10.132.100.77 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.644/0.703/0.794/0.068 ms

4-2. TOK02のVSI(自アカウント) -> TOK05のVSI(別アカウント): 接続可能

[root@syasudacentos7 ~]# ping 10.193.131.2 -c 3
PING 10.193.131.2 (10.193.131.2) 56(84) bytes of data.
64 bytes from 10.193.131.2: icmp_seq=1 ttl=55 time=2.41 ms
64 bytes from 10.193.131.2: icmp_seq=2 ttl=55 time=1.55 ms
64 bytes from 10.193.131.2: icmp_seq=3 ttl=55 time=1.53 ms

--- 10.193.131.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.535/1.832/2.412/0.411 ms

4-3. TOK02のVSI(自アカウント) -> OSK21のVSI(別アカウント): 接続可能

[root@syasudacentos7 ~]# ping 10.8.38.158 -c 3
PING 10.8.38.158 (10.8.38.158) 56(84) bytes of data.
64 bytes from 10.8.38.158: icmp_seq=1 ttl=54 time=9.22 ms
64 bytes from 10.8.38.158: icmp_seq=2 ttl=54 time=8.34 ms
64 bytes from 10.8.38.158: icmp_seq=3 ttl=54 time=8.35 ms

--- 10.8.38.158 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 8.345/8.642/9.226/0.426 ms

4-4. TOK02のVSI(自アカウント) -> SNG01のVSI(別アカウント): 接続可能

[root@syasudacentos7 ~]# ping 10.117.155.77 -c 3
PING 10.117.155.77 (10.117.155.77) 56(84) bytes of data.
64 bytes from 10.117.155.77: icmp_seq=1 ttl=53 time=69.7 ms
64 bytes from 10.117.155.77: icmp_seq=2 ttl=53 time=68.7 ms
64 bytes from 10.117.155.77: icmp_seq=3 ttl=53 time=68.8 ms

--- 10.117.155.77 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 68.784/69.123/69.768/0.504 ms

5. HKG02のVSIからの接続テスト

  • 接続元VSI(自アカウント)
  • 接続先VSI(別アカウント)

5-1. HKG02のVSI(自アカウント) -> TOK02のVSI(別アカウント): 接続可能

[root@syasudahkg ~]# ping 10.132.100.77 -c 3
PING 10.132.100.77 (10.132.100.77) 56(84) bytes of data.
64 bytes from 10.132.100.77: icmp_seq=1 ttl=54 time=58.5 ms
64 bytes from 10.132.100.77: icmp_seq=2 ttl=54 time=52.9 ms
64 bytes from 10.132.100.77: icmp_seq=3 ttl=54 time=52.9 ms

--- 10.132.100.77 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 52.905/54.810/58.558/2.650 ms

5-2. HKG02のVSI(自アカウント) -> TOK05のVSI(別アカウント): 接続可能

[root@syasudahkg ~]# ping 10.193.131.2 -c 3
PING 10.193.131.2 (10.193.131.2) 56(84) bytes of data.
64 bytes from 10.193.131.2: icmp_seq=1 ttl=54 time=54.5 ms
64 bytes from 10.193.131.2: icmp_seq=2 ttl=54 time=59.2 ms
64 bytes from 10.193.131.2: icmp_seq=3 ttl=54 time=45.2 ms

--- 10.193.131.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 45.209/52.985/59.221/5.829 ms

5-3. HKG02のVSI(自アカウント) -> OSK21のVSI(別アカウント): 接続可能

[root@syasudahkg ~]# ping 10.8.38.158 -c 3
PING 10.8.38.158 (10.8.38.158) 56(84) bytes of data.
64 bytes from 10.8.38.158: icmp_seq=1 ttl=49 time=79.1 ms
64 bytes from 10.8.38.158: icmp_seq=2 ttl=49 time=65.9 ms
64 bytes from 10.8.38.158: icmp_seq=3 ttl=49 time=69.0 ms

--- 10.8.38.158 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 65.958/71.402/79.171/5.643 ms

5-4. HKG02のVSI(自アカウント) -> SNG01のVSI(別アカウント): 接続可能

RTTが150msec近いのは、TGWが東京にあるためHKG02 -> Tokyo -> SNG01という通信になっているためだと思われる。

[root@syasudahkg ~]# ping 10.117.155.77 -c 3
PING 10.117.155.77 (10.117.155.77) 56(84) bytes of data.
64 bytes from 10.117.155.77: icmp_seq=1 ttl=43 time=156 ms
64 bytes from 10.117.155.77: icmp_seq=2 ttl=43 time=152 ms
64 bytes from 10.117.155.77: icmp_seq=3 ttl=43 time=146 ms

--- 10.117.155.77 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 146.183/151.728/156.981/4.413 ms