Always On VPN ユーザー トンネルの構成

Always On 機能が、Windows 10 VPN クライアントに導入されました。 Always On は VPN 接続を維持する機能です。 Always On を使用すると、アクティブな VPN プロファイルは、ユーザーのサインイン、ネットワーク状態の変更、またはデバイス画面のアクティブ化などのトリガーに基づいて、自動的に接続し、接続を維持することができます。

ゲートウェイを Always On と共に使用することで、Azure への永続的なユーザー トンネルとデバイス トンネルを確立できます。

Always On VPN 接続には、次の 2 種類のトンネルのいずれかが含まれます。

  • デバイス トンネル:ユーザーがデバイスにサインインする前に、指定した VPN サーバーに接続します。 サインイン前の接続シナリオとデバイス管理ではデバイス トンネルが使用されます。

  • ユーザー トンネル:ユーザーがデバイスにサインインした後にのみ接続します。 ユーザー トンネルを使用すると、ユーザーは VPN サーバー経由で組織のリソースにアクセスできます。

デバイス トンネルとユーザー トンネルは、VPN プロファイルとは関係なく動作します。 これらは同時に接続でき、必要に応じてさまざまな認証方法と他の VPN の構成設定を使用できます。

この記事は、Always On VPN ユーザー トンネルの構成に役立ちます。 デバイス トンネルの構成に関する詳細については、「Always On VPN デバイス トンネルの構成」を参照してください。

ゲートウェイを構成する

IKEv2 と証明書ベースの認証を使用するように VPN ゲートウェイを構成するには、ポイント対サイト VPN 接続の構成に関する記事の手順に従ってください。

ユーザー トンネルを構成する

  1. こちらのポイント対サイト VPN クライアントに関する記事に示されているように、Windows クライアントにクライアント証明書をインストールします。 証明書は、現在のユーザー ストアに存在する必要があります。

  2. PowerShell、Configuration Manager、または Intune を使用して Always On VPN クライアントを構成するには、Windows 10 以降のクライアントの Always On VPN 接続の構成に関する記事の手順に従ってください。

ユーザー トンネルの構成例

