配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)

本文的目的是使用 Microsoft Windows Server 2016/2019 简化 VXLAN BGP EVPN 和 DFA 结构的 DHCP 服务配置。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
在官方文档中,fabric的基于Microsoft Windows Server 2012的DHCP服务被配置为包含一个Loopback池的SuperScope(这个池的亮点是从池中排除该池的所有IP地址(排除的IP地址=池))以及为真实网络发布 IP 地址的池(这里是重点 - 配置策略 - 其中 DHCP 中继电路 ID 被过滤,并且此 DHCP 中继电路 ID 包含网络的 VNI,即对于另一个池,此 DHCP 中继电路 ID 会略有不同)。

To configure DHCP on Windows server. 

1. Create a super scope. Within the super scope, create scope B, S1, S2, S3, …, Sn for the subnet B and the subnets for each segment. 
2. In scope B,  specify the 'Exclusion Range' to be the entire address range (so that the offered address range must not be from this scope). 
3. For every segment scope Si, specify a policy that matches on Agent Circuit ID with value of '0108000600XXXXXX', where '0108000600' is a fixed value for all segments, the 6 numbers "XXXXXX" is the segment ID value in hexadecimal. Also ensure to check the Append wildcard(*) check box. 
4. Set the policy address range to the entire range of the scope.

本文包含以下问题的答案:


内容

介绍

这部分简要列出了所有初始数据:配置网络设备的说明、eVPN 工厂中 DHCP 数据包中使用的 RFC、Cisco 文档中 Microsoft Windows Server 2012 上 DHCP 服务器设置的演变,以供参考。 以及有关 Microsoft Windows 服务器上 DHCP 服务中的超级范围和策略的简要信息。

如何在 VXLAN BGP EVPN、DFA 结构上配置 DHCP 中继

在 VXLAN BGP EVPN 结构上配置 DHCP 中继不是本文的主要主题,因为它非常简单。 我提供了有关网络设备设置的文档链接和剧透。

在 Nexus 9000V v9.2(3) 上设置 DHCP 中继的示例

service dhcp
ip dhcp relay
ip dhcp relay information option
ip dhcp relay information option vpn
interface loopback10
  vrf member VRF1
  ip address 10.120.0.1/32 tag 1234567
interface Vlan12
  no shutdown
  vrf member VRF1
  no ip redirects
  ip address 10.120.251.1/24 tag 1234567
  no ipv6 redirects
  fabric forwarding mode anycast-gateway
  ip dhcp relay address 10.0.0.5
  ip dhcp relay source-interface loopback10

在 VXLAN BGP EVPN 结构中的 DHCP 中继服务操作中实现的 RFC

RFC#6607:子选项 151(0x97) - 虚拟子网选择

