示例:通过聚合以太网在动态底层 VLAN 多路分离接口上配置动态 PPPoE 用户接口
此示例说明如何通过聚合以太网捆绑包配置动态 PPPoE 用户接口,以提供用户链路冗余。
要求
通过聚合以太网的 VLAN 多路分离接口的 PPPoE 需要以下硬件和软件:
MX 系列 5G 通用路由平台
MPC
Junos OS 11.2 或更高版本
在配置此功能之前,不需要除设备初始化之外的特殊配置。
概述
聚合以太网捆绑包可在通过以太网链路连接的路由器与网络设备之间实现链路冗余。此示例介绍如何使用中间动态 VLAN 多路分离接口通过聚合以太网为动态 PPPoE 用户配置链路冗余。示例任务包括配置双成员聚合以太网捆绑包、配置用于建立作为 PPPoE 用户接口基础的动态 VLAN 多路分离接口的动态配置文件,以及配置用于建立动态 PPPoE 用户接口的动态配置文件。
在此示例中,将两个不同的动态配置文件配置为实例化 VLAN (vlan-profile) 或 S-VLAN (svlan-profile) 多路分离接口。这些配置文件定义了 PPPoE 系列选项,并包括用于创建 PPPoE 用户接口的动态 PPPoE 配置文件 (pppoe-profile)。每个配置文件中使用 Junos OS 预定义变量来表示动态创建的接口和 VLAN 标识符。这些动态配置文件包括以下预定义变量:
$junos-interface-unit— 表示动态 VLAN 多路分离接口的逻辑单元号。此预定义变量将动态替换为订阅者登录时路由器提供的单元号。$junos-interface-ifd-name— 表示在其上创建 PPPoE 用户接口的底层逻辑接口。当用户登录时,此预定义变量将动态替换为路由器提供的底层接口的名称。$junos-vlan-id— 表示 VLAN 标识符。当用户登录时,此预定义变量将动态替换为 VLAN ID。VLAN ID 在聚合以太网配置中指定的 VLAN 范围内分配。对于 S-VLAN 多路分离$junos-vlan-id,表示内部 VLAN 标识符。$junos-stacked-vlan-id— 表示堆叠 VLAN 的外部 VLAN 标识符。当用户登录时,此预定义变量将动态替换为 VLAN ID。VLAN ID 在聚合以太网配置中指定的 VLAN 范围内分配。此变量不用于 VLAN 多路分离配置。
动态 PPPoE 配置文件 (pppoe-profile) 可创建 PPPoE 用户接口。它还可将路由器配置为 PPPoE 服务器,并使本地地址能够从指定地址派生,而无需向接口分配显式 IP 地址。 pppoe-profile 动态配置文件被分配给动态、中间 VLAN 和 S-VLAN 多路分离接口。此动态配置文件包括以下预定义变量:
$junos-interface-unit— 表示动态 PPPoE 逻辑接口的逻辑单元号。此预定义变量将动态替换为订阅者登录时路由器提供的单元号。$junos-underlying-interface— 表示底层以太网接口的名称。此预定义变量将动态替换为订阅者登录时路由器提供的接口名称。
此示例未显示所有可能的配置选项。
配置
过程
CLI 快速配置
要通过聚合以太网上的动态 VLAN 多路分离接口为动态 PPPoE 用户快速配置链路冗余,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,然后将命令复制并粘贴到 CLI 中。
[edit] set chassis aggregated-devices ethernet device-count 1 set interfaces ge-5/0/3 gigether-options 802.3ad ae0 set interfaces ge-5/0/3 gigether-options 802.3ad primary set interfaces ge-5/1/2 gigether-options 802.3ad ae0 set interfaces ge-5/1/2 gigether-options 802.3ad backup edit interfaces ae0 set flexible-vlan-tagging set aggregated-ether-options link-protection edit auto-configure set vlan-ranges dynamic-profile vlan-profile accept pppoe set vlan-ranges dynamic-profile vlan-profile ranges 1-4094 set stacked-vlan-ranges dynamic-profile svlan-profile accept pppoe set stacked-vlan-ranges dynamic-profile svlan-profile ranges 1-4094,1-4094 top edit dynamic-profiles pppoe-profile edit interfaces pp0 unit $junos-interface-unit set pppoe-options underlying-interface $junos-underlying-interface set pppoe-options server set family inet unnumbered-address lo0.0 top edit dynamic-profiles vlan-profile interfaces demux0 edit unit $junos-interface-unit set vlan-id $junos-vlan-id set demux-options underlying-interface $junos-interface-ifd-name set family pppoe access-concentrator pppoe-server-1 set family pppoe duplicate-protection set family pppoe dynamic-profile pppoe-profile top edit dynamic-profiles svlan-profile interfaces demux0 edit unit $junos-interface-unit set vlan-tags outer $junos-stacked-vlan-id set vlan-tags inner $junos-vlan-id set demux-options underlying-interface $junos-interface-ifd-name set family pppoe access-concentrator pppoe-server-1 set family pppoe duplicate-protection set family pppoe dynamic-profile pppoe-profile top
分步程序
下面的示例要求您在各个配置层级中进行导航。有关作说明,请参阅在 配置模式下使用 CLI 编辑器。
要通过聚合以太网上的动态 VLAN 多路分离接口为动态 PPPoE 用户配置链路冗余:
定义路由器上的聚合以太网设备数量。
[edit chassis] user@host# set aggregated-devices ethernet device-count 1
配置一个双链路聚合以太网逻辑接口,用作动态 VLAN 多路分离用户接口的底层接口。在此示例中,LAG 捆绑包配置为一对一主动/备份链路冗余。为了支持 MPC 级别的链路冗余,LAG 捆绑包连接到来自两个不同 MPC 的端口。
[edit interfaces] user@host# set ge-5/0/3 gigether-options 802.3ad ae0 user@host# set ge-5/0/3 gigether-options 802.3ad primary user@host# set ge-5/1/2 gigether-options 802.3ad ae0 user@host# set ge-5/1/2 gigether-options 802.3ad backup
在聚合以太网逻辑接口上启用链路保护,并配置对单和双(堆叠)VLAN 标记的支持。
[edit interfaces] user@host# set ae0 aggregated-ether-options link-protection user@host# set ae0 flexible-vlan-tagging
配置用于自动配置 VLAN 和 S-VLAN 的参数,包括 VLAN 范围和动态配置文件。
[edit interfaces] user@host# set ae0 auto-configure vlan-ranges dynamic-profile vlan-profile accept pppoe user@host# set ae0 auto-configure vlan-ranges dynamic-profile vlan-profile ranges 1-4094 user@host# set ae0 auto-configure stacked-vlan-ranges dynamic-profile svlan-profile accept pppoe user@host# set ae0 auto-configure stacked-vlan-ranges dynamic-profile svlan-profile ranges 1-4094,1-4094
配置用于创建 PPPoE 用户接口的动态配置文件。
[edit dynamic-profiles pppoe-profile] user@host# edit interfaces pp0 unit $junos-interface-unit [edit dynamic-profiles pppoe-profile interfaces pp0 unit "$junos-interface-unit"] user@host# set pppoe-options underlying-interface $junos-underlying-interface user@host# set pppoe-options server user@host# set family inet unnumbered-address lo0.0
配置用于创建 VLAN 多路分离底层接口(包括 PPPoE 家族属性)的动态配置文件。
[edit dynamic-profiles vlan-profile] user@host# edit interfaces demux0 unit $junos-interface-unit [edit dynamic-profiles vlan-profile interfaces demux0 unit "$junos-interface-unit"] user@host# set vlan-id $junos-vlan-id user@host# set demux-options underlying-interface $junos-interface-ifd-name user@host# set family pppoe access-concentrator pppoe-server-1 user@host# set family pppoe duplicate-protection user@host# set family pppoe dynamic-profile pppoe-profile
配置用于创建 S-VLAN 多路分离底层接口(包括 PPPoE 家族属性)的动态配置文件。
[edit dynamic-profiles svlan-profile] user@host# edit interfaces demux0 unit $junos-interface-unit [edit dynamic-profiles svlan-profile interfaces demux0 unit "$junos-interface-unit"] user@host# set vlan-tags outer $junos-stacked-vlan-id user@host# set vlan-tags inner $junos-vlan-id user@host# set demux-options underlying-interface $junos-interface-ifd-name user@host# set family pppoe access-concentrator pppoe-server-1 user@host# set family pppoe duplicate-protection user@host# set family pppoe dynamic-profile pppoe-profile
结果
在配置模式下,输入 show chassis 命令以确认聚合设备配置。输入命令以 show interfaces 确认接口配置。输入命令以 show dynamic-profiles 确认动态配置文件配置。如果输出未显示预期的配置,请重复此示例中的配置说明进行更正。
[edit]
user@host# show chassis
aggregated-devices {
ethernet {
device-count 1;
}
}
[edit]
user@host# show interfaces
ge-5/0/3 {
gigether-options {
802.3ad {
ae0;
primary;
}
}
}
ge-5/1/2 {
gigether-options {
802.3ad {
ae0;
backup;
}
}
}
ae0 {
flexible-vlan-tagging;
aggregated-ether-options {
link-protection;
}
auto-configure {
vlan-ranges {
dynamic-profile {
vlan-profile {
accept pppoe;
vlan-ranges 1–4094};
}
}
}
stacked-vlan-ranges {
dynamic-profile {
svlan-profile {
accept pppoe;
vlan-ranges 1–4094,1–4094;
}
}
}
}
}
[edit]
user@host# show dynamic-profiles
pppoe-profile {
interfaces {
pp0 {
unit $junos-interface-unit {
pppoe-options {
underlying-interface $junos-underlying-interface;
server;
}
family inet {
unnumbered-address lo0.0;
}
}
}
}
}
vlan-profile {
interfaces {
demux0 {
unit "$junos-interface-unit" {
vlan-id "$junos-vlan-id";
demux-options {
underlying-interface "$junos-interface-ifd-name";
}
family pppoe {
access-concentrator pppoe-server-1;
duplicate-protection;
dynamic-profile pppoe-profile;
}
}
}
}
}
svlan-profile {
interfaces {
demux0 {
unit "$junos-interface-unit" {
vlan-tags outer "$junos-stacked-vlan-id" inner "$junos-vlan-id";
demux-options {
underlying-interface "$junos-interface-ifd-name";
}
family pppoe {
access-concentrator pppoe-server-1;
duplicate-protection;
dynamic-profile pppoe-profile;
}
}
}
}
}
如果完成设备配置,请从配置模式进入。commit
验证
要确认配置工作正常,请执行以下任务:
验证聚合以太网接口配置
目的
验证接口值是否与您的配置匹配,链路是否已开启,以及流量是否正常流动。
行动
在作模式下,输入命令 show interfaces redundancy 。
user@host> show interfaces redundancy Interface State Last change Primary Secondary Current status ae0 On primary ge-5/0/3 ge-5/1/2 both up
在作模式下,输入命令 show interfaces ae0 。
user@host> show interfaces ae0
Physical interface: ae0, Enabled, Physical link is Up
Interface index: 128, SNMP ifIndex: 606
Link-level type: Ethernet, MTU: 1522, Speed: 1Gbps, BPDU Error: None,
MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled,
Flow control: Disabled, Minimum links needed: 1, Minimum bandwidth needed: 0
Device flags : Present Running
Interface flags: SNMP-Traps Internal: 0x4000
Current address: 00:00:5e:00:53:d0, Hardware address: 00:00:5e:00:53:d0
Last flapped : 2011-03-11 13:24:18 PST (2d 03:34 ago)
Input rate : 1984 bps (2 pps)
Output rate : 0 bps (0 pps)
Logical interface ae0.32767 (Index 69) (SNMP ifIndex 709)
Flags: SNMP-Traps 0x4004000 VLAN-Tag [ 0x0000.0 ] Encapsulation: ENET2
Statistics Packets pps Bytes bps
Bundle:
Input : 371259 2 46036116 1984
Output: 0 0 0 0
Protocol multiservice, MTU: Unlimited
Flags: Is-Primary
意义
输出显示 show interfaces redundancy 冗余链路配置,并且两个链路接口均已开启。 show interfaces ae0 输出显示聚合以太网接口已开启,并且正在逻辑接口上接收流量。