AlwaysOn VPN 是 Windows Server 中的远程访问解决方案,为远程用户与企业网络提供无缝且安全的连接。 它支持高级身份验证方法并与现有基础结构集成,提供传统 VPN 解决方案的新式替代方法。 本教程将开始本系列,以在示例环境中部署 AlwaysOn VPN。
本教程介绍如何为已加入域的远程 Windows 客户端计算机部署 AlwaysOn VPN 连接的示例基础结构。 若要创建示例基础结构,需要:
- 创建 Active Directory 域控制器。
- 为证书自动注册配置组策略。
- 创建网络策略服务器 (NPS) 服务器。
- 创建 VPN 服务器。
- 创建 VPN 用户和组。
- 将 VPN 服务器配置为 RADIUS 客户端。
- 将 NPS 服务器配置为 RADIUS 服务器。
若要详细了解 AlwaysOn VPN,包括支持的集成、安全性和连接功能,请参阅 AlwaysOn VPN 概述。
Prerequisites
若要完成本教程中的步骤,需要满足以下先决条件:
运行受支持的 Windows Server 版本的三台服务器(物理服务器或虚拟服务器)。 这些服务器是域控制器、NPS 服务器和 VPN 服务器。
用于 NPS 服务器的服务器需要安装两个物理网络适配器:一个用于连接到 Internet,一个用于连接到域控制器所在的网络。
A user account on all machines that is a member of the local Administrators security group, or equivalent.
Important
不支持在 Microsoft Azure 中使用远程访问。 有关详细信息,请参阅 Microsoft 服务器软件对 Microsoft Azure 虚拟机的支持。
创建域控制器
在要成为域控制器的服务器上,安装 Active Directory 域服务(AD DS)。 有关如何安装 AD DS 的详细信息,请参阅安装 Active Directory 域服务。
将 Windows Server 提升为域控制器。 对于本教程,你将创建一个新林,并在该新林中创建域。 有关如何安装域控制器的详细信息,请参阅 AD DS 安装。
在域控制器上安装并配置证书颁发机构 (CA)。 有关如何安装 CA 的详细信息,请参阅 “安装证书颁发机构”。
为证书的自动注册配置组策略
在本部分中,将在域控制器上创建组策略,以便域成员自动请求用户和计算机证书。 此配置使 VPN 用户能够请求和检索自动对 VPN 连接进行身份验证的用户证书。 此策略还允许 NPS 服务器自动请求服务器身份验证证书。
在域控制器上,打开组策略管理控制台。
在左窗格中,右键单击你的域(例如,
corp.contoso.com
)。 选择“在这个域中创建 GPO 并在此处链接”。On the New GPO dialog box, for Name, enter Autoenrollment Policy. Select OK.
In the left pane, right-click Autoenrollment Policy. Select Edit to open the Group Policy Management Editor.
在 组策略管理编辑器中,完成以下步骤以配置计算机证书自动注册:
Navigate to Computer Configuration>Policies>Windows Settings>Security Settings>Public Key Policies.
在详细信息窗格中,右键单击“证书服务客户端 - 自动注册”。 Select Properties.
在“证书服务客户端 - 自动注册属性”对话框,对于“配置模型”,请选择“启用”。
选中“续订过期证书、更新未决证书并删除吊销的证书”以及“使用证书模板的更新证书”。
Select OK.
在 组策略管理编辑器中,完成以下步骤以配置用户证书自动注册:
Navigate to User Configuration>Policies>Windows Settings>Security Settings>Public Key Policies.
在详细信息窗格中,右键单击“证书服务客户端 - 自动注册”,然后选择“属性”。
在“证书服务客户端 - 自动注册属性”对话框的“配置模型”中,选择“启用”。
选中“续订过期证书、更新未决证书并删除吊销的证书”以及“使用证书模板的更新证书”。
Select OK.
关闭组策略管理编辑器。
将组策略应用于域中的用户和计算机。
关闭“组策略管理”控制台。
创建 NPS 服务器
在要成为 NPS 服务器的服务器上,安装 网络策略和访问服务 (NPS) 角色。 有关如何安装 NPS 的详细信息,请参阅 安装网络策略服务器。
在 Active Directory 中注册 NPS 服务器。 有关如何在 Active Directory 中注册 NPS 服务器的信息,请参阅在Active Directory 域中注册 NPS。
确保防火墙允许正常进行 VPN 和 RADIUS 通信而所需的流量。 有关详细信息,请参阅为 RADIUS 流量配置防火墙。
创建 NPS 服务器组:
在域控制器上,打开“Active Directory 用户和计算机”。
Under your domain, right-click Computers. Select New, then select Group.
In Group name, enter NPS Servers, then select OK.
Right-click NPS Servers and select Properties.
On the Members tab of the NPS Servers Properties dialog box, select Add.
Select Object Types, select the Computers check box, then select OK.
在 输入要选择的对象名称中,输入 NPS 服务器的主机名。 Select OK.
关闭“Active Directory 用户和计算机”。
创建 VPN 服务器
对于运行 VPN 服务器的服务器,请确保计算机安装了两个物理网络适配器:一个连接到 Internet,一个用于连接到域控制器所在的网络。
确定哪个网络适配器连接到 Internet,哪个网络适配器连接到域。 使用公共 IP 地址配置面向 Internet 的网络适配器,而面向 Intranet 的适配器可以使用本地网络的 IP 地址。
对于连接到域的网络适配器,请将 DNS 首选 IP 地址设置为域控制器的 IP 地址。
将 VPN 服务器加入域。 有关如何将服务器加入域的信息,请参阅将服务器加入域。
打开防火墙规则,允许 UDP 端口 500 和 4500 入站连接到应用于 VPN 服务器上的公共接口的外部 IP 地址。 对于连接到域的网络适配器,请允许以下 UDP 端口:1812、1813、1645 和 1646。
创建 VPN 服务器组:
在域控制器上,打开“Active Directory 用户和计算机”。
Under your domain, right-click Computers. Select New, then select Group.
In Group name, enter VPN Servers, then select OK.
Right-click VPN Servers and select Properties.
On the Members tab of the VPN Servers Properties dialog box, select Add.
Select Object Types, select the Computers check box, then select OK.
在 输入要选择的对象名称中,输入 VPN 服务器的主机名。 Select OK.
关闭“Active Directory 用户和计算机”。
按照将远程访问安装为 VPN 服务器中的步骤安装 VPN 服务器。
从服务器管理器打开 路由和远程访问 。
Right-click the name of the VPN server, and then select Properties.
In Properties, select the Security tab and then:
Select Authentication provider and select RADIUS Authentication.
Select Configure to open the RADIUS Authentication dialog.
Select Add to open the Add RADIUS Server dialog.
In Server name, enter the Fully Qualified Domain Name (FQDN) of the NPS server, which is also a RADIUS server. 例如,如果 NPS 和域控制器服务器的 NetBIOS 名称与域名相同
nps1
corp.contoso.com
,请输入nps1.corp.contoso.com
。In Shared secret, select Change to open the Change Secret dialog box.
In New secret, enter a text string.
在“确认新机密”中输入相同的文本字符串,然后选择“确定”。
保存此机密。 在本教程的后面部分将此 VPN 服务器添加为 RADIUS 客户端时,需要用到它。
Select OK to close the Add RADIUS Server dialog.
Select OK to close the RADIUS Authentication dialog.
On the VPN server Properties dialog, select Authentication Methods....
选择“允许进行用于 IKEv2 的计算机证书身份验证”。
Select OK.
For Accounting provider, select Windows Accounting.
Select OK to close the Properties dialog.
对话框会提示重启服务器。 Select Yes.
创建 VPN 用户和组
执行以下步骤创建 VPN 用户:
- 在域控制器上,打开 Active Directory 用户和计算机 控制台。
- Under your domain, right-click Users. Select New. 对于 用户登录名,请输入任何名称。 Select Next.
- 选择用户的密码。
- 取消选择“用户在下次登录时必须更改密码”。 选择“密码永不过期”。
- Select Finish. 将“Active Directory 用户和计算机”保持打开状态。
执行以下步骤创建 VPN 用户组:
- Under your domain, right-click Users. Select New, then select Group.
- In Group name, enter VPN Users, then select OK.
- Right-click VPN Users and select Properties.
- On the Members tab of the VPN Users Properties dialog box, select Add.
- On the Select Users dialog box, add the VPN user that you created and select OK.
将 VPN 服务器配置为 RADIUS 客户端
在 NPS 服务器上,打开防火墙规则以允许 UDP 端口 1812、1813、1645 和 1646 入站,包括 Windows 防火墙。
打开 网络策略服务器 控制台。
在 NPS 控制台中,双击“RADIUS 客户端和服务器”。
Right-click RADIUS Clients and select New to open the New RADIUS Client dialog box.
确认已选中“启用此 RADIUS 客户端”复选框。
In Friendly name, enter a display name for the VPN server.
在 地址(IP 或 DNS)中,输入 VPN 服务器的 IP 地址或 FQDN。
If you enter the FQDN, select Verify if you want to verify that the name is correct and maps to a valid IP address.
In Shared secret:
- Ensure that Manual is selected.
- 输入在创建 VPN 服务器部分中创建的机密。
- 对于 “确认共享机密”,请重新输入共享机密。
Select OK. 该 VPN 服务器应会显示在 NPS 服务器上配置的 RADIUS 客户端列表中。
将 NPS 服务器配置为 RADIUS 服务器
为 NPS 服务器注册服务器证书,该 证书符合为 PEAP 和 EAP 要求配置证书模板中的要求。 若要验证网络策略服务器(NPS)服务器是否已使用证书颁发机构(CA)的服务器证书注册,请参阅 验证服务器证书注册。
In the NPS console, select NPS (Local).
In Standard Configuration, ensure that RADIUS server for Dial-Up or VPN Connections is selected.
选择“ 配置 VPN”或“拨号” 以打开 “配置 VPN”或“拨号 ”向导。
选择 虚拟专用网络(VPN)连接,然后选择“ 下一步”。
在 “指定拨号”或“VPN 服务器”中,在 RADIUS 客户端中,选择 VPN 服务器的名称。
Select Next.
在 “配置身份验证方法”中,完成以下步骤:
清除Microsoft加密身份验证版本 2(MS-CHAPv2)。
选择“可扩展身份验证协议”。
For Type, select Microsoft: Protected EAP (PEAP). Then select Configure to open the Edit Protected EAP Properties dialog box.
Select Remove to remove the Secured Password (EAP-MSCHAP v2) EAP type.
Select Add. 此时会打开“添加 EAP”对话框。
选择“智能卡或其他证书”,然后选择“确定”。
Select OK to close Edit Protected EAP Properties.
Select Next.
在 “指定用户组”中,完成以下步骤:
Select Add. “ 选择用户、计算机、服务帐户或组 ”对话框随即打开。
Enter VPN Users, then select OK.
Select Next.
在“指定 IP 筛选器”中选择“下一步”。
在“指定加密设置”中选择“下一步”。 不要进行任何更改。
在“指定一个领域名称”中选择“下一步”。
Select Finish to close the wizard.
Next step
创建示例基础结构后,即可开始配置证书颁发机构。