本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Step 1: Set up your AWS environment for AWS Managed Microsoft AD
您必须先设置 AWS Managed Microsoft AD 密钥对来对所有登录数据进行加密,然后才能在 AWS 测试实验室中创建 Amazon EC2
创建密钥对
如果您已有已密钥对,可跳过本步骤。有关 Amazon EC2 密钥对的更多信息,请参阅 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html.
创建密钥对
-
登录 AWS 管理控制台并通过以下网址打开 Amazon EC2 控制台:https://console.amazonaws.cn/ec2/
。 -
在导航窗格中的 Network & Security 下,选择 Key Pairs,然后选择 Create Key Pair.
-
For Key pair name, type
AWS-DS-KP
. For Key pair file format, select pem, and then choose Create. -
您的浏览器会自动下载私有密钥文件。The file name is the name you specified when you created your key pair with an extension of
.pem
. Save the private key file in a safe place.重要 这是您保存私有密钥文件的唯一机会。当您启动实例时,需要提供密钥对的名称;当您解密实例密码时,需要提供相应的私有密钥。
Create, configure, and peer two VPCs
As shown in the following illustration, by the time you finish this multi-step process
you will have created and configured two public VPCs, two public subnets per VPC,
one Internet Gateway per VPC, and one VPC Peering connection between the VPCs. We
chose to use public VPCs and subnets for the purpose of simplicity and cost. For production
workloads, we recommend that you use private VPCs. For more information about improving
VPC Security, see Security in Amazon Virtual Private Cloud

