为 P2S OpenVPN 协议连接配置 VPN 客户端:Microsoft Entra 身份验证

本文有助于你配置 VPN 客户端,以使用点到站点 VPN 和 Microsoft Entra 身份验证进行连接。 在使用 Microsoft Entra ID 进行连接和身份验证之前,必须先配置 Microsoft Entra 租户。 有关详细信息,请参阅配置 Microsoft Entra 租户

注意

Microsoft Entra 身份验证仅支持用于 OpenVPN® 协议连接。

使用客户端配置文件

对于要通过 VPN 客户端连接到 VNet 的每台计算机,需要下载适用于该计算机的 Azure VPN 客户端,还需要配置 VPN 客户端配置文件。 如果要配置多台计算机,则可以在一台计算机上创建客户端配置文件,将其导出后再导入到其他计算机。

下载 Azure VPN 客户端

  1. 使用下列其中一个链接下载最新版本的 Azure VPN 客户端安装文件:

  2. 将 Azure VPN 客户端安装到每台计算机。

  3. 验证 Azure VPN 客户端是否有权在后台运行。 有关步骤,请参阅 Windows 后台应用

  4. 若要验证已安装的客户端版本,请打开 Azure VPN 客户端。 转到客户端底部并单击“... -> ? 帮助”。 在右窗格中,可以看到客户端版本号。

创建基于证书的客户端配置文件

使用基于证书的配置文件时,请确保已在客户端计算机上安装适当的证书。 使用 Azure VPN 客户端版本 2.1963.44.0 或更高版本时,可以安装和指定多个证书。 有关证书的详细信息,请参阅安装客户端证书

Screenshot showing certificates certificate authentication.

创建 RADIUS 客户端配置文件

Screenshot shows RADIUS connection client information.

注意

可以在 P2S VPN 客户端配置文件中导出服务器机密。 若要导出客户端配置文件,请参阅用户 VPN 客户端配置文件

导出和分发客户端配置文件

创建有效的配置文件后,如果需要将其分发给其他用户,可使用以下步骤将其导出:

  1. 突出显示要导出的 VPN 客户端配置文件,然后依次选择“...”、“导出”。

    Screenshot shows Export selected from the menu.

  2. 选择要将此配置文件保存到的位置,保留默认的文件名,然后选择“保存”以保存 xml 文件。

    Screenshot shows a Save As dialog box where you can enter a file name.

导入客户端配置文件

  1. 在页面上,选择“导入”。

    Screenshot shows Import selected from the plus menu.

  2. 浏览到 XML 配置文件并将其选中。 选择该文件后,选择“打开”。

    Screenshot shows an Open dialog box where you can select a file.

  3. 指定配置文件的名称,并选择“保存”。

    Screenshot shows the Connection Name added and the Save button selected.

  4. 选择“连接”以连接到 VPN。

    Screenshot shows the Connect button for the for the connection you just created.

  5. 连接后,图标将变为绿色并指示“已连接”。

    Screenshot shows the connection in a Connected status with the option to disconnect.

删除客户端配置文件

  1. 选择要删除的客户端配置文件旁边的省略号图标。 然后选择“删除” 。

    Screenshot shows Remove selected from the menu.

  2. 选择“删除”以删除配置文件。

    Screenshot shows a confirmation dialog box with the option to Remove or Cancel.

创建连接

  1. 在页面上,选择 +,然后选择“+ 添加”。

    Screenshot shows Add selected from the plus menu.

  2. 填写连接信息。 如果你不确定要输入哪些值,请与管理员联系。 填写值后,选择“保存”。

    Screenshot shows pane where you can enter the required values.

  3. 选择“连接”以连接到 VPN。

    Screenshot shows the Connect button for your connection.

  4. 选择正确的凭据,然后选择“继续”。

    Screenshot shows the Sign in dialog box.

  5. 成功连接后,图标将变为绿色并指示“已连接”。

    Screenshot shows the connection in a Connected status.

自动连接

以下步骤帮助你配置自动连接并始终保持连接。

  1. 在 VPN 客户端的主页上,选择“VPN 设置”。

    Screenshot shows V P N Connections where you can select V P N Settings.

  2. 在切换应用对话框中选择“是”。

    Screenshot shows a verification message about switching apps.

  3. 请确保要设置的连接尚未建立连接,然后突出显示该配置文件并选中“自动连接”复选框。

    Screenshot shows a Settings dialog box where you can select Connect automatically.

  4. 选择“连接”启动 VPN 连接。

    Screenshot shows the Connect button.

诊断连接问题

  1. 若要诊断连接问题,可以使用“诊断”工具。 选择要诊断的 VPN 连接旁边的“...”以显示菜单。 然后选择“诊断”。

    Screenshot shows Diagnose selected from the menu.

  2. 在“连接属性”页上,选择“运行诊断”。

    Screenshot shows the Run Diagnosis button for a connection.

  3. 使用凭据登录。

    Screenshot shows the Sign in dialog box for this action.

  4. 查看诊断结果。

    Screenshot shows the results of the diagnosis.

可选客户端设置

可以为 Azure VPN 客户端配置可选设置,例如强制隧道、排除路由、DNS 和证书身份验证设置。 有关步骤,请参阅配置 Azure VPN 客户端可选设置

后续步骤

有关详细信息,请参阅为使用 Microsoft Entra 身份验证的 P2S 开放 VPN 连接创建 Microsoft Entra 租户