概要
ヤマハルーターをAmazon Virtual Private Cloud(Amazon VPC)に接続するための設定例です。
Amazon VPCは、企業のイントラネットをAmazon Web Services(AWS)に接続するためのVPNの機能を提供しています。
詳細はWebで提供されている技術資料をご覧ください。
検証の環境は次の通りです。
- 機種 : RTX1200
- リビジョン : Rev.10.01.33
- WAN回線 : PPPoE接続
※この文書は、2011年8月5日現在の仕様に基づいています。今後の仕様変更の内容によっては、この文書の方法では接続できない可能性があります。
Amazon VPCの設定
1. ウィザードの開始
「Amazon VPC Console Dashboard」にある「Get started creating a VPC」というボタンを押します。
2. ネットワーク構成の選択
「VPC with a Private Subnet Only and Hardware VPN Access」を選び、「Continue」ボタンを押します。
3. ルーターのIPアドレスの設定
お客様の実際の環境に合わせて、ルーターのWAN側のIPアドレスを入力します。入力したら「Continue」ボタンを押します。
4. 設定の確認
図のように、VPNの設定が表示されます。問題があれば項目を修正します。
今回はデフォルトの設定にしたがい、この表示のままで設定を進めていきます。複数のサブネットを登録することもできますが、今回の検証では1つのサブネットでテストしています。
設定を確認したら「Create VPC」ボタンを押します。
5. VPCの生成
VPCの生成処理が完了すると、図のような画面が表示されますので、「Download Configuration」のボタンを押してください。
6. 設定のダウンロード
設定が済んだら、対応するルーターの設定例をダウンロードしてください。Vendorは「Yamaha」を選択し、「Yes, Download」ボタンを押します。
ルーターの設定
先ほどダウンロードした設定例をルーターに投入し、セーブします。
回線の設定などを含めた全体の設定例は、ここからダウンロードできます。
動作確認
1. IPsecの動作確認
まず、IPsecの動作を確認します。show ipsec saコマンドを実行してください。
# show ipsec sa
Total: isakmp:2 send:2 recv:2
sa sgw isakmp connection dir life[s] remote-id
--------------------------------------------------------------------
1 1 - isakmp - 28779 72.21.209.225
2 2 - isakmp - 28780 72.21.209.193
3 1 1 tun[001]esp send 3581 72.21.209.225
4 1 1 tun[001]esp recv 3581 72.21.209.225
5 2 2 tun[002]esp send 3582 72.21.209.193
6 2 2 tun[002]esp recv 3582 72.21.209.193
SAが何も表示されない場合には、設定を見直してください。
2. BGPの動作確認
show status bgp neighborコマンドで、2つの接続が起動していることを確認してください。正常に動作していれば、下線部のように状態が「Established」という表示になります。
# show status bgp neighbor
BGP neighbor is 169.254.255.1, remote AS 7224, local AS 65000, external link
BGP version 4, remote router ID 169.254.255.1
BGP state = Established, up for 00:01:04
Last read 00:00:06, hold time is 30, keepalive interval is 10 seconds
Received 8 messages, 0 notifications, 0 in queue
Sent 12 messages, 1 notifications, 0 in queue
Connection established 1; dropped 0
Last reset never
Local host: 169.254.255.2, Local port: 1027
Foreign host: 169.254.255.1, Foreign port: 179
BGP neighbor is 169.254.255.5, remote AS 7224, local AS 65000, external link
BGP version 4, remote router ID 169.254.255.5
BGP state = Established, up for 00:00:58
Last read 00:00:09, hold time is 30, keepalive interval is 10 seconds
Received 7 messages, 0 notifications, 0 in queue
Sent 11 messages, 1 notifications, 0 in queue
Connection established 1; dropped 0
Last reset never
Local host: 169.254.255.6, Local port: 1028
Foreign host: 169.254.255.5, Foreign port: 179
表示されない場合は、設定を確認してください。BGPの設定を変更したときには、bgp configure refreshコマンドを必ず実行する必要があります。
3. 経路表の確認
show ip routeコマンドで経路を確認してください。 BGPで受信した経路は、下線部のように「BGP」と表示されます。
# show ip route
Destination Gateway Interface Kind Additional Info.
default - PP[01] static
10.0.0.0/16 169.254.255.1 TUNNEL[1] BGP path=7224
169.254.255.0/30 - TUNNEL[1] implicit
169.254.255.4/30 - TUNNEL[2] implicit
192.168.0.0/24 192.168.0.1 LAN1 implicit
4. 通信の確認
Amazon VPC上のインスタンスに対して、通信できることを確認します。インスタンスの作り方については、Amazon VPCの技術資料を参照してください。インスタンスのIPアドレスに対して、pingコマンドを実行して導通性を確認します。
※pingが通らない場合は、Amazon VPCの「Security Group」の設定で、ICMPの通信を許可していない可能性がありますので、確認してみてください。
# ping 10.0.1.149
received from 10.0.1.149: icmp_seq=0 ttl=61 time=207.543ms
received from 10.0.1.149: icmp_seq=1 ttl=61 time=207.557ms
received from 10.0.1.149: icmp_seq=2 ttl=61 time=207.564ms
received from 10.0.1.149: icmp_seq=3 ttl=61 time=211.124ms
received from 10.0.1.149: icmp_seq=4 ttl=61 time=207.465ms
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max = 207.465/208.250/211.124 ms
5. 冗長化の動作確認
Amazon VPCのゲートウェイがダウンしたときに冗長化が機能するかどうかをチェックします。実際にゲートウェイがダウンするのを待つことはできないので、BGPのパケットを強制的にフィルタリングすることで障害をシミュレートします。
# ip filter 1 reject 169.254.255.1 * tcp bgp *
# ip filter 2 pass * * * * *
# tunnel select 1
# ip tunnel secure filter in 1 2
しばらく待つとBGPのコネクションが切れて、経路が変化します。show ip routeコマンドで経路の変化を確認してください。下線部のように、10.0.0.0/16のゲートウェイが169.254.255.5に変化しました。
# show ip route
Destination Gateway Interface Kind Additional Info.
default - PP[01] static
10.0.0.0/16 169.254.255.5 TUNNEL[2] BGP path=7224
169.254.255.0/30 - TUNNEL[1] implicit
169.254.255.4/30 - TUNNEL[2] implicit
192.168.0.0/24 192.168.0.1 LAN1 implicit
この状態で、インスタンスに対してpingが通ることを確認します。
# ping 10.0.1.149
received from 10.0.1.149: icmp_seq=0 ttl=61 time=202.155ms
received from 10.0.1.149: icmp_seq=1 ttl=61 time=201.853ms
received from 10.0.1.149: icmp_seq=2 ttl=61 time=202.104ms
received from 10.0.1.149: icmp_seq=3 ttl=61 time=202.115ms
received from 10.0.1.149: icmp_seq=4 ttl=61 time=202.244ms
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max = 201.853/202.094/202.244 ms
確認したら、先ほどのフィルタリングの設定を消しておきます。
# no ip filter 1
# no ip filter 2
# tunnel select 1
# no ip tunnel secure filter in
# save
ページトップへ戻る