

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

# 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 接続が再確立されたかどうか、およびトラフィックが正しく流れているかどうかを確認します。