仮想ネットワーク ゲートウェイを構成し、Windows クライアントのローカル コンピューター ストアにクライアント証明書をインストールしたら、次の例を使用してクライアント デバイス トンネルを構成します。 これらの例は、Windows 10で検証されていることに注意してください。

  1. 次のテキストをコピーし、usercert.ps1 として保存します。

    Param(
    [string]$xmlFilePath,
    [string]$ProfileName
    )
    
    $a = Test-Path $xmlFilePath
    echo $a
    
    $ProfileXML = Get-Content $xmlFilePath
    
    echo $XML
    
    $ProfileNameEscaped = $ProfileName -replace ' ', '%20'
    
    $Version = 201606090004
    
    $ProfileXML = $ProfileXML -replace '<', '&lt;'
    $ProfileXML = $ProfileXML -replace '>', '&gt;'
    $ProfileXML = $ProfileXML -replace '"', '&quot;'
    
    $nodeCSPURI = './Vendor/MSFT/VPNv2'
    $namespaceName = "root\cimv2\mdm\dmmap"
    $className = "MDM_VPNv2_01"
    
    $session = New-CimSession
    
    try
    {
    $newInstance = New-Object Microsoft.Management.Infrastructure.CimInstance $className, $namespaceName
    $property = [Microsoft.Management.Infrastructure.CimProperty]::Create("ParentID", "$nodeCSPURI", 'String', 'Key')
    $newInstance.CimInstanceProperties.Add($property)
    $property = [Microsoft.Management.Infrastructure.CimProperty]::Create("InstanceID", "$ProfileNameEscaped", 'String', 'Key')
    $newInstance.CimInstanceProperties.Add($property)
    $property = [Microsoft.Management.Infrastructure.CimProperty]::Create("ProfileXML", "$ProfileXML", 'String', 'Property')
    $newInstance.CimInstanceProperties.Add($property)
    
    $session.CreateInstance($namespaceName, $newInstance)
    $Message = "Created $ProfileName profile."
    Write-Host "$Message"
    }
    catch [Exception]
    {
    $Message = "Unable to create $ProfileName profile: $_"
    Write-Host "$Message"
    exit
    }
    $Message = "Complete."
    Write-Host "$Message"
    
  2. 次のテキストをコピーし、VPNProfile.xml として usercert.ps1 と同じフォルダーに保存します。 お使いの環境に合わせて次のテキストを編集します。

    • <Servers>azuregateway-1234-56-78dc.cloudapp.net</Servers> <= Can be found in the VpnSettings.xml in the downloaded profile zip file
    • <Address>192.168.3.5</Address> <= IP of resource in the vnet or the vnet address space
    • <Address>192.168.3.4</Address> <= IP of resource in the vnet or the vnet address space
    • <PrefixSize>32</PrefixSize> <= Subnet mask
     <VPNProfile>  
       <NativeProfile>  
     <Servers>azuregateway-b115055e-0882-49bc-a9b9-7de45cba12c0-8e6946892333.vpn.azure.com</Servers>  
     <NativeProtocolType>IKEv2</NativeProtocolType>  
     <Authentication>  
     <UserMethod>Eap</UserMethod>
     <Eap>
     <Configuration>
     <EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig"><EapMethod><Type xmlns="http://www.microsoft.com/provisioning/EapCommon">13</Type><VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId><VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType><AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId></EapMethod><Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig"><Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1"><Type>13</Type><EapType xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1"><CredentialsSource><CertificateStore><SimpleCertSelection>true</SimpleCertSelection></CertificateStore></CredentialsSource><ServerValidation><DisableUserPromptForServerValidation>false</DisableUserPromptForServerValidation><ServerNames></ServerNames></ServerValidation><DifferentUsername>false</DifferentUsername><PerformServerValidation xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">false</PerformServerValidation><AcceptServerName xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">false</AcceptServerName></EapType></Eap></Config></EapHostConfig>
     </Configuration>
     </Eap>
     </Authentication>  
     <RoutingPolicyType>SplitTunnel</RoutingPolicyType>  
      <!-- disable the addition of a class based route for the assigned IP address on the VPN interface -->
     <DisableClassBasedDefaultRoute>true</DisableClassBasedDefaultRoute>  
       </NativeProfile> 
       <!-- use host routes(/32) to prevent routing conflicts -->  
       <Route>  
     <Address>192.168.3.5</Address>  
     <PrefixSize>32</PrefixSize>  
       </Route>  
       <Route>  
     <Address>192.168.3.4</Address>  
     <PrefixSize>32</PrefixSize>  
       </Route>  
     <!-- traffic filters for the routes specified above so that only this traffic can go over the device tunnel --> 
       <TrafficFilter>  
     <RemoteAddressRanges>192.168.3.4, 192.168.3.5</RemoteAddressRanges>  
       </TrafficFilter>
     <!-- need to specify always on = true --> 
     <AlwaysOn>true</AlwaysOn>
     <RememberCredentials>true</RememberCredentials>
     <!--new node to register client IP address in DNS to enable manage out -->
     <RegisterDNS>true</RegisterDNS>
     </VPNProfile>
    
  3. PowerShell を管理者として実行します。

  4. PowerShell で、usercert.ps1VPNProfile.xml が配置されているフォルダーに切り替えて、次のコマンドを実行します。

    C:\> .\usercert.ps1 .\VPNProfile.xml UserTest
    

    MachineCertTest

  5. [VPN 設定] で、UserTest エントリを探して、[接続] を選択します。

  6. 接続に成功した場合は、Always On ユーザー トンネルは正常に構成されています。

プロファイルを削除するには

プロファイルを削除するには、次の手順に従います。

  1. 次のコマンドを実行します。

    C:\> Remove-VpnConnection UserTest  
    
  2. 接続を切断し、 [Connect automatically](自動的に接続する) チェック ボックスをオフにします。

    クリーンアップ

次のステップ

発生する可能性のある接続の問題をトラブルシューティングするには、「Azure ポイント対サイト接続の問題」を参照してください。