Amazon VPCで複数拠点間接続を試してみた

先月リージョン拡大と共に追加されたAmazon VPCの新機能である、複数拠点接続を試してみた。

ドキュメント

Network Admin Guideこの項目が参考になります。

When you create multiple VPN connections, the Amazon VPC virtual private gateway sends network traffic to the appropriate VPN connection by using Border Gateway Protocol (BGP) route advertisements sent by each customer gateway.

When you have a customer gateway at multiple geographic locations, each customer gateway should advertise a unique set of IP ranges specific to the location. When you establish redundant customer gateways at a single location, both gateways should advertise the same IP ranges.
(参考訳)
複数のVPN コネクションをご利用いただく際には、Amazon VPC バーチャルプライベートゲートウェイは、各カスタマーゲートウェイによって送られるBorder Gateway Protocol(BGP)経路のアドバタイズ情報を利用して適切なVPN コネクションへとネットワークトラフィックを送ります。

もし複数の拠点にカスタマーゲートウェイがある場合、各カスタマーゲートウェイはそのロケーションに固有のIP レンジをアドバタイズしなくてはいけません。

デフォルトのconfigファイルには、

(Cisco)
network 0.0.0.0
(Juniper JunOS)
set policy-options policy-statement EXPORT-DEFAULT term default from route-filter 0.0.0.0/0 exact
(Juniper ScreenOS)
set ipv4 network 0.0.0.0/0
(YAMAHA)
bgp import filter 1 equal 0.0.0.0/0

といったような、0.0.0.0/0をadvertiseするような設定があります。これを各拠点で使用しているCIDRに変更します。

ネットワーク構成

このような構成になりました。

各拠点からVPCへ疎通確認

1812Jからインスタンスpingを打ってみる

1812J#ping 172.21.0.4 source 172.31.1.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.21.0.4, timeout is 2 seconds:
Packet sent with a source address of 172.31.1.254 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/8/8 ms

RTXからインスタンスpingを打ってみる

[RTX]> ping -sa 192.168.1.254 172.21.0.4 
received from 172.21.0.4: icmp_seq=0 ttl=61 time=16.641ms
received from 172.21.0.4: icmp_seq=1 ttl=61 time=16.499ms
received from 172.21.0.4: icmp_seq=2 ttl=61 time=17.002ms
received from 172.21.0.4: icmp_seq=3 ttl=61 time=18.200ms

4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max = 16.499/17.085/18.200 ms

共に疎通があるようです。

拠点間の通信は?

さて、ここで1812JからRTXへは疎通があるのか...

1812J#ping 192.168.1.254 source 172.31.1.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.254, timeout is 2 seconds:
Packet sent with a source address of 172.31.1.254 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/19/20 ms

お、ちゃんと疎通しました!*1
AWSを経由すると転送料に対して課金されてしまうと思うので、拠点間の通信料がそれなりに多い場合には別途直接トンネル張った方がいいと思います。

*1:実はちょっとズルをしました。RTXのBGP経路がなかなか更新されないので、RTX側だけstaticに振りました。