次の方法で共有


ハイブリッド VPN 接続のトラブルシューティング

Azure Virtual Network
Azure VPN Gateway
Windows Server

この記事では、オンプレミス ネットワークと Azure の間の VPN ゲートウェイ接続のトラブルシューティングに関するいくつかのヒントを提供します。 VPN 関連の一般的なエラーのトラブルシューティングに関する一般的な情報については、「VPN 関連の一般的なエラーのトラブルシューティング」を参照してください。

VPN アプライアンスが正しく機能していることを確認する

次の推奨事項は、オンプレミスの VPN アプライアンスが正しく機能しているかどうかを判断するのに役立ちます。

VPN アプライアンスによって生成されたログ ファイルにエラーやエラーがないか確認します。 これは、VPN アプライアンスが正しく機能しているかどうかを判断するのに役立ちます。 この情報の場所は、アプライアンスによって異なります。 たとえば、Windows Server で RRAS を使用している場合は、次の PowerShell コマンドを使用して、RRAS サービスのエラー イベント情報を表示できます。

Get-EventLog -LogName System -EntryType Error -Source RemoteAccess | Format-List -Property *

各エントリの Message プロパティは、エラーの説明を提供します。 一般的な例を次に示します。

  • RRAS VPN ネットワーク インターフェイス構成で Azure VPN ゲートウェイに指定された IP アドレスが正しくないため、接続できない可能性があります。

    EventID            : 20111
    MachineName        : on-premises-vm
    Data               : {41, 3, 0, 0}
    Index              : 14231
    Category           : (0)
    CategoryNumber     : 0
    EntryType          : Error
    Message            : RoutingDomainID- {00000000-0000-0000-0000-000000000000}: A demand dial connection to the remote
                            interface AzureGateway on port VPN2-4 was successfully initiated but failed to complete
                            successfully because of the following error: The network connection between your computer and
                            the VPN server could not be established because the remote server is not responding. This could
                            be because one of the network devices (for example, firewalls, NAT, routers, and so on) between your computer
                            and the remote server is not configured to allow VPN connections. Please contact your
                            Administrator or your service provider to determine which device may be causing the problem.
    Source             : RemoteAccess
    ReplacementStrings : {{00000000-0000-0000-0000-000000000000}, AzureGateway, VPN2-4, The network connection between
                            your computer and the VPN server could not be established because the remote server is not
                            responding. This could be because one of the network devices (for example, firewalls, NAT, routers, and so on)
                            between your computer and the remote server is not configured to allow VPN connections. Please
                            contact your Administrator or your service provider to determine which device may be causing the
                            problem.}
    InstanceId         : 20111
    TimeGenerated      : 3/18/2024 1:26:02 PM
    TimeWritten        : 3/18/2024 1:26:02 PM
    UserName           :
    Site               :
    Container          :
    
  • RRAS VPN ネットワーク インターフェイス構成で指定されている間違った共有キー。

    EventID            : 20111
    MachineName        : on-premises-vm
    Data               : {233, 53, 0, 0}
    Index              : 14245
    Category           : (0)
    CategoryNumber     : 0
    EntryType          : Error
    Message            : RoutingDomainID- {00000000-0000-0000-0000-000000000000}: A demand dial connection to the remote
                            interface AzureGateway on port VPN2-4 was successfully initiated but failed to complete
                            successfully because of the following error: Internet key exchange (IKE) authentication credentials are unacceptable.
    
    Source             : RemoteAccess
    ReplacementStrings : {{00000000-0000-0000-0000-000000000000}, AzureGateway, VPN2-4, IKE authentication credentials are
                            unacceptable.
                            }
    InstanceId         : 20111
    TimeGenerated      : 3/18/2024 1:34:22 PM
    TimeWritten        : 3/18/2024 1:34:22 PM
    UserName           :
    Site               :
    Container          :
    

次の PowerShell コマンドを使用して、RRAS サービスを介した接続の試行に関するイベント ログ情報を取得することもできます。

Get-EventLog -LogName Application -Source RasClient | Format-List -Property *

接続に失敗した場合、このログには次のようなエラーが含まれます。

EventID            : 20227
MachineName        : on-premises-vm
Data               : {}
Index              : 4203
Category           : (0)
CategoryNumber     : 0
EntryType          : Error
Message            : CoId={B4000371-A67F-452F-AA4C-3125AA9CFC78}: The user SYSTEM dialed a connection named
                        AzureGateway that has failed. The error code returned on failure is 809.
Source             : RasClient
ReplacementStrings : {{B4000371-A67F-452F-AA4C-3125AA9CFC78}, SYSTEM, AzureGateway, 809}
InstanceId         : 20227
TimeGenerated      : 3/18/2024 1:29:21 PM
TimeWritten        : 3/18/2024 1:29:21 PM
UserName           :
Site               :
Container          :

接続の確認