All of the AWS CLI and PowerShell examples use the VPC information from below and
are built in us-west-2. You may choose any supported Region
Step 1: Create two VPCs
In this step, you need to create two VPCs in the same account using the specified parameters in the following table. AWS Managed Microsoft AD supports the use of separate accounts with the 共享您的目录 feature. 第一个 VPC 将用于 AWS Managed Microsoft AD。第二个 VPC 将用于以后可能在 中使用的资源。教程:创建从 AWS Managed Microsoft AD 到 上自行管理的 Active Directory 安装的信任 Amazon EC2.
托管 AD VPC 信息 |
本地 VPC 信息 |
---|---|
名称标签:AWS-DS-VPC01 IPv4 CIDR block: 10.0.0.0/16 IPv6 CIDR block: No IPv6 CIDR Block 租期:默认 |
名称标签:AWS-OnPrem-VPC01 IPv4 CIDR block: 10.100.0.0/16 IPv6 CIDR block: No IPv6 CIDR Block 租期:默认 |
有关详细说明,请参阅创建 VPC
步骤 2:每个 VPC 创建两个子网
After you have created the VPCs you will need to create two subnets per VPC using the specified parameters in the following table. 对于本测试实验室,每个子网将是 /24。这将允许每个子网最多发出 256 个地址。每个子网必须位于单独的可用区中。将每个子网单独放在可用区中是 之一。AWS Managed Microsoft AD先决条件.
AWS-DS-VPC01 子网信息: |
AWS-OnPrem-VPC01 子网信息 |
---|---|
名称标签:AWS-DS-VPC01-Subnet01 VPC:vpc-xxxxxxxxxxxxxxxxx AWS-DS-VPC01 可用区:us-west-2a IPv4 CIDR block: 10.0.0.0/24 |
名称标签:AWS-OnPrem-VPC01-Subnet01 VPC:vpc-xxxxxxxxxxxxxxxxx AWS-OnPrem-VPC01 可用区:us-west-2a IPv4 CIDR block: 10.100.0.0/24 |
名称标签:AWS-DS-VPC01-Subnet02 VPC:vpc-xxxxxxxxxxxxxxxxx AWS-DS-VPC01 可用区:us-west-2b IPv4 CIDR block: 10.0.1.0/24 |
名称标签:AWS-OnPrem-VPC01-Subnet02 VPC:vpc-xxxxxxxxxxxxxxxxx AWS-OnPrem-VPC01 可用区:us-west-2b IPv4 CIDR block: 10.100.1.0/24 |
有关详细说明,请参阅在 VPC 中创建子网
Step 3: Create and attach an Internet Gateway to your VPCs
Since we are using public VPCs you will need to create and attach an Internet gateway to your VPCs using the specified parameters in the following table. 这将允许您连接和管理您的 EC2 实例。
AWS-DS-VPC01 Internet 网关信息 |
AWS-OnPrem-VPC01 Internet 网关信息 |
---|---|
名称标签:AWS-DS-VPC01-IGW VPC:vpc-xxxxxxxxxxxxxxxxx AWS-DS-VPC01 |
名称标签:AWS-OnPrem-VPC01-IGW VPC:vpc-xxxxxxxxxxxxxxxxx AWS-OnPrem-VPC01 |
有关详细说明,请参阅 Internet 网关
步骤 4:在 AWS-DS-VPC01 和 AWS-OnPrem-VPC01 之间配置 VPC 对等连接
Since you already created two VPCs earlier, you will need to network them together
using VPC peering using the specified parameters in the following table. While there
are many ways to connect your VPCs, this tutorial will use VPC Peering. AWS Managed
Microsoft AD supports many solutions to connect your VPCs, some of these include VPC peering
对等连接名称标签:AWS-DS-VPC01&AWS-OnPrem-VPC01-Peer VPC(请求者):vpc-xxxxxxxxxxxxxxxxx AWS-DS-VPC01 账户:我的账户 区域:此区域 VPC(接受者):vpc-xxxxxxxxxxxxxxxxx AWS-OnPrem-VPC01 |
有关如何在您账户中的两个 VPC 之间创建 VPC 对等连接的说明,请参阅在您账户中的两个 VPC 之间创建 VPC 对等连接
步骤 5:向每个 VPC 的主路由表添加两条路由
In order for the Internet Gateways and VPC Peering Connection created in the previous steps to be functional you will need to update the main route table of both VPCs using the specified parameters in the following table. 您将添加两条路由:0.0.0.0/0(它将路由到路由表未明确知道的所有目的地)和 10.0.0.0/16 或 10.100.0.0/16(它将通过上面建立的 VPC 对等连接路由到每个 VPC)。
您可以通过筛选 VPC 名称标签(AWS-DS-VPC01 或 AWS-OnPrem-VPC01),轻松找到每个 VPC 的正确路由表。
AWS-DS-VPC01 路由 1 信息 |
AWS-DS-VPC01 路由 2 信息 |
AWS-OnPrem-VPC01 路由 1 信息 |
AWS-OnPrem-VPC01 路由 2 信息 |
---|---|---|---|
目的地:0.0.0.0/0 目标:igw-xxxxxxxxxxxxxxxxx AWS-DS-VPC01-IGW |
目的地:10.100.0.0/16 目标:pcx-xxxxxxxxxxxxxxxxx AWS-DS-VPC01&AWS-OnPrem-VPC01-Peer |
目的地:0.0.0.0/0 目标:igw-xxxxxxxxxxxxxxxxx AWS-Onprem-VPC01 |
目的地:10.0.0.0/16 目标:pcx-xxxxxxxxxxxxxxxxx AWS-DS-VPC01&AWS-OnPrem-VPC01-Peer |
有关如何向 VPC 路由表添加路由的说明,请参阅从路由表添加和删除路由
Create security groups for EC2 instances
默认情况下,AWS Managed Microsoft AD 创建安全组来管理其域控制器之间的流量。在本节中,您需要创建 2 个安全组(每个 VPC 一个),它们用于使用下表中的指定参数管理 EC2 实例的 VPC 内流量。您还需要添加规则,允许从任意位置的 RDP (3389) 入站,以及来自本地 VPC 的所有流量类型入站。For more information, see Amazon EC2 security groups for Windows instances.
AWS-DS-VPC01 安全组信息: |
---|
安全组名称:AWS DS 测试实验室安全组 描述:AWS DS 测试实验室安全组 VPC:vpc-xxxxxxxxxxxxxxxxx AWS-DS-VPC01 |
AWS-DS-VPC01 的安全组入站规则
Type | 协议 | 端口范围 | 源 | 流量的类型 |
---|---|---|---|---|
自定义 TCP 规则 | TCP | 3389 | 我的 IP | 远程桌面 |
所有流量 | 全部 | 全部 | 10.0.0.0/16 | 所有本地 VPC 流量 |
AWS-DS-VPC01 的安全组出站规则
Type | 协议 | 端口范围 | 源 | 流量的类型 |
---|---|---|---|---|
所有流量 | 全部 | 全部 | 0.0.0.0/0 | 所有流量 |
AWS-OnPrem-VPC01 安全组信息: |
---|
Security group name: AWS OnPrem Test Lab Security Group. Description: AWS OnPrem Test Lab Security Group. VPC:vpc-xxxxxxxxxxxxxxxxx AWS-OnPrem-VPC01 |
AWS-OnPrem-VPC01 的安全组入站规则
Type | 协议 | 端口范围 | 源 | 流量的类型 |
---|---|---|---|---|
自定义 TCP 规则 | TCP | 3389 | 我的 IP | 远程桌面 |
自定义 TCP 规则 | TCP | 53 | 10.0.0.0/16 | DNS |
自定义 TCP 规则 | TCP | 88 | 10.0.0.0/16 | Kerberos |
自定义 TCP 规则 | TCP | 389 | 10.0.0.0/16 | LDAP |
自定义 TCP 规则 | TCP | 464 | 10.0.0.0/16 | Kerberos 更改/设置密码 |
自定义 TCP 规则 | TCP | 445 | 10.0.0.0/16 | SMB / CIFS |
自定义 TCP 规则 | TCP | 135 | 10.0.0.0/16 | 复制 |
自定义 TCP 规则 | TCP | 636 | 10.0.0.0/16 | LDAP SSL |
自定义 TCP 规则 | TCP | 49152 - 65535 | 10.0.0.0/16 | RPC |
自定义 TCP 规则 | TCP | 3268 - 3269 | 10.0.0.0/16 | LDAP GC 和 LDAP GC SSL |
自定义 TCP 规则 | UDP | 53 | 10.0.0.0/16 | DNS |
自定义 UDP 规则 | UDP | 88 | 10.0.0.0/16 | Kerberos |
自定义 UDP 规则 | UDP | 123 | 10.0.0.0/16 | Windows 时间 |
自定义 UDP 规则 | UDP | 389 | 10.0.0.0/16 | LDAP |
自定义 UDP 规则 | UDP | 464 | 10.0.0.0/16 | Kerberos 更改/设置密码 |
所有流量 | 全部 | 全部 | 10.100.0.0/16 | 所有本地 VPC 流量 |
AWS-OnPrem-VPC01 的安全组出站规则
Type | 协议 | 端口范围 | 源 | 流量的类型 |
---|---|---|---|---|
所有流量 | 全部 | 全部 | 0.0.0.0/0 | 所有流量 |
有关如何创建规则并将规则添加到安全组的详细说明,请参阅使用安全组