

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS Site-to-Site VPN カスタマーゲートウェイデバイスのトラブルシューティング
<a name="Troubleshooting"></a>

カスタマーゲートウェイデバイスの問題をトラブルシューティングするときは、構造化されたアプローチを取ることが重要です。このセクションの最初の 2 つのトピックでは、動的ルーティング用に設定されたデバイス (BGP が有効) と静的ルーティング用に設定されたデバイス (BGP が有効でない) をそれぞれ使用する際の問題をトラブルシューティングするための一般的なフローチャートを提供します。これらのトピックでは、Cisco、Juniper、および Yamaha カスタマーゲートウェイデバイス向けのデバイス固有のトラブルシューティングガイドについて説明します。

このセクションのトピック以外にも、[AWS Site-to-Site VPN ログ](monitoring-logs.md) を有効にすると、VPN 接続の問題のトラブルシューティングや解決に非常に役立つ場合があります。一般的なテストの説明については、「[AWS Site-to-Site VPN 接続をテストする](HowToTestEndToEnd_Linux.md)」も参照してください。



**Topics**
+ [BGP を使用するデバイス](Generic_Troubleshooting.md)
+ [BGP なしのデバイス](Generic_Troubleshooting_noBGP.md)
+ [Cisco ASA](Cisco_ASA_Troubleshooting.md)
+ [Cisco IOS](Cisco_Troubleshooting.md)
+ [BGP なしの Cisco IOS](Cisco_Troubleshooting_NoBGP.md)
+ [Juniper JunOS](Juniper_Troubleshooting.md)
+ [Juniper ScreenOS](Juniper_ScreenOs_Troubleshooting.md)
+ [Yamaha](Yamaha_Troubleshooting.md)

**その他のリソース**
+ [Amazon VPC フォーラム](https://repost.aws/tags/TATGuEiYydTVCPMhSnXFN6gA/amazon-vpc)

# ボーダーゲートウェイプロトコルを使用する際 AWS Site-to-Site VPN の接続のトラブルシューティング
<a name="Generic_Troubleshooting"></a>

次の図と表は、ボーダーゲートウェイプロトコル (BGP) を使用するカスタマーゲートウェイデバイスをトラブルシューティングする、一般的な手順を示しています。また、デバイスのデバッグ機能を有効にすることをお勧めします。詳細については、ゲートウェイデバイスのベンダーに問い合わせてください。

![\[一般的なカスタマーゲートウェイデバイスをトラブルシューティングするためのフローチャート\]](http://docs.aws.amazon.com/ja_jp/vpn/latest/s2svpn/images/troubleshooting-cgw-flow-diagram.png)



|  |  | 
| --- |--- |
| IKE |  IKE Security Association が存在するかどうかを確認します。 IKE Security Association は、IPsec Security Association を確立するために使用されるキーの交換に必要です。 IKE Security Association がない場合は、IKE 設定を確認します。設定ファイルに示されている、暗号化、認証、Perfect Forward Secrecy、およびモードのパラメータを設定する必要があります。 IKE Security Association が存在する場合は、「IPsec」に進みます。  | 
| IPsec |  IPsec Security Association (SA) が存在するかどうかを確認します。 IPsec SA はトンネル自体です。カスタマーゲートウェイデバイスにクエリを実行し、IPsec SA がアクティブかどうかを確認します。設定ファイルに示されている、暗号化、認証、Perfect Forward Secrecy、およびモードのパラメータが設定されていることを確認します。 IPsec SA が存在しない場合は、IPsec 設定を確認します。 IPsec SA が存在する場合は、「トンネル」に進みます。  | 
| トンネル |  必須のファイアウォールルールがセットアップされていることを確認します (ルールのリストについては、「[AWS Site-to-Site VPN カスタマーゲートウェイデバイスのファイアウォールルール](FirewallRules.md)」を参照)。セットアップされている場合は、次に進みます。 トンネル経由の IP 接続があるかどうかを確認します。 トンネルのそれぞれの側に、設定ファイルで指定された IP アドレスが含まれます。仮想プライベートゲートウェイアドレスは、BGP ネイバーアドレスとして使用されます。カスタマーゲートウェイデバイスから、このアドレスに対する ping を実行し、IP トラフィックが正しく暗号化および復号化されているかどうかを確認します。 ping が失敗した場合は、トンネルインターフェイス設定を確認し、正しい IP アドレスが設定されていることを確認します。 ping が成功した場合は、「BGP」に進みます。  | 
| BGP |  BGP ピアリングセッションがアクティブかどうかを確認します。 各トンネルについて、以下を実行します。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/vpn/latest/s2svpn/Generic_Troubleshooting.html) トンネルがこの状態にない場合は、BGP 設定を確認します。 BGP ピアが確立された場合は、プレフィックスを受け取り、プレフィックスをアドバタイズして、トンネルが正しく設定されます。両方のトンネルがこの状態であることを確認します。  | 

# ボーダーゲートウェイプロトコルを使用しない AWS Site-to-Site VPN 接続のトラブルシューティング
<a name="Generic_Troubleshooting_noBGP"></a>

次の図と表は、ボーダーゲートウェイプロトコル (BGP) を使用しないカスタマーゲートウェイデバイスをトラブルシューティングする、一般的な手順を示しています。また、デバイスのデバッグ機能を有効にすることをお勧めします。詳細については、ゲートウェイデバイスのベンダーに問い合わせてください。

![\[一般的なカスタマーゲートウェイデバイスをトラブルシューティングするためのフローチャート\]](http://docs.aws.amazon.com/ja_jp/vpn/latest/s2svpn/images/troubleshooting-cgw-flow-nobgp-diagram.png)



|  |  | 
| --- |--- |
| IKE |  IKE Security Association が存在するかどうかを確認します。 IKE Security Association は、IPsec Security Association を確立するために使用されるキーの交換に必要です。 IKE Security Association がない場合は、IKE 設定を確認します。設定ファイルに示されている、暗号化、認証、Perfect Forward Secrecy、およびモードのパラメータを設定する必要があります。 IKE Security Association が存在する場合は、「IPsec」に進みます。  | 
| IPsec |  IPsec Security Association (SA) が存在するかどうかを確認します。 IPsec SA はトンネル自体です。カスタマーゲートウェイデバイスにクエリを実行し、IPsec SA がアクティブかどうかを確認します。設定ファイルに示されている、暗号化、認証、Perfect Forward Secrecy、およびモードのパラメータが設定されていることを確認します。 IPsec SA が存在しない場合は、IPsec 設定を確認します。 IPsec SA が存在する場合は、「トンネル」に進みます。  | 
| トンネル |  必須のファイアウォールルールがセットアップされていることを確認します (ルールのリストについては、「[AWS Site-to-Site VPN カスタマーゲートウェイデバイスのファイアウォールルール](FirewallRules.md)」を参照)。セットアップされている場合は、次に進みます。 トンネル経由の IP 接続があるかどうかを確認します。 トンネルのそれぞれの側に、設定ファイルで指定された IP アドレスが含まれます。仮想プライベートゲートウェイアドレスは、BGP ネイバーアドレスとして使用されます。カスタマーゲートウェイデバイスから、このアドレスに対する ping を実行し、IP トラフィックが正しく暗号化および復号化されているかどうかを確認します。 ping が失敗した場合は、トンネルインターフェイス設定を確認し、正しい IP アドレスが設定されていることを確認します。 ping が成功した場合は、「静的ルート」に進みます。  | 
|  静的ルート  |  各トンネルについて、以下を実行します。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/vpn/latest/s2svpn/Generic_Troubleshooting_noBGP.html) トンネルがこの状態にない場合は、デバイス設定を確認します。 トンネルがいずれもこの状態であることを確認したら、終了です。  | 

# Cisco ASA カスタマーゲートウェイデバイスと AWS Site-to-Site VPN の接続のトラブルシューティング
<a name="Cisco_ASA_Troubleshooting"></a>

Cisco のカスタマーゲートウェイデバイスの接続をトラブルシューティングする場合は、IKE、IPsec、ルーティングを考慮します。これらの領域を任意の順序でトラブルシューティングできますが、IKE から (ネットワークスタックの下から) 開始して上に進むことをお勧めします。

**重要**  
一部の Cisco ASA ではアクティブ/スタンバイモードのみがサポートされています。これらの Cisco ASA を使用する場合は、アクティブなトンネルを一度に 1 個のみ保持できます。最初のトンネルが利用不可になった場合にのみ、他方のスタンバイトンネルがアクティブになります。スタンバイトンネルは、ログファイルで次のエラーを生成する場合がありますが、このエラーは無視できます。`Rejecting IPSec tunnel: no matching crypto map entry for remote proxy 0.0.0.0/0.0.0.0/0/0 local proxy 0.0.0.0/0.0.0.0/0/0 on interface outside`

## IKE
<a name="ASA_IKE"></a>

次のコマンドを使用します。このレスポンスは、IKE が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
ciscoasa# show crypto isakmp sa
```

```
   Active SA: 2
   Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 2

1   IKE Peer: AWS_ENDPOINT_1
    Type    : L2L             Role    : initiator
    Rekey   : no              State   : MM_ACTIVE
```

トンネル内で指定されたリモートゲートウェイの `src` 値を含む 1 つ以上の行が表示されます。`state` は `MM_ACTIVE`、`status` は `ACTIVE` となります。エントリがない場合、またはエントリが別の状態になっている場合は、IKE が正しく設定されていないことを示しています。

さらにトラブルシューティングする場合は、次のコマンドを実行して診断情報を提供するログメッセージを有効にします。

```
router# term mon
router# debug crypto isakmp
```

デバッグを無効にするには、次のコマンドを使用します。

```
router# no debug crypto isakmp
```

## IPsec
<a name="ASA_IPsec"></a>

次のコマンドを使用します。このレスポンスは、IPsec が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
ciscoasa# show crypto ipsec sa
```

```
interface: outside
    Crypto map tag: VPN_crypto_map_name, seq num: 2, local addr: 172.25.50.101

      access-list integ-ppe-loopback extended permit ip any vpc_subnet subnet_mask
      local ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
      remote ident (addr/mask/prot/port): (vpc_subnet/subnet_mask/0/0)
      current_peer: integ-ppe1

      #pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0
      #pkts decaps: 0, #pkts decrypt: 0, #pkts verify: 0
      #pkts compressed: 0, #pkts decompressed: 0
      #pkts not compressed: 0, #pkts comp failed: 0, #pkts decomp failed: 0
      #pre-frag successes: 0, #pre-frag failures: 0, #fragments created: 0
      #PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0
      #send errors: 0, #recv errors: 0

      local crypto endpt.: 172.25.50.101, remote crypto endpt.: AWS_ENDPOINT_1

      path mtu 1500, ipsec overhead 74, media mtu 1500
      current outbound spi: 6D9F8D3B
      current inbound spi : 48B456A6

    inbound esp sas:
      spi: 0x48B456A6 (1219778214)
         transform: esp-aes esp-sha-hmac no compression
         in use settings ={L2L, Tunnel, PFS Group 2, }
         slot: 0, conn_id: 4710400, crypto-map: VPN_cry_map_1
         sa timing: remaining key lifetime (kB/sec): (4374000/3593)
         IV size: 16 bytes
         replay detection support: Y
         Anti replay bitmap:
          0x00000000 0x00000001
    outbound esp sas:
      spi: 0x6D9F8D3B (1839172923)
         transform: esp-aes esp-sha-hmac no compression
         in use settings ={L2L, Tunnel, PFS Group 2, }
         slot: 0, conn_id: 4710400, crypto-map: VPN_cry_map_1
         sa timing: remaining key lifetime (kB/sec): (4374000/3593)
         IV size: 16 bytes
         replay detection support: Y
         Anti replay bitmap:
         0x00000000 0x00000001
```

各トンネルインターフェイスに対して、`inbound esp sas` と `outbound esp sas` がいずれも表示されます。これは、SA が示され (例: `spi: 0x48B456A6`)、IPsec が正しく設定されていることを前提としています。

Cisco ASA では、IPsec は、対象となるトラフィック (暗号化する必要があるトラフィック) が送信された場合にのみ表示されます。IPsec を常にアクティブにするには、SLA モニターを設定することをお勧めします。SLA モニターは、対象となるトラフィックを引き続き送信し、IPsec を常にアクティブにします。

また、次の ping コマンドを使用して、ネゴシエーションを開始して上に移動することを IPsec に強制することもできます。

```
ping ec2_instance_ip_address
```

```
Pinging ec2_instance_ip_address with 32 bytes of data:

Reply from ec2_instance_ip_address: bytes=32 time<1ms TTL=128
Reply from ec2_instance_ip_address: bytes=32 time<1ms TTL=128
Reply from ec2_instance_ip_address: bytes=32 time<1ms TTL=128

Ping statistics for 10.0.0.4:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),

Approximate round trip times in milliseconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
```

さらにトラブルシューティングする場合は、次のコマンドを使用してデバッグを有効にします。

```
router# debug crypto ipsec
```

デバッグを無効にするには、次のコマンドを使用します。

```
router# no debug crypto ipsec
```

## ルーティング
<a name="ASA_Tunnel"></a>

トンネルのもう一方の端で ping を実行します。機能している場合は、IPsec を確立する必要があります。機能していない場合は、アクセスリストを確認し、前の IPsec セクションを参照します。

インスタンスに到達できない場合は、次の情報を確認します。

1. アクセスリストが、暗号化マップに関連付けられたトラフィックを許可するように設定されていることを確認します。

   これを行うには、次のコマンドを実行します。

   ```
   ciscoasa# show run crypto
   ```

   ```
   crypto ipsec transform-set transform-amzn esp-aes esp-sha-hmac
   crypto map VPN_crypto_map_name 1 match address access-list-name
   crypto map VPN_crypto_map_name 1 set pfs
   crypto map VPN_crypto_map_name 1 set peer AWS_ENDPOINT_1 AWS_ENDPOINT_2
   crypto map VPN_crypto_map_name 1 set transform-set transform-amzn
   crypto map VPN_crypto_map_name 1 set security-association lifetime seconds 3600
   ```

1. 次のコマンドを使用して、アクセスリストを確認します。

   ```
   ciscoasa# show run access-list access-list-name
   ```

   ```
   access-list access-list-name extended permit ip any vpc_subnet subnet_mask
   ```

1. アクセスリストが正しいことを確認します。次のアクセスリスト例では、VPC サブネット 10.0.0.0/16 へのすべての内部トラフィックを許可しています。

   ```
   access-list access-list-name extended permit ip any 10.0.0.0 255.255.0.0
   ```

1. Cisco ASA デバイスから traceroute を実行し、Amazon ルーター (たとえば、*AWS\$1ENDPOINT\$11*/*AWS\$1ENDPOINT\$12*) に到達するかどうかを確認します。

   これが Amazon ルーターに到達したら、Amazon VPC コンソールで追加した静的ルートと、特定のインスタンスのセキュリティグループを確認します。

1. さらにトラブルシューティングする場合は、設定を確認します。

## トンネルインターフェイスをバウンスする
<a name="ASA_Tunnel-bounce"></a>

トンネルが稼働しているように見えるものの、トラフィックが適切に流れていない場合、トンネルインターフェイスをバウンスする (無効化および再有効化する) と、接続の問題を解決できることがよくあります。Cisco ASA のトンネルインターフェイスをバウンスするには:

1. 下記を実行します。

   ```
   ciscoasa# conf t
   ciscoasa(config)# interface tunnel X  (where X is your tunnel ID)
   ciscoasa(config-if)# shutdown
   ciscoasa(config-if)# no shutdown
   ciscoasa(config-if)# end
   ```

   または、単一行コマンドを使用できます。

   ```
   ciscoasa# conf t ; interface tunnel X ; shutdown ; no shutdown ; end
   ```

1. インターフェイスをバウンスした後、VPN 接続が再確立されたかどうか、およびトラフィックが正しく流れているかどうかを確認します。

# Cisco IOS カスタマーゲートウェイデバイスと AWS Site-to-Site VPN の接続のトラブルシューティング
<a name="Cisco_Troubleshooting"></a>

Cisco のカスタマーゲートウェイデバイスの接続をトラブルシューティングする場合は、IKE、IPsec、トンネル、BGP の 4 つの要素を考慮します。これらの領域を任意の順序でトラブルシューティングできますが、IKE から (ネットワークスタックの下から) 開始して上に進むことをお勧めします。

## IKE
<a name="IKE"></a>

次のコマンドを使用します。このレスポンスは、IKE が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
router# show crypto isakmp sa
```

```
IPv4 Crypto ISAKMP SA
dst             src             state          conn-id slot status
192.168.37.160  72.21.209.193   QM_IDLE           2001    0 ACTIVE
192.168.37.160  72.21.209.225   QM_IDLE           2002    0 ACTIVE
```

トンネル内で指定されたリモートゲートウェイの `src` 値を含む 1 つ以上の行が表示されます。`state` は `QM_IDLE`、`status` は `ACTIVE` となります。エントリがない場合、またはエントリが別の状態になっている場合は、IKE が正しく設定されていないことを示しています。

さらにトラブルシューティングする場合は、次のコマンドを実行して診断情報を提供するログメッセージを有効にします。

```
router# term mon
router# debug crypto isakmp
```

デバッグを無効にするには、次のコマンドを使用します。

```
router# no debug crypto isakmp
```

## IPsec
<a name="IPsec"></a>

次のコマンドを使用します。このレスポンスは、IPsec が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
router# show crypto ipsec sa
```

```
interface: Tunnel1
    Crypto map tag: Tunnel1-head-0, local addr 192.168.37.160

    protected vrf: (none)
    local  ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
    remote ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
    current_peer 72.21.209.225 port 500
     PERMIT, flags={origin_is_acl,}
     #pkts encaps: 149, #pkts encrypt: 149, #pkts digest: 149
     #pkts decaps: 146, #pkts decrypt: 146, #pkts verify: 146
     #pkts compressed: 0, #pkts decompressed: 0
     #pkts not compressed: 0, #pkts compr. failed: 0
     #pkts not decompressed: 0, #pkts decompress failed: 0
     #send errors 0, #recv errors 0

     local crypto endpt.: 174.78.144.73, remote crypto endpt.: 72.21.209.225
     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0
     current outbound spi: 0xB8357C22(3090512930)

     inbound esp sas:
      spi: 0x6ADB173(112046451)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 1, flow_id: Motorola SEC 2.0:1, crypto map: Tunnel1-head-0
       sa timing: remaining key lifetime (k/sec): (4467148/3189)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0xB8357C22(3090512930)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 2, flow_id: Motorola SEC 2.0:2, crypto map: Tunnel1-head-0
       sa timing: remaining key lifetime (k/sec): (4467148/3189)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:

interface: Tunnel2
     Crypto map tag: Tunnel2-head-0, local addr 174.78.144.73

     protected vrf: (none)
     local  ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
     remote ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
     current_peer 72.21.209.193 port 500
      PERMIT, flags={origin_is_acl,}
     #pkts encaps: 26, #pkts encrypt: 26, #pkts digest: 26
     #pkts decaps: 24, #pkts decrypt: 24, #pkts verify: 24
     #pkts compressed: 0, #pkts decompressed: 0
     #pkts not compressed: 0, #pkts compr. failed: 0
     #pkts not decompressed: 0, #pkts decompress failed: 0
     #send errors 0, #recv errors 0

     local crypto endpt.: 174.78.144.73, remote crypto endpt.: 72.21.209.193
     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0
     current outbound spi: 0xF59A3FF6(4120526838)

     inbound esp sas:
      spi: 0xB6720137(3060924727)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 3, flow_id: Motorola SEC 2.0:3, crypto map: Tunnel2-head-0
       sa timing: remaining key lifetime (k/sec): (4387273/3492)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0xF59A3FF6(4120526838)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 4, flow_id: Motorola SEC 2.0:4, crypto map: Tunnel2-head-0
       sa timing: remaining key lifetime (k/sec): (4387273/3492)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:
```

各トンネルインターフェイスに対して、`inbound esp sas` と `outbound esp sas` がいずれも表示されます。SA が示され (例: `spi: 0xF95D2F3C`)、`Status` が `ACTIVE` となっていれば、IPsec は正しく設定されています。

さらにトラブルシューティングする場合は、次のコマンドを使用してデバッグを有効にします。

```
router# debug crypto ipsec
```

次のコマンドを使用して、デバッグを無効にします。

```
router# no debug crypto ipsec
```

## トンネル
<a name="Tunnel"></a>

最初に、必要なファイアウォールルールがあることを確認します。詳細については、「[AWS Site-to-Site VPN カスタマーゲートウェイデバイスのファイアウォールルール](FirewallRules.md)」を参照してください。

ファイアウォールルールが正しくセットアップされた場合は、次のコマンドでトラブルシューティングを継続します。

```
router# show interfaces tun1
```

```
Tunnel1 is up, line protocol is up 
  Hardware is Tunnel
  Internet address is 169.254.255.2/30
  MTU 17867 bytes, BW 100 Kbit/sec, DLY 50000 usec, 
    reliability 255/255, txload 2/255, rxload 1/255
  Encapsulation TUNNEL, loopback not set
  Keepalive not set
  Tunnel source 174.78.144.73, destination 72.21.209.225
  Tunnel protocol/transport IPSEC/IP
  Tunnel TTL 255
  Tunnel transport MTU 1427 bytes
  Tunnel transmit bandwidth 8000 (kbps)
  Tunnel receive bandwidth 8000 (kbps)
  Tunnel protection via IPSec (profile "ipsec-vpn-92df3bfb-0")
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/0 (size/max)
  5 minute input rate 0 bits/sec, 1 packets/sec
  5 minute output rate 1000 bits/sec, 1 packets/sec
    407 packets input, 30010 bytes, 0 no buffer
    Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
```

`line protocol` が実行されていることを確認します。トンネルのソース IP アドレス、ソースインターフェイス、および宛先がそれぞれ、IP アドレス外部のカスタマーゲートウェイデバイス、インターフェイス、および IP アドレス外部の仮想プライベートゲートウェイのトンネル設定に対応することを確認します。`Tunnel protection via IPSec` が存在することを確認します。両方のトンネルインターフェイスでコマンドを実行します。問題を解決するには、設定を確認し、カスタマーゲートウェイデバイスへの物理的な接続を確認します。

また、次のコマンドを使用して、`169.254.255.1` を仮想プライベートゲートウェイの内部 IP アドレスで置き換えます。

```
router# ping 169.254.255.1 df-bit size 1410
```

```
Type escape sequence to abort.
Sending 5, 1410-byte ICMP Echos to 169.254.255.1, timeout is 2 seconds:
Packet sent with the DF bit set
!!!!!
```

5 個の感嘆符が表示されます。

さらにトラブルシューティングする場合は、設定を確認します。

## BGP
<a name="BGP"></a>

次のコマンドを使用します。

```
router# show ip bgp summary
```

```
BGP router identifier 192.168.37.160, local AS number 65000
BGP table version is 8, main routing table version 8
2 network entries using 312 bytes of memory
2 path entries using 136 bytes of memory
3/1 BGP path/bestpath attribute entries using 444 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 2) using 32 bytes of memory
BGP using 948 total bytes of memory
BGP activity 4/1 prefixes, 4/1 paths, scan interval 15 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
169.254.255.1   4  7224     363     323        8    0    0 00:54:21        1
169.254.255.5   4  7224     364     323        8    0    0 00:00:24        1
```

両方のネイバーが表示されます。それぞれに対して、`1` の `State/PfxRcd` 値が表示されます。

BGP ピアリングが起動している場合は、カスタマーゲートウェイデバイスが VPC へのデフォルトルート (0.0.0.0/0) をアドバタイズしていることを確認します。

```
router# show bgp all neighbors 169.254.255.1 advertised-routes
```

```
For address family: IPv4 Unicast
BGP table version is 3, local router ID is 174.78.144.73
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
     r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Originating default network 0.0.0.0

Network             Next Hop            Metric   LocPrf Weight Path
*> 10.120.0.0/16    169.254.255.1          100        0   7224    i

Total number of prefixes 1
```

さらに、VPC に対応するプレフィックスを仮想プライベートゲートウェイから受け取っていることを確認します。

```
router# show ip route bgp
```

```
	10.0.0.0/16 is subnetted, 1 subnets
B       10.255.0.0 [20/0] via 169.254.255.1, 00:00:20
```

さらにトラブルシューティングする場合は、設定を確認します。

# ボーダーゲートウェイプロトコルを使用しない Cisco IOS カスタマーゲートウェイデバイス AWS Site-to-Site VPN への接続のトラブルシューティング
<a name="Cisco_Troubleshooting_NoBGP"></a>

Cisco のカスタマーゲートウェイデバイスの接続をトラブルシューティングする場合は、IKE、IPsec、トンネルの 3 つの要素を考慮します。これらの領域を任意の順序でトラブルシューティングできますが、IKE から (ネットワークスタックの下から) 開始して上に進むことをお勧めします。

## IKE
<a name="IOS_NoBGP_IKE"></a>

次のコマンドを使用します。このレスポンスは、IKE が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
router# show crypto isakmp sa
```

```
IPv4 Crypto ISAKMP SA
dst             src             state          conn-id slot status
174.78.144.73 205.251.233.121 QM_IDLE           2001    0 ACTIVE
174.78.144.73 205.251.233.122 QM_IDLE           2002    0 ACTIVE
```

トンネル内で指定されたリモートゲートウェイの `src` 値を含む 1 つ以上の行が表示されます。`state` は `QM_IDLE`、`status` は `ACTIVE` となります。エントリがない場合、またはエントリが別の状態になっている場合は、IKE が正しく設定されていないことを示しています。

さらにトラブルシューティングする場合は、次のコマンドを実行して診断情報を提供するログメッセージを有効にします。

```
router# term mon
router# debug crypto isakmp
```

デバッグを無効にするには、次のコマンドを使用します。

```
router# no debug crypto isakmp
```

## IPsec
<a name="IOS_NoBGP_IPsec"></a>

次のコマンドを使用します。このレスポンスは、IPsec が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
router# show crypto ipsec sa
```

```
interface: Tunnel1
    Crypto map tag: Tunnel1-head-0, local addr 174.78.144.73

    protected vrf: (none)
    local  ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
    remote ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
    current_peer 72.21.209.225 port 500
     PERMIT, flags={origin_is_acl,}
     #pkts encaps: 149, #pkts encrypt: 149, #pkts digest: 149
     #pkts decaps: 146, #pkts decrypt: 146, #pkts verify: 146
     #pkts compressed: 0, #pkts decompressed: 0
     #pkts not compressed: 0, #pkts compr. failed: 0
     #pkts not decompressed: 0, #pkts decompress failed: 0
     #send errors 0, #recv errors 0

     local crypto endpt.: 174.78.144.73, remote crypto endpt.:205.251.233.121
     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0
     current outbound spi: 0xB8357C22(3090512930)

     inbound esp sas:
      spi: 0x6ADB173(112046451)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 1, flow_id: Motorola SEC 2.0:1, crypto map: Tunnel1-head-0
       sa timing: remaining key lifetime (k/sec): (4467148/3189)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0xB8357C22(3090512930)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 2, flow_id: Motorola SEC 2.0:2, crypto map: Tunnel1-head-0
       sa timing: remaining key lifetime (k/sec): (4467148/3189)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:

interface: Tunnel2
     Crypto map tag: Tunnel2-head-0, local addr 205.251.233.122

     protected vrf: (none)
     local  ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
     remote ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)
     current_peer 72.21.209.193 port 500
      PERMIT, flags={origin_is_acl,}
     #pkts encaps: 26, #pkts encrypt: 26, #pkts digest: 26
     #pkts decaps: 24, #pkts decrypt: 24, #pkts verify: 24
     #pkts compressed: 0, #pkts decompressed: 0
     #pkts not compressed: 0, #pkts compr. failed: 0
     #pkts not decompressed: 0, #pkts decompress failed: 0
     #send errors 0, #recv errors 0

     local crypto endpt.: 174.78.144.73, remote crypto endpt.:205.251.233.122
     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0
     current outbound spi: 0xF59A3FF6(4120526838)

     inbound esp sas:
      spi: 0xB6720137(3060924727)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 3, flow_id: Motorola SEC 2.0:3, crypto map: Tunnel2-head-0
       sa timing: remaining key lifetime (k/sec): (4387273/3492)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     inbound ah sas:

     inbound pcp sas:

     outbound esp sas:
      spi: 0xF59A3FF6(4120526838)
       transform: esp-aes esp-sha-hmac ,
       in use settings ={Tunnel, }
       conn id: 4, flow_id: Motorola SEC 2.0:4, crypto map: Tunnel2-head-0
       sa timing: remaining key lifetime (k/sec): (4387273/3492)
       IV size: 16 bytes
       replay detection support: Y  replay window size: 128
       Status: ACTIVE

     outbound ah sas:

     outbound pcp sas:
```

各トンネルインターフェイスに対して、インバウンドの `esp sas` とアウトバウンドの `esp sas` がいずれも表示されます。これは、SA が示され (例: `spi: 0x48B456A6`)、ステータスが `ACTIVE` で、IPsec が正しく設定されていることを前提としています。

さらにトラブルシューティングする場合は、次のコマンドを使用してデバッグを有効にします。

```
router# debug crypto ipsec
```

デバッグを無効にするには、次のコマンドを使用します。

```
router# no debug crypto ipsec
```

## トンネル
<a name="IOS_NoBGP_tunnel"></a>

最初に、必要なファイアウォールルールがあることを確認します。詳細については、「[AWS Site-to-Site VPN カスタマーゲートウェイデバイスのファイアウォールルール](FirewallRules.md)」を参照してください。

ファイアウォールルールが正しくセットアップされた場合は、次のコマンドでトラブルシューティングを継続します。

```
router# show interfaces tun1
```

```
Tunnel1 is up, line protocol is up 
  Hardware is Tunnel
  Internet address is 169.254.249.18/30
  MTU 17867 bytes, BW 100 Kbit/sec, DLY 50000 usec, 
    reliability 255/255, txload 2/255, rxload 1/255
  Encapsulation TUNNEL, loopback not set
  Keepalive not set
  Tunnel source 174.78.144.73, destination 205.251.233.121
  Tunnel protocol/transport IPSEC/IP
  Tunnel TTL 255
  Tunnel transport MTU 1427 bytes
  Tunnel transmit bandwidth 8000 (kbps)
  Tunnel receive bandwidth 8000 (kbps)
  Tunnel protection via IPSec (profile "ipsec-vpn-92df3bfb-0")
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/0 (size/max)
  5 minute input rate 0 bits/sec, 1 packets/sec
  5 minute output rate 1000 bits/sec, 1 packets/sec
    407 packets input, 30010 bytes, 0 no buffer
    Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
```

line protocol が実行されていることを確認します。トンネルのソース IP アドレス、ソースインターフェイス、および宛先がそれぞれ、IP アドレス外部のカスタマーゲートウェイデバイス、インターフェイス、および IP アドレス外部の仮想プライベートゲートウェイのトンネル設定に対応することを確認します。`Tunnel protection through IPSec` が存在することを確認します。両方のトンネルインターフェイスでコマンドを実行します。問題を解決するには、設定を確認し、カスタマーゲートウェイデバイスへの物理的な接続を確認します。

また、次のコマンドを使用して、`169.254.249.18` を仮想プライベートゲートウェイの内部 IP アドレスで置き換えます。

```
router# ping 169.254.249.18 df-bit size 1410
```

```
Type escape sequence to abort.
Sending 5, 1410-byte ICMP Echos to 169.254.249.18, timeout is 2 seconds:
Packet sent with the DF bit set
!!!!!
```

5 個の感嘆符が表示されます。

### ルーティング
<a name="IOS_NoBGP_routing"></a>

静的ルートテーブルを表示するには、次のコマンドを使用します。

```
router# sh ip route static
```

```
     1.0.0.0/8 is variably subnetted
S       10.0.0.0/16 is directly connected, Tunnel1
is directly connected, Tunnel2
```

両方のトンネルを経由した VPC CIDR の静的ルートが存在していることを確認します。存在しない場合は、次に示すように静的ルートを追加します。

```
router# ip route 10.0.0.0 255.255.0.0 Tunnel1 track 100 
router# ip route 10.0.0.0 255.255.0.0 Tunnel2 track 200
```

### SLA モニターの確認
<a name="IOS_NoBGP_sla"></a>

```
router# show ip sla statistics 100
```

```
IPSLAs Latest Operation Statistics

IPSLA operation id: 100
        Latest RTT: 128 milliseconds
Latest operation start time: *18:08:02.155 UTC Wed Jul  15 2012
Latest operation return code: OK
Number of successes: 3
Number of failures: 0
Operation time to live: Forever
```

```
router# show ip sla statistics 200
```

```
IPSLAs Latest Operation Statistics

IPSLA operation id: 200
        Latest RTT: 128 milliseconds
Latest operation start time: *18:08:02.155 UTC Wed Jul  15 2012
Latest operation return code: OK
Number of successes: 3
Number of failures: 0
Operation time to live: Forever
```

`Number of successes` の値は、SLA モニターが正常にセットアップされたかどうかを示します。

さらにトラブルシューティングする場合は、設定を確認します。

# Juniper JunOS カスタマーゲートウェイデバイスと AWS Site-to-Site VPN の接続のトラブルシューティング
<a name="Juniper_Troubleshooting"></a>

Juniper のカスタマーゲートウェイデバイスの接続をトラブルシューティングする場合は、IKE、IPsec、トンネル、BGP の 4 つの要素を考慮します。これらの領域を任意の順序でトラブルシューティングできますが、IKE から (ネットワークスタックの下から) 開始して上に進むことをお勧めします。

## IKE
<a name="IKETroubleshooting"></a>

次のコマンドを使用します。このレスポンスは、IKE が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
user@router> show security ike security-associations
```

```
Index   Remote Address  State  Initiator cookie  Responder cookie  Mode
4       72.21.209.225   UP     c4cd953602568b74  0d6d194993328b02  Main
3       72.21.209.193   UP     b8c8fb7dc68d9173  ca7cb0abaedeb4bb  Main
```

トンネル内で指定されたリモートゲートウェイのリモートアドレスを含む 1 つ以上の行が表示されます。`State` は `UP` になっている必要があります。エントリがない場合、またはエントリが別の状態になっている場合 (`DOWN` など) は、IKE が正しく設定されていないことを示しています。

さらにトラブルシューティングする場合は、設定ファイルの例で推奨されているように、IKE トレースオプションを有効にします。次に、以下のコマンドを実行すると、さまざまなデバッグメッセージが画面に表示されます。

```
user@router> monitor start kmd
```

外部ホストから、次のコマンドでログファイル全体を取得できます。

```
scp username@router.hostname:/var/log/kmd
```

## IPsec
<a name="IPsecTroubleshooting"></a>

次のコマンドを使用します。このレスポンスは、IPsec が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
user@router> show security ipsec security-associations
```

```
Total active tunnels: 2
ID      Gateway        Port  Algorithm        SPI      Life:sec/kb Mon vsys
<131073 72.21.209.225  500   ESP:aes-128/sha1 df27aae4 326/ unlim   -   0
>131073 72.21.209.225  500   ESP:aes-128/sha1 5de29aa1 326/ unlim   -   0
<131074 72.21.209.193  500   ESP:aes-128/sha1 dd16c453 300/ unlim   -   0
>131074 72.21.209.193  500   ESP:aes-128/sha1 c1e0eb29 300/ unlim   -   0
```

具体的には、(リモートゲートウェイに対応する) ゲートウェイアドレスごとに 2 行以上が表示されます。各行の先頭にあるキャレット (< >) は、特定のエントリのトラフィックの方向を示しています。出力には、インバウンドトラフィック (仮想プライベートゲートウェイからこのカスタマーゲートウェイデバイスへのトラフィック、「<」で表されます) およびアウトバウンドトラフィック (「>」で表されます) が別々の行として含まれます。

さらにトラブルシューティングする場合は、IKE のトレースオプションを有効にします (詳細については、IKE に関する前のセクションを参照してください)。

## トンネル
<a name="TunnelTroubleshooting"></a>

最初に、必要なファイアウォールルールがあることをもう一度確認します。ルールのリストについては、「[AWS Site-to-Site VPN カスタマーゲートウェイデバイスのファイアウォールルール](FirewallRules.md)」を参照してください。

ファイアウォールルールが正しくセットアップされた場合は、次のコマンドでトラブルシューティングを継続します。

```
user@router> show interfaces st0.1
```

```
 Logical interface st0.1 (Index 70) (SNMP ifIndex 126)
    Flags: Point-To-Point SNMP-Traps Encapsulation: Secure-Tunnel
    Input packets : 8719
    Output packets: 41841
    Security: Zone: Trust
    Allowed host-inbound traffic : bgp ping ssh traceroute
    Protocol inet, MTU: 9192
      Flags: None
      Addresses, Flags: Is-Preferred Is-Primary
      Destination: 169.254.255.0/30, Local: 169.254.255.2
```

`Security: Zone` が正しいことを確認し、`Local` のアドレスがカスタマーゲートウェイデバイスのトンネル内部のアドレスと一致することを確認します。

次に、以下のコマンドを使用して、`169.254.255.1` を仮想プライベートゲートウェイの内部 IP アドレスで置き換えます。次に示すようなレスポンスが結果として返されます。

```
user@router> ping 169.254.255.1 size 1382 do-not-fragment
```

```
PING 169.254.255.1 (169.254.255.1): 1410 data bytes
64 bytes from 169.254.255.1: icmp_seq=0 ttl=64 time=71.080 ms
64 bytes from 169.254.255.1: icmp_seq=1 ttl=64 time=70.585 ms
```

さらにトラブルシューティングする場合は、設定を確認します。

## BGP
<a name="BGPTroubleshooting"></a>

以下のコマンドを実行してください。

```
user@router> show bgp summary
```

```
Groups: 1 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 2          1          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
169.254.255.1          7224          9         10       0       0        1:00 1/1/1/0              0/0/0/0
169.254.255.5          7224          8          9       0       0          56 0/1/1/0              0/0/0/0
```

さらにトラブルシューティングする場合は、次のコマンドを使用して、`169.254.255.1` を仮想プライベートゲートウェイの内部 IP アドレスで置き換えます。

```
user@router> show bgp neighbor 169.254.255.1
```

```
Peer: 169.254.255.1+179 AS 7224 Local: 169.254.255.2+57175 AS 65000
  Type: External    State: Established    Flags: <ImportEval Sync>
  Last State: OpenConfirm   Last Event: RecvKeepAlive
  Last Error: None
  Export: [ EXPORT-DEFAULT ] 
  Options: <Preference HoldTime PeerAS LocalAS Refresh>
  Holdtime: 30 Preference: 170 Local AS: 65000 Local System AS: 0
  Number of flaps: 0
  Peer ID: 169.254.255.1    Local ID: 10.50.0.10       Active Holdtime: 30
  Keepalive Interval: 10         Peer index: 0   
  BFD: disabled, down
  Local Interface: st0.1                            
  NLRI for restart configured on peer: inet-unicast
  NLRI advertised by peer: inet-unicast
  NLRI for this session: inet-unicast
  Peer supports Refresh capability (2)
  Restart time configured on the peer: 120
  Stale routes from peer are kept for: 300
  Restart time requested by this peer: 120
  NLRI that peer supports restart for: inet-unicast
  NLRI that restart is negotiated for: inet-unicast
  NLRI of received end-of-rib markers: inet-unicast
  NLRI of all end-of-rib markers sent: inet-unicast
  Peer supports 4 byte AS extension (peer-as 7224)
  Table inet.0 Bit: 10000
    RIB State: BGP restart is complete
    Send state: in sync
    Active prefixes:              1
    Received prefixes:            1
    Accepted prefixes:            1
    Suppressed due to damping:    0
    Advertised prefixes:          1
Last traffic (seconds): Received 4    Sent 8    Checked 4   
Input messages:  Total 24     Updates 2       Refreshes 0     Octets 505
Output messages: Total 26     Updates 1       Refreshes 0     Octets 582
Output Queue[0]: 0
```

ここでは、`Received prefixes` および `Advertised prefixes` がそれぞれ 1 になっています。これは、`Table inet.0` セクション内にあります。

`State` が `Established` でない場合は、`Last State` および `Last Error` を確認し、問題の修正に必要なことを詳しく確認します。

BGP ピアリングが起動している場合は、カスタマーゲートウェイデバイスが VPC へのデフォルトルート (0.0.0.0/0) をアドバタイズしていることを確認します。

```
user@router> show route advertising-protocol bgp 169.254.255.1
```

```
inet.0: 10 destinations, 11 routes (10 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 0.0.0.0/0               Self                                    I
```

さらに、VPC に対応するプレフィックスを仮想プライベートゲートウェイから受け取っていることを確認します。

```
user@router> show route receive-protocol bgp 169.254.255.1
```

```
inet.0: 10 destinations, 11 routes (10 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 10.110.0.0/16           169.254.255.1        100                7224 I
```

# Juniper ScreenOS カスタマーゲートウェイデバイスと AWS Site-to-Site VPN の接続のトラブルシューティング
<a name="Juniper_ScreenOs_Troubleshooting"></a>

Juniper ScreenOS ベースのカスタマーゲートウェイデバイスの接続をトラブルシューティングする場合は、IKE、IPsec、トンネル、BGP の 4 つの要素を考慮します。これらの領域を任意の順序でトラブルシューティングできますが、IKE から (ネットワークスタックの下から) 開始して上に進むことをお勧めします。

## IKE と IPsec
<a name="IKEIPsec"></a>

次のコマンドを使用します。このレスポンスは、IKE が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
ssg5-serial-> get sa
```

```
total configured sa: 2
HEX ID    Gateway         Port Algorithm     SPI      Life:sec kb Sta   PID vsys
00000002<   72.21.209.225  500 esp:a128/sha1 80041ca4  3385 unlim A/-    -1 0
00000002>   72.21.209.225  500 esp:a128/sha1 8cdd274a  3385 unlim A/-    -1 0
00000001<   72.21.209.193  500 esp:a128/sha1 ecf0bec7  3580 unlim A/-    -1 0
00000001>   72.21.209.193  500 esp:a128/sha1 14bf7894  3580 unlim A/-    -1 0
```

トンネル内で指定されたリモートゲートウェイのリモートアドレスを含む 1 つ以上の行が表示されます。`Sta` 値は `A/-`、`SPI` は `00000000` 以外の 16 進数になっている必要があります。その他の状態のエントリは、IKE が正しく設定されていないことを示しています。

さらにトラブルシューティングする場合は、設定ファイルの例で推奨されているように、IKE トレースオプションを有効にします。

## トンネル
<a name="TunnelFirewall"></a>

最初に、必要なファイアウォールルールがあることをもう一度確認します。ルールのリストについては、「[AWS Site-to-Site VPN カスタマーゲートウェイデバイスのファイアウォールルール](FirewallRules.md)」を参照してください。

ファイアウォールルールが正しくセットアップされた場合は、次のコマンドでトラブルシューティングを継続します。

```
ssg5-serial-> get interface tunnel.1
```

```
  Interface tunnel.1:
  description tunnel.1
  number 20, if_info 1768, if_index 1, mode route
  link ready
  vsys Root, zone Trust, vr trust-vr
  admin mtu 1500, operating mtu 1500, default mtu 1500
  *ip 169.254.255.2/30
  *manage ip 169.254.255.2
  route-deny disable
  bound vpn:
    IPSEC-1

  Next-Hop Tunnel Binding table
  Flag Status Next-Hop(IP)    tunnel-id  VPN

  pmtu-v4 disabled
  ping disabled, telnet disabled, SSH disabled, SNMP disabled
  web disabled, ident-reset disabled, SSL disabled

  OSPF disabled  BGP enabled  RIP disabled  RIPng disabled  mtrace disabled
  PIM: not configured  IGMP not configured
  NHRP disabled
  bandwidth: physical 0kbps, configured egress [gbw 0kbps mbw 0kbps]
             configured ingress mbw 0kbps, current bw 0kbps
             total allocated gbw 0kbps
```

`link:ready` が表示され、`IP` アドレスがカスタマーゲートウェイデバイスのトンネルの内部のアドレスと一致することを確認します。

次に、以下のコマンドを使用して、`169.254.255.1` を仮想プライベートゲートウェイの内部 IP アドレスで置き換えます。次に示すようなレスポンスが結果として返されます。

```
ssg5-serial-> ping 169.254.255.1
```

```
Type escape sequence to abort

Sending 5, 100-byte ICMP Echos to 169.254.255.1, timeout is 1 seconds
!!!!!
Success Rate is 100 percent (5/5), round-trip time min/avg/max=32/32/33 ms
```

さらにトラブルシューティングする場合は、設定を確認します。

## BGP
<a name="BGPCommand"></a>

以下のコマンドを実行してください。

```
ssg5-serial-> get vrouter trust-vr protocol bgp neighbor
```

```
Peer AS Remote IP       Local IP          Wt Status   State     ConnID Up/Down
--------------------------------------------------------------------------------
   7224 169.254.255.1   169.254.255.2    100 Enabled  ESTABLISH     10 00:01:01
   7224 169.254.255.5   169.254.255.6    100 Enabled  ESTABLISH     11 00:00:59
```

両方の BGP ピアの状態が `ESTABLISH` である必要があります。これは、仮想プライベートゲートウェイへの BGP 接続がアクティブであることを示します。

さらにトラブルシューティングする場合は、次のコマンドを使用して、`169.254.255.1` を仮想プライベートゲートウェイの内部 IP アドレスで置き換えます。

```
ssg5-serial-> get vr trust-vr prot bgp neigh 169.254.255.1
```

```
peer: 169.254.255.1,  remote AS: 7224, admin status: enable
type: EBGP, multihop: 0(disable), MED: node default(0)
connection state: ESTABLISH, connection id: 18 retry interval: node default(120s), cur retry time 15s
configured hold time: node default(90s), configured keepalive: node default(30s)
configured adv-interval: default(30s)
designated local IP: n/a
local IP address/port: 169.254.255.2/13946, remote IP address/port: 169.254.255.1/179
router ID of peer: 169.254.255.1, remote AS: 7224
negotiated hold time: 30s, negotiated keepalive interval: 10s
route map in name: , route map out name:
weight: 100 (default)
self as next hop: disable
send default route to peer: disable
ignore default route from peer: disable
send community path attribute: no
reflector client: no
Neighbor Capabilities:
  Route refresh: advertised and received
  Address family IPv4 Unicast:  advertised and received
force reconnect is disable
total messages to peer: 106, from peer: 106
update messages to peer: 6, from peer: 4
Tx queue length 0, Tx queue HWM: 1
route-refresh messages to peer: 0, from peer: 0
last reset 00:05:33 ago, due to BGP send Notification(Hold Timer Expired)(code 4 : subcode 0)
number of total successful connections: 4
connected: 2 minutes 6 seconds
Elapsed time since last update: 2 minutes 6 seconds
```

BGP ピアリングが起動している場合は、カスタマーゲートウェイデバイスが VPC へのデフォルトルート (0.0.0.0/0) をアドバタイズしていることを確認します。このコマンドは、ScreenOS バージョン 6.2.0 以降に適用されます。

```
ssg5-serial-> get vr trust-vr protocol bgp  rib neighbor 169.254.255.1 advertised
```

```
i: IBGP route, e: EBGP route, >: best route, *: valid route
               Prefix         Nexthop    Wt  Pref   Med Orig    AS-Path
--------------------------------------------------------------------------------------
>i          0.0.0.0/0         0.0.0.0 32768   100     0  IGP
Total IPv4 routes advertised: 1
```

さらに、VPC に対応するプレフィックスを仮想プライベートゲートウェイから受け取っていることを確認します。このコマンドは、ScreenOS バージョン 6.2.0 以降に適用されます。

```
ssg5-serial-> get vr trust-vr protocol bgp  rib neighbor 169.254.255.1 received
```

```
i: IBGP route, e: EBGP route, >: best route, *: valid route
               Prefix         Nexthop    Wt  Pref   Med Orig    AS-Path
--------------------------------------------------------------------------------------
>e*     10.0.0.0/16   169.254.255.1   100   100   100  IGP   7224
Total IPv4 routes received: 1
```

# Yamaha カスタマーゲートウェイデバイスと AWS Site-to-Site VPN の接続のトラブルシューティング
<a name="Yamaha_Troubleshooting"></a>

Yamaha のカスタマーゲートウェイデバイスの接続をトラブルシューティングする場合は、IKE、IPsec、トンネル、BGP の 4 つの要素を考慮します。これらの領域を任意の順序でトラブルシューティングできますが、IKE から (ネットワークスタックの下から) 開始して上に進むことをお勧めします。

**注記**  
IKE のフェーズ 2 で使用される `proxy ID` 設定は、Yamaha ルーターではデフォルトで無効になっています。これにより、Site-to-Site VPN への接続で問題が発生する可能性があります。`proxy ID` がルーターで設定されていない場合は、Yamaha が正しく設定できるように、 AWSが提供する設定ファイルの例を参照してください。

## IKE
<a name="YamahaIKE"></a>

以下のコマンドを実行してください。このレスポンスは、IKE が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
# show ipsec sa gateway 1
```

```
sgw  flags local-id                      remote-id        # of sa
--------------------------------------------------------------------------
1    U K   YOUR_LOCAL_NETWORK_ADDRESS     72.21.209.225    i:2 s:1 r:1
```

トンネル内で指定されたリモートゲートウェイの `remote-id` 値を含む行が表示されます。トンネル番号を省略すると、すべての Security Association (SA) を表示できます。

さらにトラブルシューティングする場合は、次のコマンドを実行して、診断情報を提供する DEBUG レベルログメッセージを有効にします。

```
# syslog debug on
# ipsec ike log message-info payload-info key-info
```

ログに記録された項目をキャンセルするには、次のコマンドを実行します。

```
# no ipsec ike log
# no syslog debug on
```

## IPsec
<a name="YamahaIPsec"></a>

以下のコマンドを実行してください。このレスポンスは、IPsec が正しく設定されたカスタマーゲートウェイデバイスを示しています。

```
# show ipsec sa gateway 1 detail
```

```
SA[1] Duration: 10675s
Local ID: YOUR_LOCAL_NETWORK_ADDRESS
Remote ID: 72.21.209.225
Protocol: IKE
Algorithm: AES-CBC, SHA-1, MODP 1024bit

SPI: 6b ce fd 8a d5 30 9b 02 0c f3 87 52 4a 87 6e 77 
Key: ** ** ** ** **  (confidential)   ** ** ** ** **
----------------------------------------------------
SA[2] Duration: 1719s
Local ID: YOUR_LOCAL_NETWORK_ADDRESS
Remote ID: 72.21.209.225
Direction: send
Protocol: ESP (Mode: tunnel)
Algorithm: AES-CBC (for Auth.: HMAC-SHA)
SPI: a6 67 47 47 
Key: ** ** ** ** **  (confidential)   ** ** ** ** **
----------------------------------------------------
SA[3] Duration: 1719s
Local ID: YOUR_LOCAL_NETWORK_ADDRESS
Remote ID: 72.21.209.225
Direction: receive
Protocol: ESP (Mode: tunnel)
Algorithm: AES-CBC (for Auth.: HMAC-SHA)
SPI: 6b 98 69 2b 
Key: ** ** ** ** **  (confidential)   ** ** ** ** **
----------------------------------------------------
SA[4] Duration: 10681s
Local ID: YOUR_LOCAL_NETWORK_ADDRESS
Remote ID: 72.21.209.225
Protocol: IKE
Algorithm: AES-CBC, SHA-1, MODP 1024bit
SPI: e8 45 55 38 90 45 3f 67 a8 74 ca 71 ba bb 75 ee 
Key: ** ** ** ** **  (confidential)   ** ** ** ** **
----------------------------------------------------
```

各トンネルインターフェイスに対して、`receive sas` と `send sas` がいずれも表示されます。

さらにトラブルシューティングする場合は、次のコマンドを使用してデバッグを有効にします。

```
# syslog debug on
# ipsec ike log message-info payload-info key-info
```

次のコマンドを実行して、デバッグを無効にします。

```
# no ipsec ike log
# no syslog debug on
```

## トンネル
<a name="YamahaTunnel"></a>

最初に、必要なファイアウォールルールがあることを確認します。ルールのリストについては、「[AWS Site-to-Site VPN カスタマーゲートウェイデバイスのファイアウォールルール](FirewallRules.md)」を参照してください。

ファイアウォールルールが正しくセットアップされた場合は、次のコマンドでトラブルシューティングを継続します。

```
# show status tunnel 1
```

```
TUNNEL[1]: 
Description: 
  Interface type: IPsec
  Current status is Online.
  from 2011/08/15 18:19:45.
  5 hours 7 minutes 58 seconds  connection.
  Received:    (IPv4) 3933 packets [244941 octets]
               (IPv6) 0 packet [0 octet]
  Transmitted: (IPv4) 3933 packets [241407 octets]
               (IPv6) 0 packet [0 octet]
```

`current status` 値がオンラインで `Interface type` が IPsec になっていることを確認します。両方のトンネルインターフェイスでコマンドを実行することを確認します。ここですべての問題を解決するには、設定を確認します。

## BGP
<a name="YamahaBGP"></a>

以下のコマンドを実行してください。

```
# show status bgp neighbor
```

```
BGP neighbor is 169.254.255.1, remote AS 7224, local AS 65000, external link
  BGP version 0, remote router ID 0.0.0.0
  BGP state = Active
  Last read 00:00:00, hold time is 0, keepalive interval is 0 seconds
  Received 0 messages, 0 notifications, 0 in queue
  Sent 0 messages, 0 notifications, 0 in queue
  Connection established 0; dropped 0
  Last reset never
Local host: unspecified
Foreign host: 169.254.255.1, Foreign port: 0

BGP neighbor is 169.254.255.5, remote AS 7224, local AS 65000, external link
  BGP version 0, remote router ID 0.0.0.0
  BGP state = Active
  Last read 00:00:00, hold time is 0, keepalive interval is 0 seconds
  Received 0 messages, 0 notifications, 0 in queue
  Sent 0 messages, 0 notifications, 0 in queue
  Connection established 0; dropped 0
  Last reset never
Local host: unspecified
Foreign host: 169.254.255.5, Foreign port:
```

両方のネイバーが表示されます。それぞれに対して、`Active` の `BGP state` 値が表示されます。

BGP ピアリングが起動している場合は、カスタマーゲートウェイデバイスが VPC へのデフォルトルート (0.0.0.0/0) をアドバタイズしていることを確認します。

```
# show status bgp neighbor 169.254.255.1 advertised-routes 
```

```
Total routes: 1
*: valid route
  Network            Next Hop        Metric LocPrf Path
* default            0.0.0.0              0        IGP
```

さらに、VPC に対応するプレフィックスを仮想プライベートゲートウェイから受け取っていることを確認します。

```
# show ip route
```

```
Destination         Gateway          Interface       Kind  Additional Info.
default             ***.***.***.***   LAN3(DHCP)    static  
10.0.0.0/16         169.254.255.1    TUNNEL[1]       BGP  path=10124
```