VPN ゲートウェイ間の接続とルーティングを確認します。 VPN アプライアンスが、Azure VPN Gateway 経由でトラフィックを正しくルーティングしていない可能性があります。 PsPing などのツールを使用して、VPN ゲートウェイ間の接続とルーティングを確認します。 たとえば、オンプレミスのマシンから VNet 上にある Web サーバーへの接続をテストするには、次のコマンドを実行します (<<web-server-address>> を Web サーバーのアドレスに置き換えます)。

PsPing -t <<web-server-address>>:80

オンプレミスのマシンが Web サーバーにトラフィックをルーティングできる場合は、次のような出力が表示されます。

D:\PSTools> psping -t 10.20.0.5:80

PsPing v2.01 - PsPing - ping, latency, bandwidth measurement utility
Copyright (C) 2012-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

TCP connect to 10.20.0.5:80:
Infinite iterations (warmup 1) connecting test:
Connecting to 10.20.0.5:80 (warmup): 6.21ms
Connecting to 10.20.0.5:80: 3.79ms
Connecting to 10.20.0.5:80: 3.44ms
Connecting to 10.20.0.5:80: 4.81ms

    Sent = 3, Received = 3, Lost = 0 (0% loss),
    Minimum = 3.44ms, Maximum = 4.81ms, Average = 4.01ms

オンプレミスのマシンが指定した宛先と通信できない場合は、次のようなメッセージが表示されます。

D:\PSTools>psping -t 10.20.1.6:80

PsPing v2.01 - PsPing - ping, latency, bandwidth measurement utility
Copyright (C) 2012-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

TCP connect to 10.20.1.6:80:
Infinite iterations (warmup 1) connecting test:
Connecting to 10.20.1.6:80 (warmup): This operation returned because the timeout period expired.
Connecting to 10.20.1.6:80: This operation returned because the timeout period expired.
Connecting to 10.20.1.6:80: This operation returned because the timeout period expired.
Connecting to 10.20.1.6:80: This operation returned because the timeout period expired.
Connecting to 10.20.1.6:80:
    Sent = 3, Received = 0, Lost = 3 (100% loss),
    Minimum = 0.00ms, Maximum = 0.00ms, Average = 0.00ms

オンプレミスのファイアウォールで VPN トラフィックの通過が許可され、正しいポートが開かれていることを確認します。

オンプレミスの VPN アプライアンスで、Azure VPN ゲートウェイと互換性のある暗号化方法が使用されていることを確認します。 ポリシー ベースのルーティングの場合、Azure VPN ゲートウェイは AES256、AES128、および 3DES 暗号化アルゴリズムをサポートします。 ルート ベースのゲートウェイでは、AES256 と 3DES がサポートされます。 詳細については、「サイト間 VPN Gateway 接続の VPN デバイスと IPsec/IKE パラメーターについて」を参照してください。

Azure VPN ゲートウェイに関する問題を確認する

次の推奨事項は、Azure VPN ゲートウェイに問題があるかどうかを判断するのに役立ちます。

Azure VPN ゲートウェイの診断ログで潜在的な問題がないか調べます。 詳細については、「ee ステップ バイ ステップ:Azure Resource Manager VNet ゲートウェイ診断ログのキャプチャ」を参照してください。

Azure VPN ゲートウェイとオンプレミス VPN アプライアンスが同じ共有認証キーで構成されていることを確認します。 次の Azure CLI コマンドを使用して、Azure VPN ゲートウェイによって格納されている共有キーを表示できます。

azure network vpn-connection shared-key show <<resource-group>> <<vpn-connection-name>>

オンプレミスの VPN アプライアンスに適したコマンドを使用して、そのアプライアンス用に構成された共有キーを表示します。

Azure VPN ゲートウェイを保持する GatewaySubnet サブネットが NSG に関連付けられていないことを確認します。

次の Azure CLI コマンドを使用して、サブネットの詳細を表示できます。

azure network vnet subnet show -g <<resource-group>> -e <<vnet-name>> -n GatewaySubnet

ネットワーク セキュリティ グループ ID という名前データ フィールドがないことを確認します。 次の例は、NSG が割り当てられている GatewaySubnet のインスタンス (VPN-Gateway-Group) の結果を示しています。 これにより、この NSG に対して定義されている規則がある場合、ゲートウェイが正しく動作しなくなる可能性があります。

C:\>azure network vnet subnet show -g profx-prod-rg -e profx-vnet -n GatewaySubnet
    info:    Executing command network vnet subnet show
    + Looking up virtual network "profx-vnet"
    + Looking up the subnet "GatewaySubnet"
    data:    Id                              : /subscriptions/########-####-####-####-############/resourceGroups/profx-prod-rg/providers/Microsoft.Network/virtualNetworks/profx-vnet/subnets/GatewaySubnet
    data:    Name                            : GatewaySubnet
    data:    Provisioning state              : Succeeded
    data:    Address prefix                  : 10.20.3.0/27
    data:    Network Security Group id       : /subscriptions/########-####-####-####-############/resourceGroups/profx-prod-rg/providers/Microsoft.Network/networkSecurityGroups/VPN-Gateway-Group
    info:    network vnet subnet show command OK

