示例:在聚合以太网的动态底层 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
输出显示聚合以太网接口已启动,且正在逻辑接口上接收该流量。