DHCPv6 服务器
Junos OS 设备可充当 DHCPv6 服务器,并将 IP 地址分配给 IPv6 客户端。DHCPv6 服务器还会将配置设置传送到子网上的客户端主机或需要 IPv6 前缀的发出请求的设备。DHCPv6 本地服务器使用 IPv6 协议发送和接收数据包,并将路由器客户端的路由要求通知 IPv6。有关更多信息,请阅读本主题。
DHCPv6 本地服务器概述
DHCPv6 本地服务器与 DHCP 本地服务器和 DHCP 中继代理兼容,并且可以在与扩展 DHCP 本地服务器或 DHCP 中继代理相同的接口上启用。
DHCPv6 本地服务器提供许多与 DHCP 本地服务器相同的功能,包括:
针对特定接口或一组接口的配置
特定于站点的用户名和密码
编号以太网接口
静态配置的 CoS 和过滤器
AAA 定向登录
使用 IA_NA 选项为客户端分配特定地址
当 DHCPv6 客户端登录时,DHCPv6 本地服务器可以选择使用 AAA 服务框架与 RADIUS 服务器进行交互。独立于 DHCP 配置的 RADIUS 服务器对客户端进行身份验证并提供 IPv6 前缀和客户端配置参数。
客户端用户名(唯一标识订阅者或 DHCP 客户端)必须存在于配置中,DHCPv6 本地服务器才能使用 RADIUS 身份验证。
您可以将 DHCPv6 本地服务器配置为在登录时将以下属性传达给 AAA 服务框架和 RADIUS:
客户端用户名
客户端密码
根据 DHCPv6 本地服务器提供的属性,RADIUS 返回 表 1 中列出的信息以配置客户端:
属性编号 |
属性名称 |
描述 |
---|---|---|
27 |
会话超时 |
租赁时间(以秒为单位)。如果未提供,租约不会过期 |
123 |
委派 IPv6 前缀 |
委派给客户端的前缀 |
26-143 |
每个接口的最大客户端数 |
每个接口允许的最大客户端数 |
要在路由器(或交换机)上配置扩展 DHCPv6 本地服务器,请在层次结构级别包含dhcpv6
[edit system services dhcp-local-server]
语句。
您还可以在以下层次结构级别包含该 dhcpv6
语句:
[edit logical-systems logical-system-name system services dhcp-local-server]
[edit logical-systems logical-system-name routing-instances routing-instance-name system services dhcp-local-server]
[edit routing-instances routing-instance-name system services dhcp-local-server]
DHCPv6 服务器概述
动态主机配置协议版本 6 (DHCPv6) 服务器可以自动将 IP 地址分配给 IPv6 客户端,并将配置设置传递给子网上的客户端主机或需要 IPv6 前缀的请求设备。DHCPv6 服务器允许网络管理员在主机之间集中管理 IP 地址池,并自动分配网络中的 IP 地址。
SRX 系列防火墙不支持 DHCP 客户端身份验证。在 DHCPv6 部署中,对于从 DHCPv6 服务器接收地址和其他属性的任何 DHCP 客户端,安全策略控制通过设备进行的访问。
一些功能包括:
针对特定接口或一组接口的配置
无状态地址自动配置 (SLAAC)
前缀委派,包括接入内部路由安装
DHCPv6 服务器组
DHCPv6 服务器配置通常包含客户端的 DHCPv6 选项、IPv6 前缀、包含 IPv6 地址范围和选项的地址池以及允许 DHCPv6 流量的安全策略。在典型设置中,提供商瞻博网络设备配置为 IPv6 前缀委派服务器,用于为客户边缘设备分配地址。然后,客户的边缘路由器向内部设备提供地址。
要在设备上配置 DHCPv6 本地服务器,请在层次结构级别包含 DHCPv6 语句[edit system services dhcp-local-server]
。然后,您可以使用该family inet6
语句为 DHCPv6 创建在层次结构级别中[edit access address-assignment pool]
配置的地址分配池。
您还可以在 dhcpv6
层次结构中包含 [edit routing-instances routing-instance-name system services dhcp-local-server]
语句。
从早期版本升级到 Junos OS 10.4 版或启用 DHCPv6 服务器时,层次结构中的 [edit system services dhcp]
现有 DHCPv4 配置不受影响。
参见
示例:配置 DHCPv6 服务器选项
此示例说明如何在 SRX1500、SRX5400、SRX5600 和 SRX5800 设备上配置 DHCPv6 服务器选项。
要求
准备工作:
确定 IPv6 地址池范围。
确定 IPv6 前缀。请参阅 了解地址簿。
确定宽限期、最长租约时间或应应用于客户端的任何自定义选项。
列出可用于网络上设备的 IP 地址;例如,DNS 和 SIP 服务器。
概述
在此示例中,您将所有 DHCPv6 组的默认客户端限制设置为 100。然后,创建一个名为 my-group 的组,该组至少包含一个接口。在本例中,接口为 ge-0/0/3.0。您可以使用 upto 命令设置接口范围,并为覆盖默认限制的组 my-group 设置自定义客户端限制为 200。最后,使用 IPv6 地址 2001:db8:3001::1/64 配置接口 ge-0/0/3.0,并为接口 ge-0/0/3.0 设置路由器通告。从 Junos OS 版本 15.X49-D70 和 Junos OS 版本 17.3R1 开始,您可以添加选项 dynamic-server 以动态支持 WAN 服务器更新的前缀和属性。
DHCPv6 组必须至少包含一个接口。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,将命令复制并粘贴到层次结构级别的 CLI [edit]
中,然后从配置模式进入 commit
。
set system services dhcp-local-server dhcpv6 overrides interface-client-limit 100 set system services dhcp-local-server dhcpv6 group my-group interface ge-0/0/3.0 set system services dhcp-local-server dhcpv6 group my-group interface ge-0/0/3.0 upto ge-0/0/6.0 set system services dhcp-local-server dhcpv6 group my-group overrides interface-client-limit 200 set interfaces ge-0/0/3 unit 0 family inet6 address 2001:db8:3000::1/64 set protocols router-advertisement interface ge-0/0/3.0 prefix 2001:db8:3000::/64
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关如何执行此操作的说明,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置 DHCPv6 服务器选项,请执行以下操作:
配置 DHCP 本地服务器。
[edit] user@host# edit system services dhcp-local-server dhcpv6
为所有 DHCPv6 组设置默认限制。
[edit system services dhcp-local-server dhcpv6] user@host# set overrides interface-client-limit 100
指定组名称和接口。
[edit system services dhcp-local-server dhcpv6] user@host# set group my-group interface ge-0/0/3.0
设置接口范围。
[edit system services dhcp-local-server dhcpv6] user@host# set group my-group interface ge-0/0/3.0 upto ge-0/0/6.0
为组设置自定义客户端限制。
[edit system services dhcp-local-server dhcpv6] user@host# set group my-group overrides interface-client-limit 200
使用 IPv6 地址配置接口。
[edit interfaces] user@host# set ge-0/0/3 unit 0 family inet6 address 2001:db8:3000::1/64
为接口设置路由器通告。
[edit protocols] user@host# set router-advertisement interface ge-0/0/3.0 prefix 2001:db8:3000::/64
结果
在配置模式下,输入 show system services dhcp-local-server
、 show interfaces ge-0/0/3
和 show protocols
命令确认您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明以进行更正。
[edit] user@host#show system services dhcp-local-server
dhcpv6 { overrides { interface-client-limit 100; ] group my-group { overrides { interface-client-limit 200; } interface ge-0/0/3.0 { upto ge-0/0/6.0; } } } [edit] user@host#show interfaces ge-0/0/3
unit 0 { family inet6 { address 2001:db8:3000::1/64; } } [edit] user@host#show protocols
router-advertisement { interface ge-0/0/3.0 { prefix 2001:db8:3000::1/64; } }
如果完成设备配置,请从配置模式输入 commit
。
验证
验证 DHCPv6 本地服务器配置
目的
验证是否已配置 DHCPv6 本地服务器的客户端地址绑定和统计信息
行动
在操作模式下,输入命令以 show dhcpv6 server binding
在 DHCPv6 本地服务器上的客户端表中显示地址绑定。
Prefix Session Id Expires State Interface Client DUID 2001:bd8:1111:2222::/64 6 86321 BOUND ge-1/0/0.0 LL_TIME0x1-0x2e159c0-00:10:94:00:00:01 2001:bd8:1111:2222::/64 7 86321 BOUND ge-1/0/0.0 LL_TIME0x1-0x2e159c0-00:10:94:00:00:02 2001:bd8:1111:2222::/64 8 86321 BOUND ge-1/0/0.0 LL_TIME0x1-0x2e159c0-00:10:94:00:00:03 2001:bd8:1111:2222::/64 9 86321 BOUND ge-1/0/0.0 LL_TIME0x1-0x2e159c1-00:10:94:00:00:04 2001:bd8:1111:2222::/64 10 86321 BOUND ge-1/0/0.0 LL_TIME0x1-0x2e159c1-00:10:94:00:00:05
在操作模式下,输入 show dhcpv6 server statistics
命令以显示 DHCPv6 本地服务器统计信息。
Dhcpv6 Packets dropped: Total 0 Messages received: DHCPV6_DECLINE 0 DHCPV6_SOLICIT 9 DHCPV6_INFORMATION_REQUEST 0 DHCPV6_RELEASE 0 DHCPV6_REQUEST 5 DHCPV6_CONFIRM 0 DHCPV6_RENEW 0 DHCPV6_REBIND 0 DHCPV6_RELAY_FORW 0 Messages sent: DHCPV6_ADVERTISE 9 DHCPV6_REPLY 5 DHCPV6_RECONFIGURE 0 DHCPV6_RELAY_REPL 0
clear dhcpv6 server bindings all
命令以清除所有 DHCPv6 本地服务器绑定。您可以清除所有绑定或清除特定接口或路由实例。clear dhcpv6 server statistics
命令以清除所有 DHCPv6 本地服务器统计信息。
为 IPv6 前缀分配指定地址池
DHCPv6 服务器配置通常包含客户端的 DHCPv6 选项、IPv6 前缀、包含 IPv6 地址范围和选项的地址池以及允许 DHCPv6 流量的安全策略。在典型设置中,提供商瞻博网络设备配置为 IPv6 前缀委派服务器,用于为客户边缘设备分配地址。然后,客户的边缘路由器向内部设备提供地址。
要在设备上配置 DHCPv6 本地服务器,请在层次结构级别包含 DHCPv6 语句[edit system services dhcp-local-server]
。然后,您可以使用该family inet6
语句为 DHCPv6 创建在层次结构级别中[edit access address-assignment pool]
配置的地址分配池。
您还可以在 dhcpv6
层次结构中包含 [edit routing-instances routing-instance-name system services dhcp-local-server]
语句。
从早期版本升级到 Junos OS 10.4 版或启用 DHCPv6 服务器时,层次结构中的 [edit system services dhcp]
现有 DHCPv4 配置不受影响。
要为 DHCPv6 本地服务器配置地址池,请执行以下操作:
参见
为 IPv6 前缀分配指定委派地址池
您可以显式指定委托地址池:
在路由器上 — 订阅者管理使用池为订阅者分配 IPv6 前缀。您可以为特定接口组或特定接口全局指定委托地址池。
在交换机上 — DHCP 管理使用池为 DHCP 客户端分配 IPv6 前缀。您可以为特定接口组或特定接口全局指定委托地址池。
您还可以使用瞻博网络 VSA 26-161 指定委托地址池。VSA 指定的值始终优先 delegated-address
于语句。
要为 DHCPv6 本地服务器配置委派地址池,请执行以下操作:
参见
防止绑定不支持重新配置消息的客户端
DHCPv6 客户端和服务器协商使用重新配置消息。当客户端可以接受来自服务器的重新配置消息时,客户端会在发送到服务器的请求和请求消息中包含“重新配置接受”选项。
默认情况下,DHCPv6 服务器接受来自客户端的请求消息,无论它们是否支持重新配置。可以指定服务器要求客户端接受重新配置消息。在这种情况下,当为客户端接口配置重新配置时,DHCPv6 服务器会在播发和回复消息中包含“重新配置接受”选项。来自不支持的客户端的请求消息将被丢弃,并且不允许绑定客户端。
要将 DHCPv6 本地服务器配置为仅绑定支持客户端启动的重新配置的客户端,请执行以下操作:
指定严格的重新配置。
对于所有 DHCPv6 客户端:
[edit system services dhcp-local-server dhcpv6 reconfigure] user@host# set strict
仅适用于一组特定的 DHCPv6 客户端:
[edit system services dhcp-local-server dhcpv6 group group-name reconfigure] user@host# set strict
该 show dhcpv6 server statistics
命令显示服务器已丢弃的请求消息计数。
参见
配置 DHCPv6 快速提交(MX 系列、EX 系列)
您可以将 DHCPv6 本地服务器配置为支持 DHCPv6 快速提交选项(DHCPv6 选项 14)。启用快速提交后,服务器将在“请求从 DHCPv6 客户端发送的消息”中识别“快速提交”选项。(DHCPv6 客户端单独配置为在请求消息中包含 DHCPv6 快速提交选项。然后,服务器和客户端使用双消息交换(请求和答复)来配置客户端,而不是默认的四消息交换(请求、播发、请求和答复)。双消息交换提供了更快的客户端配置,在网络负载较重的环境中非常有用。
您可以将 DHCPv6 本地服务器配置为全局、特定组或特定接口支持快速提交选项。默认情况下,DHCPv6 本地服务器上禁用快速提交支持。
要将 DHCPv6 本地服务器配置为支持 DHCPv6 快速提交选项,请执行以下操作:
参见
允许 DHCPv6 流量的主机入站流量
要使 DHCPv6 服务器允许 DHCPv6 请求,必须将主机入站流量系统服务配置为允许 DCHPv6 流量。在此示例中,区域 my-zone 允许来自区域不信任的 DHCPv6 流量,并且 ge-0/0/3.0 接口配置了 IPv6 地址 2001:db8:3001::1。
要创建安全区域策略以允许在 SRX1500、SRX5400、SRX5600 和 SRX5800 设备上使用 DHCPv6,请执行以下操作:
参见
验证和管理 DHCPv6 本地服务器配置
目的
查看或清除有关 DHCPv6 本地服务器的客户端地址绑定和统计信息的信息。
行动
要在 DHCPv6 本地服务器上的客户端表中显示地址绑定,请执行以下操作:
user@host> show dhcpv6 server binding
要显示 DHCPv6 本地服务器统计信息,请执行以下操作:
user@host> show dhcpv6 server statistics
要清除所有 DHCPv6 本地服务器统计信息,请执行以下操作:
user@host> clear dhcpv6 server binding
要清除所有 DHCPv6 本地服务器统计信息,请执行以下操作:
user@host> clear dhcpv6 server statistics
了解级联 DHCPv6 前缀委派
您可以使用 DHCPv6 客户端前缀委派自动将 IPv6 前缀委派到客户端设备 (CPE)。使用前缀委派时,委派设备会将 IPv6 前缀委派给请求设备。然后,请求设备使用这些前缀为订阅者 LAN 上的设备分配全局 IPv6 地址。请求设备还可以将子网地址分配给 LAN 上的子网。
通过级联前缀委派,IPv6 地址块将委派给在客户边缘设备的 WAN 接口上运行的 DHCPv6 客户端。客户端的身份关联 (IA) 用于前缀委派 (IA_PD) 的身份关联。客户边缘设备通过 DHCPv6 请求具有 IA 类型非临时地址 (IA_NA) 的 IPv6 地址。IA_PD 和 IA_NA 都在同一个 DHCPv6 交换中请求。

图 1中的拓扑显示了充当 CPE 的 SRX 系列防火墙。WAN 接口链接到提供商边缘 (PE) 设备,LAN 接口链接到客户网络。服务提供商将前缀(委派前缀)和 IPv6 地址(cpe-wan-ipv6 地址)委托给 DHCPv6 客户端。当请求设备通过 DHCPv6 客户端收到该 IPv6 地址时,设备必须在其 WAN 接口上安装 IPv6 地址。然后,DHCPv6 客户端将委派的前缀划分为子前缀,随后将它们分配给 CPE 设备的已连接 LAN 接口,从而使剩余空间的某些子集可用于子前缀委派。
CPE 为其 LAN 接口分配子前缀,并通过设备通告广播子前缀。在此方案中,CPE 充当子 PE,委派子前缀并将其分配给子 CPE。
子前缀委派的要求与 RFC 3769 中定义的前缀委派的要求相同。

可以有多个级别的子前缀委派,参见 图 2。顶级 CPE 从 PE 获取委派前缀,并将子前缀委派给二级子 CPE,然后委派到第三级子 CPE,最后委派给结束级别。终端级别子 CPE 通过 SLAAC、无状态 DHCPv6 或有状态 DHCPv6 将 IPv6 地址分配给终端主机。这称为级联前缀委派。
示例 - 通过以太网点对点协议 (PPPoE) 配置 DHCPv6 前缀委派 (PD)
此示例说明如何在 SRX 系列防火墙上配置 DHCPv6 PD over PPPoE。
要求
配置此功能之前,不需要除设备初始化之外的特殊配置。
概述
该示例使用SRX550M设备通过 PPPoE 配置 DHCPv6 PD。开始之前,请将 DHCPv6 服务器配置为允许主机入站流量并接收 DHCPv6 数据包。提供主机名以建立 PPPoE 会话。要启用 IPv6,需要重新启动机箱。
通过 PPPoE 配置 DHCPv6 PD 涉及以下配置:
配置 DHCPv6 服务器
DHCPv6 客户端 (PD)
DHCPv6 客户端(自动)
拓扑学
下图描述了基于 PPPoE 的 DHCPv6 PD 拓扑,它提供了一个使用 SRX 系列防火墙的配置套件。
图 3 显示了此示例中使用的拓扑。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,将命令复制并粘贴到层次结构级别的 CLI [edit]
中,然后从配置模式进入 commit
。
DHCPv6 服务器的快速配置:
DHCPv6 服务器配置
set interfaces ge-0/0/1 unit 0 family inet6 set system services dhcp-local-server dhcpv6 overrides interface-client-limit 100 set system services dhcp-local-server dhcpv6 group my-group overrides interface-client-limit 200 set system services dhcp-local-server dhcpv6 group my-group overrides delegated-pool v6-pd-pool set system services dhcp-local-server dhcpv6 group my-group interface pp0.0
PPPoE 配置
set system host-name SRX550M set interfaces ge-0/0/1 unit 0 encapsulation ppp-over-ether set interfaces pp0 unit 0 ppp-options chap access-profile prof-ge001 set interfaces pp0 unit 0 pppoe-options underlying-interface ge-0/0/1.0 set interfaces pp0 unit 0 pppoe-options server set interfaces pp0 unit 0 family inet6 address 3000::1/64
路由器通告配置
set protocols router-advertisement interface pp0.0 max-advertisement-interval 20 set protocols router-advertisement interface pp0.0 min-advertisement-interval 10 set protocols router-advertisement interface pp0.0 managed-configuration set protocols router-advertisement interface pp0.0 other-stateful-configuration set protocols router-advertisement interface pp0.0 prefix 3000::1/64
启用 IPv6
set security forwarding-options family inet6 mode flow-based
PPPoE 配置文件配置
set access profile prof-ge001 client test_user chap-secret test
PD 地址池配置
set access address-assignment pool v6-pd-pool family inet6 prefix 2001:1:1::/48 set access address-assignment pool v6-pd-pool family inet6 range vp-pd prefix-length 48 set access address-assignment pool v6-pd-pool family inet6 dhcp-attributes dns-server 3000::1
安全区域配置
set security zones security-zone trust interface pp0.0 host-inbound-traffic system-services dhcpv6
DHCPv6 客户端 (PD) 的快速配置:
DHCPv6 服务器配置
set interfaces ge-0/0/1 unit 0 family inet6 set system services dhcp-local-server dhcpv6 overrides interface-client-limit 10 set system services dhcp-local-server dhcpv6 overrides process-inform pool p1 set system services dhcp-local-server dhcpv6 group ipv6 interface ge-0/0/2.0
PPPoE 配置
set system host-name SRX550M set interfaces ge-0/0/1 unit 0 encapsulation ppp-over-ether set interfaces pp0 unit 0 ppp-options chap default-chap-secret test set interfaces pp0 unit 0 ppp-options chap local-name test_user set interfaces pp0 unit 0 ppp-options chap passive set interfaces pp0 unit 0 pppoe-options underlying-interface ge-0/0/1.0 set interfaces pp0 unit 0 pppoe-options client
DHCPv6 客户端配置
set interfaces pp0 unit 0 family inet6 dhcpv6-client client-type statefull set interfaces pp0 unit 0 family inet6 dhcpv6-client client-ia-type ia-pd set interfaces pp0 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/2.0 other-stateful-configuration set interfaces pp0 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/2.0 max-advertisement-interval 10 set interfaces pp0 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/2.0 min-advertisement-interval 5 set interfaces pp0 unit 0 family inet6 dhcpv6-client client-identifier duid-type duid-ll set interfaces pp0 unit 0 family inet6 dhcpv6-client req-option dns-server set interfaces pp0 unit 0 family inet6 dhcpv6-client update-server set protocols router-advertisement interface pp0.0
启用 IPv6
set security forwarding-options family inet6 mode flow-based
DHCPv6 服务器传播配置
set access address-assignment pool p1 family inet6 prefix 2001::/16 set access address-assignment pool p1 family inet6 dhcp-attributes propagate-settings pp0.0
安全区域配置
set security zones security-zone untrust interface pp0.0 host-inbound-traffic system-services dhcpv6 set security zones security-zone trust interface ge-0/0/2.0 host-inbound-traffic system-services dhcpv6
DHCPv6 客户端(自动)的快速配置:
DHCPv6 客户端配置
set interfaces ge-0/0/0 unit 0 family inet6 dhcpv6-client client-type autoconfig set interfaces ge-0/0/0 unit 0 family inet6 dhcpv6-client client-ia-type ia-na set interfaces ge-0/0/0 unit 0 family inet6 dhcpv6-client client-identifier duid-type duid-ll set interfaces ge-0/0/0 unit 0 family inet6 dhcpv6-client req-option dns-server
路由器通告配置
set protocols router-advertisement interface ge-0/0/0.0
启用 IPv6
set security forwarding-options family inet6 mode flow-based
安全区域配置
set security zones security-zone trust interface ge-0/0/0.0 host-inbound-traffic system-services dhcpv6
程序
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关如何执行此操作的说明,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要在设备上配置 DHCPv6 服务器SRX550M请执行以下操作:
设置接口。
[edit] user@host# set interfaces ge-0/0/1 unit 0 family inet6
配置 DHCP 本地服务器。
[edit ] user@host# set system services dhcp-local-server dhcpv6
为所有 DHCPv6 组设置默认限制。
[edit system services dhcp-local-server dhcpv6] user@host# set overrides interface-client-limit 100
为组设置自定义客户端限制。
[edit system services dhcp-local-server dhcpv6] user@host# set group my-group overrides interface-client-limit 200
指定委派池名称。
[edit system services dhcp-local-server dhcpv6] user@host# set group my-group overrides delegated-pool v6-pd-pool
创建一个名为 my-group 的组,其中包含 pp0 接口。
[edit system services dhcp-local-server dhcpv6] user@host# set group my-group interface pp0.0
配置 PPPoE:
设置接口以封装 PPPoE。
[edit] user@host# set interfaces ge-0/0/1 unit 0 encapsulation ppp-over-ether
设置 chap 访问配置文件值。
[edit system interface] user@host# set interface pp0 unit 0 ppp-options chap access-profile prof-ge001
设置底层接口名称。
[edit system interface] user@host# set interface pp0 unit 0 pppoe-options underlying-interface ge-0/0/1.0
设置 PPPoE 选项服务器。
[edit system interface] user@host# set interface pp0 unit 0 pppoe-options server
设置姓氏和地址。
[edit system interface] user@host# set interface pp0 unit 0 family inet6 address 3000::1/64
配置路由器通告:
设置最大播发间隔限制。
[edit system protocol] user@host# set protocols router-advertisement interface pp0.0 max-advertisement-interval 20
设置最小播发间隔限制。
[edit system protocol] user@host# set protocols router-advertisement interface pp0.0 min-advertisement-interval 10
将配置状态设置为托管配置。
[edit system protocol] user@host# set protocols router-advertisement interface pp0.0 managed-configuration
将配置状态设置为其他有状态配置。
[edit system protocol] user@host# set protocols router-advertisement interface pp0.0 other-stateful-configuration
设置前缀值。
[edit system protocol] user@host# set protocols router-advertisement interface pp0.0 prefix 3000::1/64
启用 IPv6:
设置系列名称和模式以启用 IPv6。
[edit] user@host# set security forwarding-options family inet6 mode flow-based
配置 PPPoE 配置文件:
设置访问配置文件名称、客户端名称和 chap 机密。
[edit] user@host# set access profile prof-ge001 client test_user chap-secret test
配置 PD 地址池:
设置地址分配池名称、系列名称和前缀。
[edit] user@host# set access address-assignment pool v6-pd-pool family inet6 prefix 2001:1:1::/48
设置范围和前缀长度。
[edit] user@host# set access address-assignment pool v6-pd-pool family inet6 range vp-pd prefix-length 48
使用 DNS 服务器值设置 DHCP 属性。
[edit] user@host# set access address-assignment pool v6-pd-pool family inet6 dhcp-attributes dns-server 3000::1
配置安全区域:
设置区域名称、接口和主机入站流量系统服务。
[edit] user@host# set security zones security-zone trust interface pp0.0 host-inbound-traffic system-services dhcpv6
程序
分步过程
要在设备上配置 DHCPv6 客户端 (PD),请执行以下操作SRX550M:
设置接口。
[edit] user@host# set interfaces ge-0/0/2 unit 0 family inet6
设置 DHCPv6 本地服务器以覆盖接口客户端限制。
[edit] user@host# set system services dhcp-local-server dhcpv6 overrides interface-client-limit 10
设置进程通知池名称。
[edit] user@host# set system services dhcp-local-server dhcpv6 overrides process-inform pool p1
设置组名和接口。
[edit] user@host# set system services dhcp-local-server dhcpv6 group ipv6 interface ge-0/0/2.0
配置 PPPoE:
将接口设置为通过以太网封装 ppp。
[edit system interface] user@host# set interface ge-0/0/1 unit 0 encapsulation ppp-over-ether
设置默认章节机密。
[edit system interface] user@host# set interfaces pp0 unit 0 ppp-options chap default-chap-secret test
设置章节本地名称。
[edit system interface] user@host# set interfaces pp0 unit 0 ppp-options chap local-name test_user
设置 PPP 选项 章节状态。
[edit system interface] user@host# set interfaces pp0 unit 0 ppp-options chap passive
设置底层接口。
[edit system interface] user@host# set interfaces pp0 unit 0 pppoe-options underlying-interface ge-0/0/1.0
设置 pppoe 选项。
[edit system interface] user@host# set interfaces pp0 unit 0 pppoe-options client
配置 DHCPv6 客户端:
设置系列名称和 dhcpv6 客户端类型。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client client-type statefull
设置 dhcpv6 客户端身份关联类型。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client client-ia-type ia-pd
设置更新路由器通告接口和其他状态配置。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/2.0 other-stateful-configuration
设置最大播发间隔值。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/2.0 max-advertisement-interval 10
设置最小播发间隔值。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/2.0 min-advertisement-interval 5
设置客户端标识符 duid 类型。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client client-identifier duid-type duid-11
为 DHCPv6 客户端设置请求的选项。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client req-option dns-server
更新服务器。
[edit] user@host# set interfaces pp0 unit 0 family inet6 dhcpv6-client update-server
设置协议和接口。
[edit] user@host# set protocols router-advertisement interface pp0.0
启用 IPv6
设置系列名称和模式以启用 IPv6。
[edit] user@host# set security forwarding-options family inet6 mode flow-based
配置 DHCPv6 服务器以将 DNS 服务器信息传播到终端设备:
设置地址分配池名称、系列名称和前缀。
[edit] user@host# set access address-assignment pool p1 family inet6 prefix 2001::/16
将用于将 TCP/IP 设置传播到池的接口名称设置为池。
[edit] user@host# set access address-assignment pool p1 family inet6 dhcp-attributes propagate-settings pp0.0
配置安全区域:
设置区域名称、不信任接口和系统服务。
[edit] user@host# set security zones security-zone trust interface pp0.0 host-inbound-traffic system-services dhcpv6
设置信任接口。
[edit] user@host# set security zones security-zone trust interface ge-0/0/2.0 host-inbound-traffic system-services dhcpv6
程序
分步过程
要在设备上配置 DHCPv6 客户端(自动),请执行以下操作SRX550M:
设置接口、单元值、系列名称和 DHCPv6 客户端类型。
[edit system interface] user@host# set interfaces fe-0/0/0 unit 0 family inet6 dhcpv6-client client-type autoconfig
设置 Dhcpv6 客户端标识关联类型。
[edit system interface] user@host# set interfaces fe-0/0/0 unit 0 family inet6 dhcpv6-client client-ia-type ia-na
设置客户端标识符类型。
[edit system interface] user@host# set interfaces fe-0/0/0 unit 0 family inet6 dhcpv6-client client-identifier duid-type duid-11
设置 DHCPV6 客户端请求选项。
[edit system interface] user@host# set interfaces fe-0/0/0 unit 0 family inet6 dhcpv6-client req-option dns-server
配置路由器通告:
设置协议和接口。
[edit] user@host# set protocols router-advertisement interface fe-0/0/0.0
启用 IPv6。
设置系列名称和模式。
[edit] user@host# set security forwarding-options family inet6 mode flow-based
配置安全区域:
设置区域名称、信任接口和系统服务。
[edit] user@host# set security zones security-zone trust interface pp0.0 host-inbound-traffic system-services dhcpv6
结果
DHCPv6 服务器的结果:
在配置模式下,输入 show system services dhcp-local-server
、 show interfaces
、 show access profile prof-ge001
show access address-assignment pool
show protocols
show security forwarding-options
和 show security zones
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明以进行更正。
[edit] user@host# show system services dhcp-local-server dhcpv6 { overrides { interface-client-limit 100; } group my-group { overrides { interface-client-limit 200; delegated-pool v6-pd-pool; } interface pp0.0set; interface pp0.0; } } ... [edit] user@host# show interfaces ge-0/0/1 { unit 0 { encapsulation ppp-over-ether; } } pt-1/0/0 { vdsl-options { vdsl-profile auto; } } pp0 { unit 0 { ppp-options { chap { default-chap-secret "$ABC123"; ## SECRET-DATA } } } } ge-0/0/1 { unit 0 { encapsulation ppp-over-ether; } } pt-1/0/0 { vdsl-options { vdsl-profile auto; } } pp0 { unit 0 { ppp-options { chap { default-chap-secret "$ABC123"; ## SECRET-DATA } } } } ... [edit] user@host# show protocols interface pp0.0 { max-advertisement-interval 20; min-advertisement-interval 10; managed-configuration; other-stateful-configuration; prefix 3000::1/64; } ... [edit] user@host# show security forwarding-options family { inet6 { mode flow-based; } } ... [edit] user@host# show access address-assignment pool v6-pd-pool { family inet6 { prefix 2001:1:1::/48; range vp-pd prefix-length 48; dhcp-attributes { dns-server { 3000::1; } } } } ... [edit] user@host# show security zones security-zone Host { host-inbound-traffic { system-services { all; } } interfaces { ge-0/0/0.0; } } security-zone trust { interfaces { pp0.0 { host-inbound-traffic { system-services { dhcpv6; } } } } }
DHCPv6 客户端 (PD) 的结果:
[edit] user@host# show system services dhcp-local-server dhcpv6 { overrides { interface-client-limit 10; process-inform { pool p1; } } group my-group { overrides { interface-client-limit 200; delegated-pool v6-pd-pool; } interface pp0.0; } group ipv6 { interface ge-0/0/2.0; } } ... [edit] user@host# show interfaces ge-0/0/1 { unit 0 { encapsulation ppp-over-ether; } } pt-1/0/0 { vdsl-options { vdsl-profile auto; } } pp0 { unit 0 { ppp-options { chap { default-chap-secret "$ABC123"; ## SECRET-DATA local-name test_user; passive; } } pppoe-options { underlying-interface ge-0/0/1.0; client; } } } ... [edit] user@host# show interfaces pp0 unit 0 { ppp-options { chap { default-chap-secret "$ABC123"; ## SECRET-DATA local-name test_user; passive; } } pppoe-options { underlying-interface ge-0/0/1.0; client; } family inet6 { dhcpv6-client { client-type statefull; client-ia-type ia-pd; update-router-advertisement { interface ge-0/0/2.0 { other-stateful-configuration; max-advertisement-interval 10; min-advertisement-interval 5; } } client-identifier duid-type duid-ll; req-option dns-server; } } } ... [edit] user@host# show security forwarding-options family { inet6 { mode flow-based; } } ... [edit] user@host# show access address-assignment pool v6-pd-pool { family inet6 { prefix 2001:1:1::/48; range vp-pd prefix-length 48; dhcp-attributes { dns-server { 3000::1; } } } } pool p1 { family inet6 { prefix 2001::/16; dhcp-attributes { propagate-settings pp0.0; } } } ... [edit] user@host# show access address-assignment security-zone Host { host-inbound-traffic { system-services { all; } } interfaces { ge-0/0/0.0; } } security-zone trust { interfaces { pp0.0 { host-inbound-traffic { system-services { dhcpv6; } } } ge-0/0/2.0 { host-inbound-traffic { system-services { dhcpv6; } } } } } security-zone untrust { interfaces { pp0.0 { host-inbound-traffic { system-services { dhcpv6; } } } } }
DHCPv6 客户端(自动)的结果:
[edit] user@host# show interfaces ge-0/0/0 unit 0 { family inet6 { dhcpv6-client { client-type autoconfig; client-ia-type ia-na; req-option dns-server; } } } ... [edit] user@host# show protocols router-advertisement { interface pp0.0 { max-advertisement-interval 20; min-advertisement-interval 10; managed-configuration; other-stateful-configuration; prefix 3000::1/64; } interface fe-0/0/0.0; } ... [edit] user@host# show security forwarding-options family { inet6 { mode flow-based; } } ... [edit] user@host# show security zones security-zone Host { host-inbound-traffic { system-services { all; } } interfaces { ge-0/0/0.0; } } security-zone trust { interfaces { pp0.0 { host-inbound-traffic { system-services { dhcpv6; } } } ge-0/0/2.0 { host-inbound-traffic { system-services { dhcpv6; } } } fe-0/0/0.0 { host-inbound-traffic { system-services { dhcpv6; } } } } } security-zone untrust { interfaces { pp0.0 { host-inbound-traffic { system-services { dhcpv6; } } } } }
验证
验证 DHCPv6 服务器配置
目的
验证是否已配置 DHCPv6 服务器。
行动
在操作模式下,输入
show dhcpv6 server binding
命令。以下输出显示了该
show dhcpv6 server binding
命令的选项。[edit] user@host>
show dhcpv6 server binding detail
Session Id: 75 Client IPv6 Prefix: 2001:1:1::/48 Client DUID: LL0x1-3c:94:d5:98:90:01 State: BOUND(DHCPV6_LOCAL_SERVER_STATE_BOUND) Lease Expires: 2016-03-26 10:12:37 JST Lease Expires in: 86213 seconds Lease Start: 2016-03-25 10:12:37 JST Last Packet Received: 2016-03-25 10:12:50 JST Incoming Client Interface: pp0.0 Server Ip Address: 0.0.0.0 Client Prefix Pool Name: v6-pd-pool Client Id Length: 10 Client Id: /0x00030001/0x3c94d598/0x9001在操作模式下,输入
show route table inet6.0
命令。以下输出显示了该
show route table inet6.0
命令的选项。[edit] user@host>
show route table inet6.0
inet6.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 2001:1:1::/48 *[Access/13] 00:03:45 <<<<<< Route for end device will be automatically generated > to fe80::3e94:d50f:fc98:8600 via pp0.0 3000::/64 *[Direct/0] 00:04:04 > via pp0.0 3000::1/128 *[Local/0] 19:53:18 Local via pp0.0 fe80::b2c6:9a0f:fc7d:6900/128 *[Local/0] 19:53:18 Local via pp0.0在操作模式下,输入
show interfaces pp0.0 terse
命令。以下输出显示了该
show interfaces pp0.0 terse
命令的选项。[edit] user@host>
show interfaces pp0.0 terse
Interface Admin Link Proto Local Remote pp0.0 up up inet6 3000::1/64 fe80::b2c6:9a0f:fc7d:6900/64
验证 DHCPv6 客户端 (PD) 配置
目的
验证是否已配置 DHCPv6 客户端 (PD)。
行动
在操作模式下,输入
show dhcpv6 client binding detail
命令。以下输出显示了该
show dhcpv6 client binding detail
命令的选项。[edit] user@host>
show dhcpv6 client binding detail
Client Interface: pp0.0 Hardware Address: 3c:94:d5:98:86:01 State: BOUND(DHCPV6_CLIENT_STATE_BOUND) <<<<< SRX is bound to prefix via pp0.0 ClientType: STATEFUL Lease Expires: 2016-03-26 10:12:50 JST Lease Expires in: 86232 seconds Lease Start: 2016-03-25 10:12:50 JST Bind Type: IA_PD Client DUID: LL0x29-3c:94:d5:98:86:01 Rapid Commit: Off Server Ip Address: fe80::b2c6:9a0f:fc7d:6900 Update Server Yes Client IP Prefix: 2001:1:1::/48 DHCP options: Name: server-identifier, Value: VENDOR0x00000583-0x41453530 Name: dns-recursive-server, Value: 3000::1在操作模式下,输入
show dhcpv6 server binding detail
命令。以下输出显示了该
show dhcpv6 server binding detail
命令的选项。[edit] user@host>
show dhcpv6 server binding detail
Session Id: 75 Client IPv6 Prefix: 2001:1:1::/48 Client DUID: LL0x1-3c:94:d5:98:90:01 State: BOUND(DHCPV6_LOCAL_SERVER_STATE_BOUND) Lease Expires: 2016-03-26 10:12:37 JST Lease Expires in: 86213 seconds Lease Start: 2016-03-25 10:12:37 JST Last Packet Received: 2016-03-25 10:12:50 JST Incoming Client Interface: pp0.0 Server Ip Address: 0.0.0.0 Client Prefix Pool Name: v6-pd-pool Client Id Length: 10 Client Id: /0x00030001/0x3c94d598/0x9001在操作模式下,输入
show route table inet6.0
命令。以下输出显示了该
show route table inet6.0
命令的选项。[edit] user@host>
show route table inet6.0
inet6.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both ::/0 *[Access-internal/12] 00:03:35 > to fe80::b2c6:9a0f:fc7d:6900 via pp0.0 2001:1:1:1::/64 *[Direct/0] 00:03:48 > via ge-0/0/2.0 2001:1:1:1::1/128 *[Local/0] 00:03:48 <<<<<< IPv6 address allocated by Prefix delegation Local via ge-0/0/2.0 3000::/64 *[Access-internal/12] 00:03:35 > to fe80::b2c6:9a0f:fc7d:6900 via pp0.0 fe80::/64 *[Direct/0] 00:03:48 > via ge-0/0/2.0 fe80::3e94:d50f:fc98:8600/128 *[Local/0] 19:05:19 Local via pp0.0 fe80::3e94:d5ff:fe98:8602/128 *[Local/0] 00:03:48 Local via ge-0/0/2.0在操作模式下,输入
show interfaces pp0.0 terse
命令。以下输出显示了该
show interfaces pp0.0 terse
命令的选项。[edit] user@host>
show interfaces pp0.0 terse
Interface Admin Link Proto Local Remote pp0.0 up up inet6 fe80::3e94:d50f:fc98:8600/64在操作模式下,输入
show interfaces ge-0/0/2.0 terse
命令。以下输出显示了该
show interfaces ge-0/0/2.0 terse
命令的选项。[edit] user@host>
show interfaces ge-0/0/2.0 terse
Interface Admin Link Proto Local Remote ge-0/0/2.0 up up inet6 2000:1:1:1::1/64 fe80::3e94:d5ff:fe98:8602/64在操作模式下,输入
show ipv6 router-advertisement
命令。以下输出显示了该
show ipv6 router-advertisement
命令的选项。[edit] user@host>
show ipv6 router-advertisement
Interface: pp0.0 Advertisements sent: 3, last sent 00:01:56 ago Solicits received: 0 Advertisements received: 10 Advertisement from fe80::b2c6:9a0f:fc7d:6900, heard 00:00:08 ago Managed: 1 [0] Other configuration: 1 [0] Reachable time: 0 ms Default lifetime: 60 sec [1800 sec] Retransmit timer: 0 ms Current hop limit: 64 Prefix: 3000::/64 Valid lifetime: 2592000 sec Preferred lifetime: 604800 sec On link: 1 Autonomous: 1 Interface: ge-0/0/2.0 Advertisements sent: 24, last sent 00:00:03 ago Solicits received: 0 Advertisements received: 0
验证 DHCPv6 客户端(自动)配置
目的
验证是否已配置 DHCPv6 客户端(自动)。
行动
在操作模式下,输入
show dhcpv6 client binding detail
命令。以下输出显示了该
show dhcpv6 client binding detail
命令的选项。[edit] user@host>
show dhcpv6 client binding detail
Client Interface: fe-0/0/0.0 Hardware Address: 00:26:88:38:b5:00 State: BOUND(DHCPV6_CLIENT_STATE_BOUND) ClientType: AUTO Lease Expires: 2016-03-26 10:15:35 JST Lease Expires in: 86395 seconds Lease Start: 2016-03-25 10:15:35 JST Bind Type: IA_NA Client DUID: LL0x3-00:26:88:38:b5:00 Rapid Commit: Off Server Ip Address: fe80::3e94:d5ff:fe98:8602 Client IP Address: 2001:1:1:1:226:88ff:fe38:b500/128 Client IP Prefix: 2001:1:1:1::/64 DHCP options: Name: server-identifier, Value: VENDOR0x00000583-0x414c3131在操作模式下,输入
show route table inet6.0
命令。以下输出显示了该
show route table inet6.0
命令的选项。[edit] user@host>
show route table inet6.0
inet6.0: 5 destinations, 6 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both ::/0 *[Access-internal/12] 00:02:36 > to fe80::3e94:d5ff:fe98:8602 via fe-0/0/0.0 2001:1:1:1::/64 *[Access-internal/12] 00:02:36 > to fe80::3e94:d5ff:fe98:8602 via fe-0/0/0.0 2001:1:1:1:226:88ff:fe38:b500/128 *[Direct/0] 00:02:36 > via fe-0/0/0.0 [Local/0] 00:02:36 Local via fe-0/0/0.0 fe80::/64 *[Direct/0] 1w3d 15:51:19 > via fe-0/0/0.0 fe80::226:88ff:fe38:b500/128 *[Local/0] 1w3d 15:51:19 Local via fe-0/0/0.0在操作模式下,输入
show ipv6 router-advertisement
命令。以下输出显示了该
show ipv6 router-advertisement
命令的选项。[edit] user@host>
show ipv6 router-advertisement
Interface: fe-0/0/0.0 Advertisements sent: 1, last sent 00:02:45 ago Solicits received: 0 Advertisements received: 8 Advertisement from fe80::3e94:d5ff:fe98:8602, heard 00:00:02 ago Managed: 0 Other configuration: 1 [0] Reachable time: 0 ms Default lifetime: 30 sec [1800 sec] Retransmit timer: 0 ms Current hop limit: 64 Prefix: 2001:1:1:1::/64 Valid lifetime: 86400 sec Preferred lifetime: 86400 sec On link: 1 Autonomous: 1
SLAAC(无状态地址自动配置)
SLAAC 是一种 IPv6 协议,它提供与 IPv4 中的 DHCP 类似的功能。使用 SLAAC,网络主机可以根据路由器通告中附近路由器提供的前缀自动配置全局唯一的 IPv6 地址。
SLAAC 使 IPv6 客户端能够结合使用本地可用信息和路由器通过邻居发现协议 (NDP) 通告的信息,生成自己的地址。
SLAAC 流程
生成链路本地地址
客户端通过为启用 IPv6 的接口生成链路本地地址来开始自动配置。这是通过将播发的链路本地前缀(前 64 位)与接口标识符(后 64 位)组合来实现的。地址按照以下格式生成:[fe80(10 位)+ 0(54 位)] + 接口 ID(64 位)。自动生成的链路本地地址无法删除。但是,也可以手动输入新的链路本地地址,这将覆盖自动生成的链路本地地址。
生成全局地址
客户端发送路由器请求消息,提示链路上的所有路由器发送路由器通告 (RA) 消息。启用支持 SLAAC 的路由器会发送包含子网前缀的 RA,以供相邻主机使用。客户端将接口标识符附加到子网前缀以形成全局地址,并再次运行 DAD 以确认其唯一性。
检查重复地址
在将链路本地地址分配给其接口之前,客户端会通过运行重复地址检测 (DAD) 来验证地址。DAD 发送发往新地址的邻居请求消息。如果有回复,则地址重复,进程停止。如果地址是唯一的,则会将其分配给接口
配置 SLAAC
要启用 SLAAC,请使用以下命令:
- 为物理接口和环路接口分配 IPv6 地址。
user@host# set interfaces ge-0/0/0 unit 0 family inet6 address 2001:db8:0:1::/64 eui-64 user@host# set interfaces lo0 unit 1 family inet6 address 2001:db8::1/128
- 将设备配置为通过 ge-0/0/0 发送 /64 前缀的路由器通告 (RA)。
user@host# set protocols router-advertisement interface ge-0/0/0 prefix 2001:db8:0:1::/64
主机使用路由器中的 64 位前缀并随机分配其余部分,或使用 EUI-64 完成 128 位地址。
更改历史记录表
功能支持由您使用的平台和版本决定。使用 功能资源管理器 确定您的平台是否支持某个功能。