•	Sub-option 151(0x97) - Virtual Subnet Selection (Defined in RFC#6607)
Used to convey VRF related information to the DHCP server in an MPLS-VPN and VXLAN EVPN multi-tenant environment.

传输客户端所在VRF的“名称”。

RFC#5107:子选项 11(0xb) - 服务器 ID 覆盖

•	Sub-option 11(0xb) - Server ID Override (Defined in RFC#5107.) 
The server identifier (server ID) override sub-option allows the DHCP relay agent to specify a new value for the server ID option, which is inserted by the DHCP server in the reply packet. This sub-option allows the DHCP relay agent to act as the actual DHCP server such that the renew requests will come to the relay agent rather than the DHCP server directly. The server ID override sub-option contains the incoming interface IP address, which is the IP address on the relay agent that is accessible from the client. Using this information, the DHCP client sends all renew and release request packets to the relay agent. The relay agent adds all of the appropriate sub-options and then forwards the renew and release request packets to the original DHCP server. For this function, Cisco’s proprietary implementation is sub-option 152(0x98). You can use the ip dhcp relay sub-option type cisco command to manage the function.

该选项用于确保客户端向该选项中使用的 IP 地址发送更新地址租约的请求。 (在 Cisco VXLAN BGP 上,EVPN 是客户端的默认网关任播地址。)

RFC#3527:子选项 5(0x5) - 链接选择

Sub-option 5(0x5) - Link Selection (Defined in RFC#3527.) 

The link selection sub-option provides a mechanism to separate the subnet/link on which the DHCP client resides from the gateway address (giaddr), which can be used to communicate with the relay agent by the DHCP server. The relay agent will set the sub-option to the correct subscriber subnet and the DHCP server will use that value to assign an IP address rather than the giaddr value. The relay agent will set the giaddr to its own IP address so that DHCP messages are able to be forwarded over the network. For this function, Cisco’s proprietary implementation is sub-option 150(0x96). You can use the ip dhcp relay sub-option type ciscocommand to manage the function.

客户端需要 IP 地址的网络地址。

有关在 Microsoft Windows Server 2012 上配置 DHCP 的 Cisco 文档的演变

我包含此部分是因为供应商方面出现了积极的趋势:

Nexus 9000 VXLAN 配置指南 7.3

本文档仅介绍如何在网络设备上配置 DHCP 中继。

另一篇文章用于在Windows Server 2012上配置DHCP:

配置 Microsoft Windows Server 2012 以在 eVPN 场景(VXLAN、Cisco One Fabric 等)中提供 DHCP 服务

本文指出每个网络/VNI 都需要自己的 SuperScope 捆绑包和自己的环回地址集:

If multiple DHCP Scopes are required for multiple subnets, you need to create one LoopbackX per subnet/vlan on all LEAFS and create a superscope with a loopbackX range scope and actual client IP subnet scope per vlan.

Nexus 9000 VXLAN 配置指南 9.3

在设置网络设备的文档中添加了 Windows 2012 Server 设置。 对于所有使用的地址池,每个数据中心需要一个 SuperScope,这个 SuperScope 是数据中心的边界:

Create Superscope for all scopes you want to use for Option 82-based policies.
Note
The Superscope should combine all scopes and act as the administrative boundary.

思科动态结构自动化

一切都被非常简洁地解释:

Let us assume the switch is using the address from subnet B (it can be the backbone subnet, management subnet, or any customer designated subnet for this purpose) to communicate with the Windows DHCP server. In DFA we have subnets S1, S2, S3, …, Sn for segment s1, s2, s3, …, sn. 

To configure DHCP on Windows server. 

1. Create a super scope. Within the super scope, create scope B, S1, S2, S3, …, Sn for the subnet B and the subnets for each segment. 
2. In scope B,  specify the 'Exclusion Range' to be the entire address range (so that the offered address range must not be from this scope). 
3. For every segment scope Si, specify a policy that matches on Agent Circuit ID with value of '0108000600XXXXXX', where '0108000600' is a fixed value for all segments, the 6 numbers "XXXXXX" is the segment ID value in hexadecimal. Also ensure to check the Append wildcard(*) check box. 
4. Set the policy address range to the entire range of the scope.

Microsoft Windows Server 中的 DHCP(超级范围和策略)

超级视野

Superscope is an administrative feature of a DHCP server that can be used to group multiple scopes as a single administrative entity. Superscope allows a DHCP server to provide leases from more than one scope to clients on a single physical network. Scopes added to a superscope are called member scopes.

什么是 SuperScope - 它是一项允许您将多个 IP 地址池组合到一个管理单元中的功能。 向同一物理网络(同一 VLAN 中)上的用户通告来自多个池的 IP 地址。 如果请求到达作为超级作用域一部分的地址池,则可以向客户端提供来自该超级作用域中包含的另一个作用域的地址。

策略

The DHCP Server role in Windows Server 2012 introduces a new feature that allows you to create IPv4 policies that specify custom IP address and option assignments for DHCP clients based on a set of conditions.

The policy based assignment (PBA) feature allows you to group DHCP clients by specific attributes based on fields contained in the DHCP client request packet. PBA enables targeted administration and greater control of the configuration parameters delivered to network devices with DHCP.

策略 – 允许您根据用户或参数的类型向用户分配 IP 地址。 思科工程师使用 Windows Server 2012 中的策略按 VNI(虚拟网络标识符)进行过滤。

主要部分

本节包含研究结果、为什么不支持它、它是如何工作的(逻辑)、新内容以及新内容将如何帮助我们。

为什么不支持 Microsoft Windows Server 2000/2003/2008?

Microsoft Windows Server 2008及更早版本不处理选项82,并且发送返回数据包时不带选项82。

Win2k8 R2 Option82 的 DHCP 问题

  1. 来自客户端的请求被发送到广播(DHCP 发现)。
  2. 设备(Nexus)将数据包发送到 DHCP 服务器(DHCP Discover + Option 82)。
  3. DHCP 服务器接收数据包,对其进行处理,然后将其发回,但不带选项 82。(DHCP 提供 – 不带选项 82)
  4. 设备(Nexus)从 DHCP 服务器接收数据包。 (DHCP Offer) 但不将此数据包发送给最终用户。

嗅探器数据 - 在 Windows Server 2008 和 DHCP 客户端上Windows Server 2008 接收来自网络设备的请求。 (选项 82 出现在列表中)

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
Windows Server 2008 将响应发送到网络设备。 (选件 82 未作为选件列在包装中)
配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
来自客户端的请求 - 存在 DHCP Discover,但缺少 DHCP Offer
配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
网络设备统计:

NEXUS-9000V-SW-1# show ip dhcp relay statistics 
----------------------------------------------------------------------
Message Type             Rx              Tx           Drops  
----------------------------------------------------------------------
Discover                  8               8               0
Offer                     8               8               0
Request(*)                0               0               0
Ack                       0               0               0
Release(*)                0               0               0
Decline                   0               0               0
Inform(*)                 0               0               0
Nack                      0               0               0
----------------------------------------------------------------------
Total                    16              16               0
----------------------------------------------------------------------

DHCP L3 FWD:
Total Packets Received                           :         0
Total Packets Forwarded                          :         0
Total Packets Dropped                            :         0
Non DHCP:
Total Packets Received                           :         0
Total Packets Forwarded                          :         0
Total Packets Dropped                            :         0
DROP:
DHCP Relay not enabled                           :         0
Invalid DHCP message type                        :         0
Interface error                                  :         0
Tx failure towards server                        :         0
Tx failure towards client                        :         0
Unknown output interface                         :         0
Unknown vrf or interface for server              :         0
Max hops exceeded                                :         0
Option 82 validation failed                      :         0
Packet Malformed                                 :         0
Relay Trusted port not configured                :         0
DHCP Request dropped on MCT                      :         0
*  -  These counters will show correct value when switch 
receives DHCP request packet with destination ip as broadcast
address. If request is unicast it will be HW switched
NEXUS-9000V-SW-1#

为什么 Microsoft Windows Server 2012 中的配置如此困难?

Microsoft Windows Server 2012 尚不支持 RFC#3527(选项 82 子选项 5(0x5) - 链接选择)
但策略功能已经实现。

它是如何工作的:

  • Microsoft Windows Server 2012 有一个超级池(SuperScope),它具有用于真实网络的环回地址和池。
  • 用于发布 IP 地址的池的选择属于 SuperScope,因为响应来自 DHCP 中继,且 SuperScope 中包含环回源地址。
  • 使用策略,请求从超级范围中选择其 VNI 包含在选项 82 子选项 1 代理电路 ID 中的成员范围。 (“0108000600”+ 24位VNI + 24位我不知道其值,但嗅探器显示该字段的值为0。)

Microsoft Windows Server 2016/2019 中的设置如何简化?

Microsoft Windows Server 2016 实现 RFC#3527 功能。 也就是说,Windows Server 2016 可以从 Option 82 Sub-option 5(0x5) - Link Selection 属性识别正确的网络

立即出现三个问题:

  • 我们可以不用 Superscope 吗?
  • 我们可以不使用Policy并将VNI转换为十六进制形式吗?
  • 我们可以不使用环回 DHCP 源地址范围吗?

Q. 我们可以不用 Superscope 吗?
A. 是的,可以在 IPv4 地址区域立即创建范围。
Q. 我们可以不使用Policy并将VNI转换为十六进制形式吗?
A. 是的,网络选择基于选项 82 子选项 0x5,
Q. 我们可以不使用环回 DHCP 源地址范围吗?
A. 不,我们不可以。 因为 Microsoft Windows Server 2016/2019 具有针对恶意 DHCP 请求的保护。 也就是说,来自不在 DHCP 服务器池中的地址的所有请求都被视为恶意。

DHCP 子网选择选项

 Note
All relay agent IP addresses (GIADDR) must be part of an active DHCP scope IP address range. Any GIADDR outside of the DHCP scope IP address ranges is considered a rogue relay and Windows DHCP Server will not acknowledge DHCP client requests from those relay agents.

A special scope can be created to "authorize" relay agents. Create a scope with the GIADDR (or multiple if the GIADDR's are sequential IP addresses), exclude the GIADDR address(es) from distribution, and then activate the scope. This will authorize the relay agents while preventing the GIADDR addresses from being assigned.

那些。 要在 Microsoft Windows Server 2016/2019 上为 VXLAN BGP EVPN 工厂配置 DHCP 池,您只需:

  • 为源中继地址创建池。
  • 为客户端网络创建池

什么是不必要的(但可以配置并且它将起作用并且不会干扰工作):

  • 创建策略
  • 创建超级范围

例子设置 DHCP 服务器的示例(有 2 个真实的 DHCP 客户端 - 客户端连接到 VXLAN 结构)

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
设置用户池的示例:

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
设置用户池的示例(选择策略 - 证明策略未用于池的正确操作):

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
配置源 DHCP 中继地址池的示例(发放的地址范围完全对应于从地址池中排除):

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
在 Microsoft Windows Server 2019 上设置 DHCP 服务

为 DHCP 中继配置环回地址(源)池。

我们在 IPv4 空间中创建一个新的池(范围)。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
池创建向导。 “下一页>”

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
配置池名称和池描述。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
设置环回的 IP 地址范围和池的掩码。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
添加例外情况。 排除范围必须与池范围完全匹配。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
出租时间。 “下一页>”

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
询问:您现在配置 DHCP 选项(DNS、WINS、网关、域)还是稍后配置。 回答“否”然后手动激活池会更快。 或者直接转到末尾而不填写任何信息,然后在向导末尾激活池。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
我们确认选项未配置且池未激活。 “结束”

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
我们手动激活池。 — 选择范围,然后在上下文菜单中 — 选择“激活”。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)

我们为用户/服务器创建一个池。

我们创建一个新池。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
池创建向导。 “下一页>”

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
配置池名称和池描述。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
设置环回的 IP 地址范围和池的掩码。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
添加例外情况。 (默认不需要例外)“下一步>”

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
出租时间。 “下一页>”

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
询问:您现在配置 DHCP 选项(DNS、WINS、网关、域)还是稍后配置。 现在我们来设置一下。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
配置默认网关地址。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
我们配置域和 DNS 服务器地址。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
配置WINS服务器的IP地址。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
范围激活。

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)
池已配置。 “结束”

配置 Microsoft Windows Server 2016/2019 为 VXLAN 提供 DHCP 服务 (DFA)

结论

使用 Windows Server 2016/2019 降低了为 VXLAN 结构(或任何其他结构)设置 DHCP 服务器的复杂性。 (无需将特殊链接传输给 IT 专家:网络/代理电路 ID 来注册过滤器。)

Windows Server 2012 的配置是否适用于新的 2016/2019 服务器 - 是的,它会起作用。

本文档包含对 2 个版本的引用:7.X 和 9.3。 这是因为版本 7.0(3)I7(7) 是 Cisco 建议的版本,而版本 9.3 是最具创新性的(甚至支持通过 VXLAN 多站点进行组播)。

来源清单

  1. Nexus 9000 VXLAN 配置指南 7.x
  2. Nexus 9000 VXLAN 配置指南 9.3
  3. DFA(思科动态结构自动化)
  4. 配置 Microsoft Windows Server 2012 以在 eVPN 场景(VXLAN、Cisco One Fabric 等)中提供 DHCP 服务
  5. 3.4 DHCP 超级作用域
  6. DHCP策略简介
  7. Win2k8 R2 Option82 的 DHCP 问题
  8. DHCP 子网选择选项

来源: habr.com

添加评论