使用 DHCPv6 IA_NA和 DHCPv6 前缀委派进行WAN和LAN寻址
将 DHCPv6 IA_NA与 DHCPv6 前缀委派一起使用概述
您可以使用 DHCPv6 IA_NA为 CPE WAN链路分配全局 IPv6 地址,并使用 DHCPv6 前缀委派提供前缀以供用户LAN使用。DHCPv6 IA_NA和 DHCPv6 前缀委派在单个 DHCPv6 会话中完成。如果 CPE 在同一条 DHCPv6 请求消息中同时发送 IA_NA 和 IA_PD 选项,则 BNG 将同时返回一个 IPv6/128 地址和一个 IPv6 前缀。
成功分配至少一个地址后,路由器将创建一个订阅者条目,并将该条目绑定到分配的地址。如果两个地址都已成功分配,路由器将创建一个订阅者条目,并将这两个地址绑定到该条目。
DHCPv6 IA_NA和 DHCPv6 前缀委派的租用时间和会话超时
将 DHCPv6 IA_NA与 DHCPv6 前缀委派一起使用时,请注意以下有关会话超时和租赁时间的事项:
来自 AAA 的会话超时具有最高的优先级,并覆盖本地池租用时间。
对于 DHCPv6 本地服务器,与地址池关联的最短租期优先于租期较长的池。例如,如果 CPE 从租期时间为 3600 的池中获取 IA_NA 地址,并从租期时间为 7200 的池中获取前缀,则 BNG 的回复消息中返回的租期时间为 3600。
如果 AAA 未返回会话超时,并且地址池没有配置租期时间,则使用默认设置 86,400(一天)。
当 CPE 针对 IA_NA 和 IA_PD 地址类型单独发送续订请求时的行为
在某些网络中,DHCPv6 客户端 CPE 设备会执行以下两项作:
在单个请求消息中启动 IA_NA 地址类型和 IA_PD 地址类型的协商。
为IA_NA和IA_PD发送单独的租约续订请求,并且会背对背收到续订请求。
从 Junos OS 17.2R3、17.4R2、18.1R3、18.2R2 和 18.3R1 版开始,在这种情况下,jdhcpd 进程会延长这两种地址类型的租约。
收到第一个续订请求的回复时,如果第二个地址类型的续订请求处于挂起,则客户端将保持续订状态,第一个 IA 的租约将延长,并且客户端条目将更新。
收到第二个续订请求的回复时,将延长第二个 IA 的租约,并再次更新客户端条目。
在早期版本中,这种情况的行为有所不同:
客户端过渡到绑定状态,而不是停留在续订状态。第一个 IA 的租约将延长,并更新客户端条目。
收到第二个续订请求的回复时,不会为第二个地址类型续订租约,并将回复转发给客户端。因此,当该租期到期时,该地址类型的绑定将被清除,访问路由将被删除,并且该地址或地址前缀的后续流量将被丢弃。
对于通过相同会话(基于 L2TP 的 PPP LNS、DHCP 或 IPoE)的双堆栈客户端,增强型订阅者管理不支持同时满足以下两个条件的配置:
CPE 为IA_NA和IA_PD分别发送 DHCPv6 请求消息。
请求消息指定类型 2 或类型 3 DUID(链路层地址)。
作为解决方法,您必须将 CPE 配置为在存在其他配置元素时同时为 IA_NA 和 IA_PD 发送一条请求消息。
也可以看看
DHCPv6 多地址环境中的 DHCPv6 选项
在 DHCPv6 环境中,DHCPv6 客户端可以使用一条 DHCPv6 请求消息请求多个地址(例如,IA_NA 地址和/或 IA_PD 地址)以及 DNS 服务器地址(DHCPv6 属性 23)。当客户端请求多个地址时,DHCPv6 使用以下准则来确定如何将选项返回给客户端。
DNS 服务器地址 — 每当客户端请求 IA_PD 地址(单独或使用IA_NA地址)并请求 DNS 服务器地址时,DHCPv6 仅当在 IA_PD 池中指定了 DNS 地址时才会返回一个 DNS 地址。如果IA_PD池中未包含 DNS 地址,则 DHCPv6 将忽略IA_NA池中配置的任何 DNS 地址。
如果客户端请求 IA_NA 地址(但不是 IA_PD 地址)和 DNS 服务器地址,则 DHCPv6 将返回 DNS 地址(如果在 IA_NA 池中配置了 DNS 地址)。
租期 — DHCPv6 返回IA_NA池、IA_PD池
authd和 中配置的租期时间的最短值。DHCPv6 使用此值来设置生存期以及续订和重新绑定计时器。
默认情况下,DHCPv6 本地服务器将 DNS 服务器地址作为全局 DHCPv6 选项返回。如果您希望 DHCPv6 在子选项级别返回 DNS 服务器地址,则可以覆盖当前默认行为。
也可以看看
获取 DHCPv6 前缀委托和 DHCPv6 地址的方法 IA_NA
您可以通过以下方式之一设置 BNG,以选择要委托给请求路由器的全局 IPv6 地址:
外部源,例如 AAA RADIUS 服务器或使用 DHCPv6 中继代理的 DHCP 服务器。
从 BNG 上配置的本地前缀或全局 IPv6 地址池进行动态分配
前缀委派和IA_NA的地址分配是独立的。例如,您可以将AAA RADIUS用于 DHCPv6 IA_NA,并使用本地池进行前缀委派。
DHCPv6 前缀委派和 DHCPv6 IA_NA的地址池
您需要两个单独的地址池用于前缀委派和IA_NA。用于IA_NA的池包含 /128 地址,用于前缀委派的池包含 /56 或 /48 地址。
您可以指定用于前缀委托的委托池的名称,这意味着您无需使用 AAA 来获取池名称。在此配置中,如果还指定了池匹配顺序,则指定的委托池优先。
您可以配置池属性,以便IA_NA池和前缀委托池可以为 DNS 地址指定不同的 SIP 服务器。BNG 返回给 CPE 的 DHCPv6 选项基于从中分配地址的池。返回的这些选项基于 DHCPv6 选项请求选项 (ORO),该选项可以全局配置,也可以在IA_NA和IA_PD请求中配置。
使用 AAA RADIUS 服务器获取 IPv6 地址和前缀
当 BNG 需要获取 CPE WAN 链路的全局 IPv6 地址和 DHCPv6 前缀时,它会使用以下 RADIUS 属性之一中的值:
Framed-IPv6-Prefix— 属性包含全局 IPv6 地址和前缀。前缀长度 128 与全局 IPv6 地址相关联。小于 128 的前缀长度与前缀相关联。
Framed-IPv6-Pool— 该属性包含在 BNG 上配置的地址分配池的名称,BNG 可以从中选择要发送到 CPE 的全局 IPv6 地址或 IPv6 前缀。
这两个属性均在 RADIUS 访问-接受消息中从 RADIUS 服务器发送到 BNG。
用于多 DHCPv6 地址分配的 Junos OS 预定义变量
要为 DHCPv6 IA_NA和 DHCPv6 前缀委派配置动态 DHCPv6 地址分配,请在 $junos-subscriber-ipv6-multi-address 动态配置文件中使用预定义变量。您可以使用此变量代替 $junos-subscriber-ipv6-address 支持单个 IPv6 地址或前缀的变量。该 $junos-subscriber-ipv6-multi-address 变量用作多路分离源地址,并通过扩展以包括主机地址和前缀地址。
在 $junos-subscriber-ipv6-multi-address 层次结构级别包含 [edit dynamic-profile profile-name interfaces interface-name unit logical-unit-number family inet6 demux-source] 该变量。
也可以看看
每个客户端接口多个 DHCPv6 IA_NA和IA_PD请求
DHCPv6 中继代理支持单个 DHCPv6 请求消息中的多个IA_NA和IA_PD请求。请求可以是IA_NA地址和IA_PD地址的任意组合,最多八个请求。作为多 IA 请求支持的一部分,每个地址租约都分配了自己的租约时间到期时间,独立于其他租约。使用独立的租约计时器可确保在一个租约被拆除时,其他活动租约得以保留。您可以使用和show dhcpv6 relay bindingshow dhcpv6 relay binding detail命令显示各个租用时间的状态。
DHCPv6 对多个 IA 请求的支持使您能够使用前缀委派来指定地址块,如 RFC 3633,DHCPv6 的 IPv6 前缀选项中所述。例如,您可能希望将多个地址块委托给客户端设备 (CPE) 路由器,以简化 IPv6 环境中的流分类和服务创收。
示例:配置使用 DHCPv6 IA_NA和 DHCPv6 前缀委托的双堆栈 via PPPoE
要求
此示例使用以下硬件和软件组件:
MX 系列 5G 通用路由平台
Junos OS 11.4 或更高版本
概述
此设计在用户访问网络中使用 DHCPv6 IA_NA和 DHCPv6 前缀委派,如下所示:
接入网络采用 PPPoE。
DHCPv6 IA_NA用于在WAN链路上分配全局 IPv6 地址。地址来自使用 AAA RADIUS 指定的本地池。
DHCPv6 前缀委派用于用户 LAN 寻址。它使用了使用 AAA RADIUS 指定的本地池中的委托前缀。
DHCPv4 用于用户 LAN 寻址。
DHCPv6 用户会话在底层 PPPoE 用户会话上分层。
拓扑结构
的 PPPoE 用户访问网络
表 1 介绍了此示例中使用的配置组件。
配置组件 |
组件名称 |
目的 |
|---|---|---|
动态配置文件 |
pppoe-subscriber-profile |
在用户登录时创建 PPPoE 逻辑接口的配置文件。 |
接口 |
ge-0/2/5 |
用于与 RADIUS 服务器通信的接口。 |
ge-0/3/0 |
底层以太网接口。 |
|
多路分离0 |
在底层以太网接口上运行的 VLAN 多路分离接口。 |
|
lo0 |
用于接入网络的环路接口。环路接口会自动用于未编号的接口。 |
|
地址分配池 |
池 v4-pool |
为用户 LAN 提供 IPv4 地址的池。 |
v6-ia-na-pool 池 |
向 CPE WAN 链路提供全局 IPv6 地址的池。 |
|
池 v6-pd-pool |
提供委托给 CPE 并用于在用户 LAN 上分配 IPv6 全局地址的前缀池。 |
配置
- CLI 快速配置
- 通过 PPPoE 为 DHCPv6 配置 DHCPv6 本地服务器
- 为 PPPoE 逻辑接口配置动态配置文件
- 配置环路接口
- 通过以太网底层接口配置 VLAN 多路分离接口
- 配置用于与 RADIUS 服务器通信的接口
- 指定 BNG IP 地址
- 配置 RADIUS 服务器访问
- 配置 RADIUS 服务器访问配置文件
- 配置本地地址分配池
CLI 快速配置
以下是此示例的完整配置:
dynamic-profiles {
pppoe-subscriber-profile {
routing-instances {
"$junos-routing-instance" {
interface "$junos-interface-name";
}
}
interfaces {
pp0 {
unit "$junos-interface-unit" {
ppp-options {
chap;
pap;
}
pppoe-options {
underlying-interface "$junos-underlying-interface";
server;
}
keepalives interval 30;
family inet {
unnumbered-address "$junos-loopback-interface";
}
family inet6 {
unnumbered-address "$junos-loopback-interface";
}
}
}
}
}
}
system {
services {
dhcp-local-server {
dhcpv6 {
group v6-ppp-subscriber {
interface pp0.0;
}
}
}
}
}
interfaces {
ge-0/2/5 {
gigether-options {
no-auto-negotiation;
}
unit 0 {
family inet {
address 203.0.113.99/32;
}
}
}
ge-0/3/0 {
hierarchical-scheduler maximum-hierarchy-levels 2;
flexible-vlan-tagging;
encapsulation flexible-ethernet-services;
unit 1;
}
demux0 {
unit 1 {
proxy-arp;
vlan-tags outer 1 inner 1;
demux-options {
underlying-interface ge-0/3/0;
}
family pppoe {
duplicate-protection;
dynamic-profile pppoe-subscriber-profile;
}
}
}
lo0 {
unit 0 {
family inet {
address 203.0.113.1/32 {
primary;
preferred;
}
}
family inet6 {
address 2001:db8:0::1/128 {
primary;
preferred;
}
}
}
}
}
routing-options {
router-id 203.0.113.0;
}
access {
radius-server {
203.0.113.99 {
secret "$ABC123$ABC123$ABC123"; ## SECRET-DATA
timeout 45;
retry 4;
source-address 203.0.113.1;
}
}
profile Access-Profile {
authentication-order radius;
radius {
authentication-server 203.0.113.99;
accounting-server 203.0.113.99;
}
accounting {
order [ radius none ];
update-interval 120;
statistics volume-time;
}
}
address-assignment {
pool v4-pool {
family inet {
network 203.0.113.161/32;
range v4-range-0 {
low 203.0.113.161;
high 203.0.113.255;
}
dhcp-attributes {
maximum-lease-time 99999;
}
}
}
pool v6-ia-na-pool {
family inet6 {
prefix 2001:db8:1000:0000::/64;
range v6-range-0 {
low 2001:db8:1000::1/128;
high 2001:db8:1000::ffff:ffff/128;
}
}
}
pool v6-pd-pool {
family inet6 {
prefix 2001:db8:2012::/48;
range v6-pd prefix-length 64;
}
}
}
address-protection;
}
通过 PPPoE 为 DHCPv6 配置 DHCPv6 本地服务器
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit system services dhcp-local-server dhcpv6 edit group v6-ppp-subscriber set interface pp0.0
分步程序
要在 PPPoE IPv6 家族 (inet6) 之上放置 DHCPv6 层,请将 PPPoE 接口添加到 DHCPv6 本地服务器配置,从而将 DHCPv6 与 PPPoE 接口相关联。由于此示例使用动态 PPPoE 接口,因此我们使用 pp0.0 (PPPoE) 逻辑接口作为通配符,以指示可以在 PPPoE 接口之上进行 DHCPv6 绑定。
要配置 DHCPv6 本地服务器:
访问 DHCPv6 本地服务器配置。
[edit] user@host# edit system services dhcp-local-server dhcpv6
为动态 PPPoE 接口创建组并分配名称。
组功能对一组接口进行分组,然后将通用 DHCP 配置应用于命名接口组。
[edit system services dhcp-local-server dhcpv6] user@host# edit group v6-ppp-subscriber
为动态 PPPoE 逻辑接口添加接口。
[edit system services dhcp-local-server dhcpv6 group v6-ppp-subscriber] user@host# set interface pp0.0
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit]
user@host# show
system {
services {
dhcp-local-server {
dhcpv6 {
group v6-ppp-subscriber {
interface pp0.0;
}
}
}
}
}
如果完成设备配置,请从配置模式进入。commit
为 PPPoE 逻辑接口配置动态配置文件
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit dynamic-profiles pppoe-subscriber-profile edit routing-instances $junos-routing-instance set interface $junos-interface-name exit edit interfaces pp0 unit $junos-interface-unit set family inet unnumbered-address "$junos-loopback-interface" set family inet6 unnumbered-address "$junos-loopback-interface" set pppoe-options underlying-interface "$junos-underlying-interface" set pppoe-options server set ppp-options pap set ppp-options chap set keepalives interval 30
分步程序
为 PPPoE 逻辑接口创建动态配置文件。此动态配置文件支持同一逻辑接口上的 IPv4 和 IPv6 会话。
要配置动态配置文件,请执行以下作:
创建动态配置文件并命名。
[edit] user@host# edit dynamic-profiles pppoe-subscriber-profile
将路由实例添加到配置文件。
[edit dynamic-profiles pppoe-subscriber-profile] user@host# edit routing-instances $junos-routing-instance user@host# set interface $junos-interface-name
配置用于为 IPv4 和 IPv6 用户创建逻辑 PPPoE 接口的 PPPoE 逻辑接口 (pp0)。
[edit dynamic-profiles pppoe-subscriber-profile] user@host# edit interfaces pp0
$junos-interface-unit指定为预定义变量以表示接口的pp0逻辑单元号。该变量将动态替换为用户登录时网络提供的实际单元号。[edit dynamic-profiles pppoe-subscriber-profile interfaces pp0] user@host# edit unit $junos-interface-unit
$junos-underlying-interface指定为预定义变量,以表示路由器在其上创建动态 PPPoE 逻辑接口的底层以太网接口的名称。当用户登录时,该变量将动态替换为网络提供的底层接口的实际名称。[edit dynamic-profiles pppoe-subscriber-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set pppoe-options underlying-interface $junos-underlying-interface
在动态创建 PPPoE 逻辑接口时,将路由器配置为充当 PPPoE 服务器。
[edit dynamic-profiles pppoe-subscriber-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set pppoe-options server
为 pp0 接口配置 IPv4 家族。指定未编号地址以动态创建环路接口。由于此示例使用路由实例,因此请分配预定义变量
$junos-loopback-interface。[edit dynamic-profiles pppoe-subscriber-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set family inet unnumbered-address $junos-loopback-interface
为 pp0 接口配置 IPv6 家族。指定未编号地址以动态创建环路接口。由于此示例使用不带路由器播发的路由实例,因此请分配预定义变量
$junos-loopback-interface。[edit dynamic-profiles pppoe-subscriber-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set family inet6 unnumbered-address $junos-loopback-interface
为 pp0 接口配置一个或多个 PPP 身份验证协议。
[edit dynamic-profiles pppoe-subscriber-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set ppp-options chap user@host# set ppp-options pap
启用激活并设置激活间隔。建议间隔为 30 秒。
[edit dynamic-profiles pppoe-subscriber-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set keepalives interval 30
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit dynamic-profiles pppoe-subscriber-profile]
user@host# show
routing-instances {
"$junos-routing-instance" {
interface "$junos-interface-name";
}
}
interfaces {
pp0 {
unit "$junos-interface-unit" {
ppp-options {
chap;
pap;
}
pppoe-options {
underlying-interface "$junos-underlying-interface";
server;
}
keepalives interval 30;
family inet {
unnumbered-address "$junos-loopback-interface";
}
family inet6 {
unnumbered-address "$junos-loopback-interface";
}
}
}
}
如果完成设备配置,请从配置模式进入。commit
配置环路接口
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit interfaces lo0 set unit 0 family inet address 203.0.113.1/32 primary set unit 0 family inet address 203.0.113.1/32 preferred set unit 0 family inet6 address 2001:db8:0::1/128 primary set unit 0 family inet6 address 2001:db8:0::1/128 preferred
分步程序
要配置环路接口,请执行以下作:
创建环路接口并指定单元号。
[edit] user@host# edit interfaces lo0 unit 0
配置 IPv4 接口。
[edit interfaces lo0 unit 0] user@host# set family inet address 203.0.113.1/32 primary preferred
配置 IPv6 接口。
[edit interfaces lo0 unit 0] user@host# set family inet6 address 2001:db8:0::1/128 primary preferred
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit interfaces lo0]
user@host# show
unit 0 {
family inet {
address 203.0.113.1/32 {
primary;
preferred;
}
}
family inet6 {
address 2001:db8:0::1/128 {
primary;
preferred;
}
}
}
如果完成设备配置,请从配置模式进入。commit
通过以太网底层接口配置 VLAN 多路分离接口
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit interfaces set ge-0/3/0 hierarchical-scheduler maximum-hierarchy-levels 2 set ge-0/3/0 flexible-vlan-tagging set ge-0/3/0 encapsulation flexible-ethernet-services exit edit interfaces demux0 unit 1 set vlan-tags outer 1 set vlan-tags inner 1 set demux-options underlying-interface ge-0/3/0 set family pppoe dynamic-profile pppoe-subscriber-profile set family pppoe duplicate-protection set proxy-arp
分步程序
要通过以太网底层接口配置 VLAN 多路分离接口,请执行以下作:
配置底层以太网接口。
[edit] user@host# edit interfaces ge-0/3/0 user@host# set flexible-vlan-tagging user@host# set encapsulation flexible-ethernet-services user@host# set hierarchical-scheduler maximum-hierarchy-levels 2
创建 VLAN 多路分离接口,并指定单元号。
[edit] user@host# edit interfaces demux0 unit 1
配置 VLAN 标记。
[edit interfaces demux0 unit 1] user@host# set vlan-tags outer 1 inner 1
指定底层以太网接口。
[edit interfaces demux0 unit 1] user@host# set demux-options underlying-interface ge-0/3/0
指定动态配置文件。
[edit interfaces demux0 unit 1] user@host# set family pppoe dynamic-profile pppoe-subscriber-profile
防止在同一 VLAN 接口上为同一 PPPoE 订阅者创建多个 PPPoE 会话。
[edit interfaces demux0 unit 1] user@host# set family pppoe duplicate-protection
(选答)指定您希望多路分离接口使用代理 ARP。
[edit interfaces demux0 unit 1] user@host# set proxy-arp
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit interfaces]
user@host# show
ge-0/3/0 {
hierarchical-scheduler maximum-hierarchy-levels 2;
flexible-vlan-tagging;
encapsulation flexible-ethernet-services;
}
demux0 {
unit 1 {
proxy-arp;
vlan-tags outer 1 inner 1;
demux-options {
underlying-interface ge-0/3/0;
}
family pppoe {
duplicate-protection;
dynamic-profile pppoe-subscriber-profile;
}
}
}
如果完成设备配置,请从配置模式进入。commit
配置用于与 RADIUS 服务器通信的接口
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit interfaces ge-0/2/5 set unit 0 family inet address 203.0.113.99 set gigether-options no-auto-negotiation
分步程序
要配置接口,请执行以下作:
创建接口,指定单元号并配置地址。
[edit] user@host# edit interfaces ge-0/2/5
配置 IPv4 接口并指定地址。
[edit interfaces ge-0/2/5] user@host# set unit 0 family inet address 203.0.113.99
指定不会自动协商千兆以太网选项。
[edit interfaces ge-0/2/5] user@host# set gigether-options no-auto-negotiation
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit interfaces ge-0/2/5]
user@host# show
gigether-options {
no-auto-negotiation;
}
unit 0 {
family inet {
address 203.0.113.99/32;
}
}
如果完成设备配置,请从配置模式进入。commit
指定 BNG IP 地址
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit routing-options set router-id 203.0.113.0
强烈建议您配置 BNG IP 地址,这样可以避免在环路接口上的接口地址发生变化时出现不可预测的行为。
分步程序
要配置 BNG 的 IP 地址,请执行以下作:
访问 routing-options 配置。
[edit] user@host# edit routing-options
指定 IP 地址或 BNG。
[edit routing-options] user@host# set router-id 203.0.113.0
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit routing-options] user@host# show router-id 203.0.113.0;
如果完成设备配置,请从配置模式进入。commit
配置 RADIUS 服务器访问
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit access radius-server 203.0.113.99 set secret "$ABC123$ABC123$ABC123" set timeout 45 set retry 4 set source-address 203.0.113.1
分步程序
要配置 RADIUS 服务器:
创建 RADIUS 服务器配置,并指定服务器地址。
[edit] user@host# edit access radius-server 203.0.113.99
为服务器配置所需的密钥(密码)。用引号括起来的机密可以包含空格。
[edit access radius-server 203.0.113.99] user@host# set secret "$ABC123$ABC123$ABC123"
配置 BNG 向 RADIUS 服务器发送 RADIUS 请求时使用的源地址。
[edit access radius-server 203.0.113.99] user@host# set source address 203.0.113.1
(选答)配置路由器尝试联系 RADIUS 计费服务器的次数。您可以将路由器配置为重试 1 到 16 次。默认设置为 3 次重试尝试。
[edit access radius-server 203.0.113.99] user@host# set retry 4
(选答)配置本地路由器或交换机等待从 RADIUS 服务器接收响应的时间长度。默认情况下,路由器或交换机等待 3 秒。可以将超时配置为 1 到 90 秒。
[edit access radius-server 203.0.113.99] user@host# set timeout 45
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit access]
user@host# show
radius-server {
203.0.113.99 {
secret "$ABC123$ABC123$ABC123"; ## SECRET-DATA
timeout 45;
retry 4;
source-address 203.0.113.1;
}
}
如果完成设备配置,请从配置模式进入。commit
配置 RADIUS 服务器访问配置文件
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit access profile Access-Profile set authentication-order radius set radius authentication-server 203.0.113.99 set radius accounting-server 203.0.113.99 set accounting order radius set accounting order none set accounting update-interval 120 set accounting statistics volume-time
分步程序
要配置 RADIUS 服务器访问配置文件,请执行以下作:
创建 RADIUS 服务器访问配置文件。
[edit] user@host# edit access profile Access-Profile
指定身份验证方法的使用顺序。
[edit access profile Access-Profile] user@host# set authentication-order radius
指定用于身份验证的 RADIUS 服务器的地址和用于记帐的服务器的地址。
[edit access profile Access-Profile] user@host# set radius authentication-server 203.0.113.99 user@host# set radius accounting-server 203.0.113.99
为访问配置文件配置 RADIUS 记帐值。
[edit access profile Access-Profile] user@host# set accounting order [ radius none ] user@host# set accounting update-interval 120 user@host# set accounting statistics volume-time
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit access]
user@host# show
profile Access-Profile {
authentication-order radius;
radius {
authentication-server 203.0.113.99;
accounting-server 203.0.113.99;
}
accounting {
order [ radius none ];
update-interval 120;
statistics volume-time;
}
}
如果完成设备配置,请从配置模式进入。commit
配置本地地址分配池
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 [edit] CLI 中。
edit access address-assignment set pool v4-pool family inet network 203.0.113.161/32 set pool v4-pool family inet range v4-range-0 low 203.0.113.161 set pool v4-pool family inet range v4-range-0 high 203.0.113.255 set pool v4-pool family inet dhcp-attributes maximum-lease-time 99999 set pool v6-ia-na-pool family inet6 prefix 2001:db8:1000:0000::/64 set pool v6-ia-na-pool family inet6 range v6-range-0 low 2001:db8:1000::1/128 set pool v6-ia-na-pool family inet6 range v6-range-0 high 2001:db8:1000::ffff:ffff/128 set pool v6-pd-pool family inet6 prefix 2001:db8:2012::/48 set pool v6-pd-pool family inet6 range v6-pd prefix-length 64
分步程序
为 DHCPv4、DHCPv6 IA_NA和 DHCPv6 前缀委派配置三个地址分配池。
要配置地址分配池,请执行以下作:
为 DHCPv4 配置地址分配池。
[edit] user@host# edit access address-assignment pool v4-pool user@host# edit family inet user@host# set network 203.0.113.161 user@host# set range v4-range-0 low 203.0.113.161 user@host# set range v4-range-0 high 203.0.113.255 user@host# set dhcp-attributes maximum-lease-time 99999
为 DHCPv6 IA_NA配置地址分配池。
[edit] user@host# edit access address-assignment pool v6-ia-na-pool user@host# edit family inet6 user@host# set prefix 2001:db8:1000:0000::/64 user@host# set range v6-range-0 low 2001:db8:1000::1/128 user@host# set range v6-range-0 high 2001:db8:1000::ffff:ffff/128
为 DHCPv6 前缀委派配置地址分配池。
[edit] user@host# edit access address-assignment pool v6-pd-pool user@host# edit family inet6 user@host# set prefix 2001:db8:2012::/48 user@host# set range v6-pd prefix-length 64
(选答)启用重复前缀保护。
[edit access] user@host# set address-protection
结果
在配置模式下,输入 show 命令以确认您的配置。
[edit access]
user@host# show
address-assignment {
pool v4-pool {
family inet {
network 203.0.113.161/32;
range v4-range-0 {
low 203.0.113.161;
high 203.0.113.255;
}
dhcp-attributes {
maximum-lease-time 99999;
}
}
}
pool v6-ia-na-pool {
family inet6 {
prefix prefix 2001:db8:1000:0000::/64 ;
range v6-range-0 {
low 2001:db8:1000::1/128;
high 2001:db8:1000::ffff:ffff/128;
}
}
}
pool v6-pd-pool {
family inet6 {
prefix 2001:db8:2012::/48;
range v6-pd prefix-length 64;
}
}
}
address-protection;
}
如果完成设备配置,请从配置模式进入。commit
验证
确认配置工作正常。
- 验证活动订阅者会话
- 验证正确路由实例中的 IPv4 和 IPv6 地址
- 验证动态订阅者会话
- 验证用于 DHCPv6 前缀委派的 DHCPv6 地址池
- 验证 DHCPv6 地址绑定
- 验证与远程对等方协商的 PPP 选项
验证活动订阅者会话
目的
验证活动订阅者会话。
行动
在作模式下,输入命令 show subscribers summary 。
user@host>show subscribers summary Subscribers by State Active: 2 Total: 2 Subscribers by Client Type DHCP: 1 PPPoE: 1 Total: 2
意义
下面的 Subscribers by State 字段显示活动订阅者的数量。
下的 Subscribers by Client Type 字段显示活动 DHCP 和 PPPoE 用户会话数。
验证正确路由实例中的 IPv4 和 IPv6 地址
目的
验证订阅者是否同时具有 IPv4 和 IPv6 地址,并处于正确的路由实例中。
行动
在作模式下,输入命令 show subscribers 。
user@host>show subscribers Interface IP Address/VLAN ID User Name LS:RI pp0.1073741825 203.0.113.162 SBRSTATICUSER default:default pp0.1073741825 2001:db8:1000::1 default:default
意义
该 Interface 字段显示两个用户会话在同一接口上运行。该 IP Address 字段显示 DHCPv6 IA_NA为一个会话分配了一个 IPv4 地址,第二个会话分配了一个 IPv6 地址。
该 LS:RI 字段显示订阅者已放置在正确的路由实例中,并且可以发送和接收流量。
验证动态订阅者会话
目的
验证动态 PPPoE 和 DHCPv6 用户会话。在此示例配置中,DHCPv6 用户会话应在底层 PPPoE 用户会话上分层。
行动
在作模式下,输入命令 show subscribers detail 。
user@host>show subscribers detail Type: PPPoE User Name: SBRSTATICUSER IP Address: 203.0.113.162 IP Netmask: 255.0.0.0 Logical System: default Routing Instance: default Interface: pp0.1073741825 Interface type: Dynamic Dynamic Profile Name: pppoe-subscriber-profile MAC Address: 00:00:5E:00:53:01 State: Active Radius Accounting ID: 2 Session ID: 2 Login Time: 2011-12-08 09:11:41 PST Type: DHCP IPv6 Address: 2001:db8:1000::1 Logical System: default Routing Instance: default Interface: pp0.1073741825 Interface type: Static MAC Address: 00:00:5E:00:53:31 State: Active Radius Accounting ID: 3 Session ID: 3 Underlying Session ID: 2 Login Time: 2011-12-08 09:12:11 PST DHCP Options: len 42 00 08 00 02 0b b8 00 01 00 0a 00 03 00 01 00 01 02 00 00 01 00 06 00 02 00 03 00 03 00 0c 00 00 00 00 00 00 00 00 00 00 00 00
意义
当用户登录并启动 IPv4 和 IPv6 会话时,输出将显示活动的底层 PPPoE 会话和活动的 DHCPv6 会话。
Session ID PPPoE 会话的字段为 2。DHCP 会话的 为 Underlying Session ID 2,表示 PPPoE 会话是底层会话。
验证用于 DHCPv6 前缀委派的 DHCPv6 地址池
目的
验证用于 DHCPv6 前缀委派的委托地址池以及委托给 CPE 的 IPv6 前缀的长度。
行动
在作模式下,输入命令 show subscribers extensive 。
user@host>show subscribers extensive Type: PPPoE User Name: SBRSTATICUSER IP Address: 203.0.113.162 IP Netmask: 255.0.0.0 Logical System: default Routing Instance: default Interface: pp0.1073741825 Interface type: Dynamic Dynamic Profile Name: pppoe-subscriber-profile MAC Address: 00:00:5E:00:53:31 State: Active Radius Accounting ID: 2 Session ID: 2 Login Time: 2011-12-08 09:11:41 PST IPv6 Delegated Address Pool: v6-na-pool Type: DHCP IPv6 Address: 2001:db8:1000::1 Logical System: default Routing Instance: default Interface: pp0.1073741825 Interface type: Static MAC Address: 00:00:5E:00:53:31 State: Active Radius Accounting ID: 3 Session ID: 3 Underlying Session ID: 2 Login Time: 2011-12-08 09:12:11 PST DHCP Options: len 42 00 08 00 02 0b b8 00 01 00 0a 00 03 00 01 00 01 02 00 00 01 00 06 00 02 00 03 00 03 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 IPv6 Delegated Address Pool: v6-na-pool IPv6 Delegated Network Prefix Length: 64
意义
该 IPv6 Delegated Address Pool 字段显示 DHCPv6 用于为此订阅者会话分配 IPv6 地址的池的名称。
验证 DHCPv6 地址绑定
目的
在 DHCPv6 本地服务器的客户端表中显示地址绑定。
行动
在作模式下,输入命令 show dhcpv6 server binding detail 。
user@host>show dhcpv6 server binding detail
Session Id: 580547
Client IPv6 Address: 2001:db8:1000::4/128
Client DUID: LL0x1-00:01:02:00:00:01
State: BOUND(DHCPV6_LOCAL_SERVER_STATE_BOUN
D)
Lease Expires: 2012-01-05 07:06:04 PST
Lease Expires in: 82943 seconds
Lease Start: 2012-01-04 07:06:04 PST
Last Packet Received: 2012-01-04 07:06:04 PST
Incoming Client Interface: pp0.1073926645
Server Ip Address: 0.0.0.0
Client Pool Name: v6-na-pool-0
Client Id Length: 10
Client Id: /0x00030001/0x00010200/0x0001
意义
该 Client IPv6 Address 字段显示使用 DHCPv6 IA_NA分配给 CPE WAN链路的 /128 地址。
该 Client Pool Name 字段显示用于分配 Client IPv6 Address.
验证与远程对等方协商的 PPP 选项
目的
验证与远程对等方协商的 PPP 选项。
行动
在作模式下,输入命令 show ppp interface interface extensive 。
user@host>show ppp interface pp0.1073741825 extensive
Session pp0.1073926645, Type: PPP, Phase: Network
LCP
State: Opened
Last started: 2012-01-04 07:05:33 PST
Last completed: 2012-01-04 07:05:33 PST
Negotiated options:
Authentication protocol: pap, Magic number: 191301485, Local MRU: 1492,
Peer MRU: 65531
Authentication: PAP
State: Grant
Last started: 2012-01-04 07:05:33 PST
Last completed: 2012-01-04 07:05:33 PST
IPCP
State: Opened
Last started: 2012-01-04 07:05:34 PST
Last completed: 2012-01-04 07:05:34 PST
Negotiated options:
Local address: 203.0.113.1, Remote address: 203.0.113.162
IPV6CP
State: Opened
Last started: 2012-01-04 07:05:34 PST
Last completed: 2012-01-04 07:05:34 PST
Negotiated options:
Local interface identifier: 2a0:a50f:fc71:e049,
Remote interface identifier: 201:2ff:fe00:1
意义
输出显示与远程对等方协商的 PPP 选项。
在 IPCP 下,该 Negotiated options 字段显示由 IPCP 协商的 IPv4 本地和远程地址。
在 IPV6CP 下,此 Negotiated options 字段显示由 IPv6CP 协商的 IPv6 本地和远程接口标识符。
变更历史表
是否支持某项功能取决于您使用的平台和版本。使用 功能资源管理器 确定您的平台是否支持某个功能。