強制トンネリングを使用したライセンス認証の問題

この記事では、サイト間 VPN 接続または ExpressRoute シナリオで強制トンネリングを有効にしている場合に発生する可能性がある KMS ライセンス認証の問題を解決する方法について説明します。

症状

Azure 仮想ネットワーク サブネットで強制トンネリングを有効にし、インターネットへのすべてのトラフィックをオンプレミス ネットワークに戻すようにします。 このシナリオでは、Windows を実行する Azure 仮想マシン (VM) が Windows のライセンス認証に失敗します。

原因

Azure Windows VM は、Windows のライセンス認証のために Azure KMS サーバーに接続する必要があります。 このライセンス認証では、ライセンス認証要求が Azure のパブリック IP アドレスから送られる必要があります。 強制トンネリング シナリオでは、ライセンス認証要求が Azure のパブリック IP アドレスではなく、オンプレミス ネットワークから送信されるため、ライセンス認証は失敗します。

ソリューション

この問題を解決するには、Azure カスタム ルートを使用して、Azure KMS サーバー に ライセンス認証のトラフィックをルーティングします。

Azure グローバル クラウドの KMS サーバーの最初の DNS 名は azkms.core.windows.net で、2 つの IP アドレスがあります。20.118.99.224 および 20.118.99.224。 Azure グローバル クラウドの KMS サーバーの 2 番目の DNS 名は kms.core.windows.net で、IP アドレスは 23.102.135.246 です。 Azure Germany などの他の Azure プラットフォームを使用する場合は、対応する KMS サーバーの IP アドレスを使用する必要があります。 詳細については、後の表を参照してください。

プラットフォーム KMS DNS KMS IP
Azure Global azkms.core.windows.net*
kms.core.windows.net
20.118.99.224, 40.83.235.53
23.102.135.246
Azure Germany kms.core.cloudapi.de 51.4.143.248
Azure US Government kms.core.usgovcloudapi.net
azkms.core.usgovcloudapi.net
23.97.0.13
52.126.105.2
Azure China 21Vianet azkms.core.chinacloudapi.cn
kms.core.chinacloudapi.cn
159.27.28.100, 163.228.64.161
42.159.7.249

注意

Azure Global クラウドと Azure China の 3 つの IP アドレスと、Azure US Government 用の 2 つの IP アドレスをすべてカスタム ルートに追加する必要があります。

*ネットワークセキュリティグループに関連する問題を軽減するために、azkms.core.windows.netkms.core.windows.netを今のところ指します。 問題が解決した後(2022年10月3日を予定)、azkms.core.windows.netは 2 つの新しいIPアドレス、20.118.99.244および40.83.235.53を指し示します。

カスタム ルートを追加するには、次の手順を実行します。

Resource Manager VM の場合

注意

アクティブ化ではパブリック IP アドレスが使用され、Standard SKU の Load Balancer の構成による影響を受けます。 要件については、「Azure の送信接続」を慎重に確認してください。

  1. Azure PowerShell を開き、Azure サブスクリプションにサインインします。

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

    # First, get the virtual network that hosts the VMs that have activation problems. In this case, we get virtual network ArmVNet-DM in Resource Group ArmVNet-DM:
    $vnet = Get-AzVirtualNetwork -ResourceGroupName "ArmVNet-DM" -Name "ArmVNet-DM"
    
    # Next, create a route table:
    $RouteTable = New-AzRouteTable -Name "ArmVNet-DM-KmsDirectRoute" -ResourceGroupName "ArmVNet-DM" -Location "centralus"
    
    # Next, configure the route table:
    Add-AzRouteConfig -Name "DirectRouteToKMS" -AddressPrefix 23.102.135.246/32 -NextHopType Internet -RouteTable $RouteTable
    Add-AzRouteConfig -Name "DirectRouteToAZKMS01" -AddressPrefix 20.118.99.224/32 -NextHopType Internet -RouteTable $RouteTable
    Add-AzRouteConfig -Name "DirectRouteToAZKMS02" -AddressPrefix 40.83.235.53/32 -NextHopType Internet -RouteTable $RouteTable
    
    Set-AzRouteTable -RouteTable $RouteTable
    
    # Next, attach the route table to the subnet that hosts the VMs:
    Set-AzVirtualNetworkSubnetConfig -Name "Subnet01" -VirtualNetwork $vnet -AddressPrefix "10.0.0.0/24" -RouteTable $RouteTable
    
    Set-AzVirtualNetwork -VirtualNetwork $vnet
    
  3. ライセンス認証の問題がある VM に移動します。 PsPing を使用して、KMS サーバーにアクセスできるかどうかをテストします。

    psping kms.core.windows.net:1688
    psping azkms.core.windows.net:1688
    
  4. Windows のライセンス認証を試してみて、問題が解決されるかどうかを確認します。

クラシック VM の場合

重要

クラシック VM は 2023 年 3 月 1 日に廃止されます。

ASM の IaaS リソースを使用する場合は、2023 年 3 月 1 日までに移行を完了してください。 Azure Resource Manager の多くの機能拡張を利用するには、切り替えを早めに行うことをお勧めします。

詳細については、「2023 年 3 月 1 日までに IaaS リソースを Azure Resource Manager に移行する」を参照してください。

  1. Azure PowerShell を開き、Azure サブスクリプションにサインインします。

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

    # First, create a new route table:
    New-AzureRouteTable -Name "VNet-DM-KmsRouteGroup" -Label "Route table for KMS" -Location "Central US"
    
    # Next, get the route table that was created:
    $rt = Get-AzureRouteTable -Name "VNet-DM-KmsRouteTable"
    
    # Next, create routes:
    Set-AzureRoute -RouteTable $rt -RouteName "AzureKMS" -AddressPrefix "23.102.135.246/32" -NextHopType Internet
    Set-AzureRoute -RouteTable $rt -RouteName "AzureAZKMS01" -AddressPrefix "20.118.99.224/32" -NextHopType Internet
    Set-AzureRoute -RouteTable $rt -RouteName "AzureAZKMS02" -AddressPrefix "40.83.235.53/32" -NextHopType Internet
    
    # Apply the KMS route table to the subnet that hosts the problem VMs (in this case, we apply it to the subnet that's named Subnet-1):
    Set-AzureSubnetRouteTable -VirtualNetworkName "VNet-DM" -SubnetName "Subnet-1" 
    -RouteTableName "VNet-DM-KmsRouteTable"
    
    
  3. ライセンス認証の問題がある VM に移動します。 PsPing を使用して、KMS サーバーにアクセスできるかどうかをテストします。

    psping kms.core.windows.net:1688
    psping azkms.core.windows.net:1688
    
  4. Windows のライセンス認証を試してみて、問題が解決されるかどうかを確認します。

次の手順

お問い合わせはこちらから

質問がある場合やヘルプが必要な場合は、サポート要求を作成するか、Azure コミュニティ サポートにお問い合わせください。