Azure VNet 内の仮想マシンが、VNet の外部からのトラフィックを許可するように構成されていることを確認します。 これらの仮想マシンを含むサブネットに関連付けられている NSG ルールを確認します。 次の Azure CLI コマンドを使用して、すべての NSG ルールを表示できます。

azure network nsg show -g <<resource-group>> -n <<nsg-name>>

Azure VPN ゲートウェイが接続されていることを確認します。 次の Azure PowerShell コマンドを使用して、Azure VPN 接続の現在の状態を確認できます。 <<connection-name>> パラメーターは、仮想ネットワーク ゲートウェイとローカル ゲートウェイをリンクする Azure VPN 接続の名前です。

Get-AzureRmVirtualNetworkGatewayConnection -Name <<connection-name>> - ResourceGroupName <<resource-group>>

次のスニペットは、ゲートウェイが接続され (最初の例)、切断された場合に生成される出力を強調表示します (2 番目の例)。

PS C:\> Get-AzureRmVirtualNetworkGatewayConnection -Name profx-gateway-connection -ResourceGroupName profx-prod-rg

AuthorizationKey           :
VirtualNetworkGateway1     : Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway
VirtualNetworkGateway2     :
LocalNetworkGateway2       : Microsoft.Azure.Commands.Network.Models.PSLocalNetworkGateway
Peer                       :
ConnectionType             : IPsec
RoutingWeight              : 0
SharedKey                  : ####################################
ConnectionStatus           : Connected
EgressBytesTransferred     : 55254803
IngressBytesTransferred    : 32227221
ProvisioningState          : Succeeded
...
PS C:\> Get-AzureRmVirtualNetworkGatewayConnection -Name profx-gateway-connection2 -ResourceGroupName profx-prod-rg

AuthorizationKey           :
VirtualNetworkGateway1     : Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway
VirtualNetworkGateway2     :
LocalNetworkGateway2       : Microsoft.Azure.Commands.Network.Models.PSLocalNetworkGateway
Peer                       :
ConnectionType             : IPsec
RoutingWeight              : 0
SharedKey                  : ####################################
ConnectionStatus           : NotConnected
EgressBytesTransferred     : 0
IngressBytesTransferred    : 0
ProvisioningState          : Succeeded
...

その他の問題

次の推奨事項は、ホスト VM の構成、ネットワーク帯域幅の使用率、またはアプリケーションのパフォーマンスに問題があるかどうかを判断するのに役立ちます。

  • ファイアウォールの構成を確認します。 サブネット内の Azure VM で実行されているゲスト オペレーティング システムのファイアウォールが、オンプレミスの IP 範囲からの許可されたトラフィックを許可するように正しく構成されていることを確認します。

  • トラフィックの量が、Azure VPN ゲートウェイで使用できる帯域幅の制限に近くないことを確認します。 これを確認する方法は、オンプレミスで実行されている VPN アプライアンスによって異なります。 たとえば、Windows Server で RRAS を使用している場合は、パフォーマンス モニターを使用して、VPN 接続経由で送受信されるデータの量を追跡できます。 RAS Total オブジェクトを使用して、Bytes Received/Sec カウンターと Bytes Transmitted/Sec カウンターを選択します。

    VPN ネットワーク トラフィックの を監視するためのパフォーマンス カウンター

    結果を VPN ゲートウェイで使用できる帯域幅と比較する必要があります (Basic SKU の場合は 100 Mbps から、VpnGw3 SKU の場合は 1.25 Gbps)。

    VPN ネットワーク パフォーマンス グラフの例

  • アプリケーションの負荷に適した VM の数とサイズがデプロイされていることを確認します。 Azure VNet 内のいずれかの仮想マシンの実行速度が遅いかどうかを判断します。 その場合は、オーバーロードされる可能性があります。負荷を処理するには少なすぎるか、ロード バランサーが正しく構成されていない可能性があります。 これを判断するには、診断情報 をキャプチャして分析。 Azure portal を使用して結果を調べることができますが、パフォーマンス データに関する詳細な分析情報を提供できる多くのサード パーティ製ツールも利用できます。

    Azure DDoS Protection を使用して、悪意のあるリソースの枯渇から保護することができます。 Azure DDoS Protection 、アプリケーション設計のベスト プラクティスと組み合わせることで、DDoS 攻撃に対する防御を強化するための強化された DDoS 軽減機能が提供されます。 任意の境界仮想ネットワーク Azure DDOS Protection を有効にする必要があります。

  • アプリケーションがクラウド リソースを効率的に使用していることを確認します。 各 VM で実行されているアプリケーション コードをインストルメント化して、アプリケーションがリソースを最大限に活用しているかどうかを判断します。 Application Insightsなどのツールを使用できます。

次の手順

製品ドキュメント:

Microsoft Learn モジュール: