示例:通过同一 VLAN 多路分离接口并发配置动态 DHCP IP 多路分离器和 PPPoE 多路分离接口
此示例说明如何通过同一动态 VLAN 多路分离接口同时配置动态 DHCP IP 多路分离器和 PPPoE 多路分离接口。该示例提供了 IPv4 配置。但是,您也可以使用 IPv6 寻址在同一 VLAN 接口上配置并发以太网 IP/DHCP 和 PPPoE 接口。
要求
开始之前,请务必配置 DHCP 中继或 DHCP 本地服务器。有关配置这些组件中的任何一个的信息,请参阅 扩展 DHCP 中继代理概述 或 了解传统 DHCP 与扩展 DHCP 之间的差异。
概述
引入该 family pppoe 语句后,PPPoE 不再被视为专用封装配置,您可以使用多个协议接口堆栈配置 VLAN 接口。例如,您可以通过单个 VLAN 接口同时配置 IP over Ethernet/DHCP 和 PPPoE 接口。
配置
- 准备用户访问接口
- 准备环路接口
- 配置动态配置文件以创建动态单标记 VLAN
- 配置动态配置文件以创建动态双标记 VLAN
- 配置动态配置文件以创建动态 IP 多路分离接口
- 配置动态配置文件以创建动态 PPPoE 接口
准备用户访问接口
CLI 快速配置
要快速配置订阅者访问路由器的聚合以太网接口,请执行以下作:
[edit] set chassis aggregated-devices ethernet device-count 1 set interfaces ge-5/0/9 gigether-options 802.3ad ae0 set interfaces ge-5/1/9 gigether-options 802.3ad ae0 set interfaces ae0 flexible-vlan-tagging set interfaces ae0 auto-configure vlan-ranges dynamic-profile Auto-VLAN-Demux accept any set interfaces ae0 auto-configure vlan-ranges dynamic-profile Auto-VLAN-Demux accept any line-identity includes circuit-id set interfaces ae0 auto-configure vlan-ranges dynamic-profile Auto-VLAN-Demux accept any line-identity includes remote-id set interfaces ae0 auto-configure vlan-ranges dynamic-profile Auto-VLAN-Demux accept any line-identity includes accept-no-ids mac-address set interfaces ae0 auto-configure vlan-ranges dynamic-profile Auto-VLAN-Demux ranges ranges 1000-1500 set interfaces ae0 auto-configure stacked-vlan-ranges dynamic-profile Auto-Stacked-VLAN-Demux accept any set interfaces ae0 auto-configure stacked-vlan-ranges dynamic-profile Auto-Stacked-VLAN-Demux ranges 1501-2000,any set interfaces ae0 aggregated-ether-options lacp active set interfaces ae0 aggregated-ether-options lacp link-protection
分步程序
通过同一 VLAN 接口同时配置多个协议接口堆栈时,您必须配置 DHCP 或 PPPoE 客户端最初访问路由器的物理接口。我们建议为接口指定与预期从传入客户端获得的相同 VLAN 标记。此示例使用灵活的 VLAN 标记,可同时支持在同一以太网端口上的逻辑接口上传输 802.1Q VLAN 单标记帧和双标记帧。
要自动创建动态 VLAN,接口还必须包括 VLAN 范围类型(单个或堆叠)、动态配置文件引用以及您希望 VLAN 使用的任何特定范围。
要为订阅者访问配置物理接口,请执行以下作:
访问您希望订阅者最初访问路由器的物理接口。
[edit] user@host# edit interfaces ge-5/0/9
指定物理接口所属的聚合以太网接口。
[edit interfaces ge-5/0/9] user@host# set gigether-options 802.3ad ae0
对于要分配给聚合以太网捆绑包的每个接口,重复步骤 1 和步骤 2。
[edit] user@host# set interfaces ge-5/1/9 gigether-options 802.3ad ae0
访问聚合以太网接口。
[edit] user@host# edit interfaces ae0
指定您希望聚合以太网接口使用的 VLAN 标记。
[edit interfaces ae0] user@host# set flexible-vlan-tagging
编辑节段
auto-configure以自动配置 VLAN。[edit interfaces ae0] user@host# edit auto-configure
编辑
vlan-ranges单标记 VLAN 的节。[edit interfaces ae0 auto-configure] user@host# edit vlan-ranges
指定您希望接口用于动态创建单标记 VLAN 的动态 VLAN 配置文件。
[edit interfaces ae0 auto-configure vlan-ranges] user@host# edit dynamic-profile Auto-VLAN-Demux
指定 VLAN 配置文件接受的 VLAN 以太网数据包类型。
[edit interfaces ae0 auto-configure vlan-ranges dynamic-profile Auto-VLAN-Demux] user@host# set accept any
指定要动态配置文件使用的 VLAN 范围。以下示例指定 VLAN ID 下限为 1000,VLAN ID 上限为 1500。
[edit interfaces ae0 auto-configure vlan-ranges dynamic-profile Auto-VLAN-Demux] user@host# set ranges 1000-1500
编辑
stacked-vlan-ranges双标记 VLAN 的节。[edit interfaces ae0 auto-configure] user@host# edit stacked-vlan-ranges
指定您希望接口用于动态创建双标记 VLAN 的动态 VLAN 配置文件。
[edit interfaces ae0 auto-configure stacked-vlan-ranges] user@host# edit dynamic-profile Auto-Stacked-VLAN-Demux
指定堆叠 VLAN 配置文件接受的 VLAN 以太网数据包类型。
[edit interfaces ae0 auto-configure stacked-vlan-ranges dynamic-profile Auto-Stacked-VLAN-Demux] user@host# set accept any
指定要动态配置文件使用的外部和内部堆叠 VLAN 范围。以下示例指定一个从 1501 到 2000 的外部堆叠 VLAN ID 范围(以避免将 VLAN ID 与单标记 VLAN 重叠),内部堆叠 VLAN ID 范围为 any(为内部堆叠 VLAN ID 启用从 1 到 4094 的范围)。
[edit interfaces ge-5/0/9 auto-configure stacked-vlan-ranges dynamic-profile Auto-Stacked-VLAN-Demux] user@host# set ranges 1501-2000,any
(选答)激活聚合以太网接口上的 LACP 数据包传输。
[edit interfaces ae0] user@host# set aggregated-ether-options lacp active
指定聚合以太网接口使用链路保护。
[edit interfaces ae0] user@host# set aggregated-ether-options link-protection
准备环路接口
CLI 快速配置
要快速配置此示例所需的环路接口,请执行以下作:
[edit] set interfaces lo0.0 unit 0 family inet address 100.100.100.1/32
分步程序
您必须配置一个环路接口,用作动态创建接口的未编号地址和首选源地址。
要为此示例配置所需的环路接口:
配置环路接口。
[edit] user@host# edit interfaces lo0.0
指定环路接口接受 inet 数据包。
[edit interfaces lo0 unit 0] user@host# edit family inet
指定环路接口的 IP 地址。
[edit interfaces lo0 unit 0 family inet] user@host# set address 100.100.100.1/32
配置动态配置文件以创建动态单标记 VLAN
CLI 快速配置
要快速配置示例中用于动态创建单标记 VLAN 的动态配置文件:
[edit] set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit demux-source inet set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit proxy-arp set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-id $junos-vlan-id set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-id $junos-vlan-id auto-configure line-identity includes circuit-id set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-id $junos-vlan-id auto-configure line-identity includes remote-id set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-id $junos-vlan-id auto-configure line-identity includes accept-no-ids mac-address set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit demux options underlying-interface $junos-interface-ifd-name set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit family inet unnumbered-address lo0.0 preferred source-address 100.100.100.1 set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit family pppoe duplicate-protection set dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit $junos-interface-unit family pppoe dynamic-profile PPP-Base-PAP
分步程序
若要使动态 DHCP IP 多路分离接口和动态 PPPoE 接口同时驻留在单标记 VLAN 接口上,VLAN 接口必须首先存在。
要配置自动创建 VLAN 接口的动态配置文件:
创建用于自动创建 VLAN 接口的动态配置文件。
[edit] user@host# edit dynamic-profiles Auto-VLAN-Demux
指定动态 VLAN 配置文件使用多路分离接口。
[edit dynamic-profiles “Auto-VLAN-Demux”] user@host# edit interfaces demux0
指定动态配置文件将多路分离接口单元值应用于动态 VLAN。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0] user@host# edit unit $junos-interface-unit
指定多路分离源接受 IPv4 (inet) 数据包。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set demux-source inet
(选答)指定只要存在指向 ARP 请求目标地址的活动路由,每个动态创建的接口都会响应任何 ARP 请求。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set proxy-arp
指定动态创建 VLAN ID。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set vlan-id $junos-vlan-id
- (选答)
要自动配置动态配置文件,以接受以线路标识符作为电路 ID、远程 ID 的 PPPoE 数据包,或者如果未使用该
accept-no-ids mac-address选项收到标识符,则使用 mac-address。如果配置了该
accept-no-ids属性,并且收到的 PPPoE PADI 不带 ACI 或 ARI 字符串,则源 MAC 地址将串联到底层接口,串联字符串用于创建 ACI VLAN。set auto-configure line-identity includes circuit-id set auto-configure line-identity includes remote-id set auto-configure line-identity includes accept-no-ids mac-address
为动态 VLAN 指定逻辑底层接口。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set demux-options underlying-interface $junos-interface-ifd-name
指定 VLAN 多路分离接口可以接受 IP over Ethernet/DHCP 订阅者的 inet 系列数据包。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# edit family inet
将环路地址指定为 inet 家族的未编号地址和首选源地址。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit” family inet] user@host# set unnumbered-address lo0.0 preferred-source-address 100.100.100.1
指定 VLAN 多路分离接口可以接受 PPPoE 订阅者的 PPPoE 家族数据包。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# edit family pppoe
防止在同一 VLAN 接口上为同一 PPPoE 订阅者创建多个 PPPoE 会话。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit” family pppoe] user@host# set duplicate-protection
将动态 PPP 接口配置文件应用于任何动态 PPP 接口。
[edit dynamic-profiles Auto-VLAN-Demux interfaces demux0 unit “$junos-interface-unit” family pppoe] user@host# set dynamic-profile PPP-Base-PAP
- (选答)
要自动配置动态 PPP 接口配置文件,以接受以线路标识符作为电路 ID 的 PPPoE 数据包、远程 ID,或者如果使用该
accept-no-ids mac-address选项未收到标识符,则使用 mac 地址。如果配置了该
accept-no-ids属性,并且收到的 PPPoE PADI 不带 ACI 或 ARI 字符串,则源 MAC 地址将串联到底层接口,串联字符串用于创建 ACI VLAN。set accept pppoe line-identity includes circuit-id set accept pppoe line-identity includes remote-id set accept pppoe line-identity includes accept-no-ids mac-address
配置动态配置文件以创建动态双标记 VLAN
CLI 快速配置
要快速配置示例中用于动态创建堆叠/双标记 VLAN 的动态配置文件:
[edit] set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit demux-source inet set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit proxy-arp set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-tags outer $junos-stacked-vlan-id set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-tags inner $junos-vlan-id set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-tags inner $junos-vlan-id accept any line-identity includes circuit-id set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-tags inner $junos-vlan-id accept any line-identity includes remote-id set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit vlan-tags inner $junos-vlan-id accept any line-identity includes accept-no-ids mac-address set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit demux options underlying-interface $junos-interface-ifd-name set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit family inet unnumbered-address lo0.0 preferred source-address 100.100.100.1 set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit family pppoe duplicate-protection set dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit $junos-interface-unit family pppoe dynamic-profile PPP-Base-PAP
分步程序
若要使动态 DHCP IP 多路分离和动态 PPPoE 接口同时驻留在 VLAN 接口上,VLAN 接口必须首先存在。
要配置自动创建堆叠/双标记 VLAN 接口的动态配置文件:
创建用于自动创建 VLAN 接口的动态配置文件。
[edit] user@host# edit dynamic-profiles Auto-Stacked-VLAN-Demux
指定动态 VLAN 配置文件使用多路分离接口。
[edit dynamic-profiles “Auto-Stacked-VLAN-Demux”] user@host# edit interfaces demux0
指定动态配置文件将多路分离接口单元值应用于动态 VLAN。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0] user@host# edit unit $junos-interface-unit
指定多路分离源接受 IPv4 (inet) 数据包。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set demux-source inet
(选答)指定只要存在指向 ARP 请求目标地址的活动路由,每个动态创建的接口都会响应任何 ARP 请求。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set proxy-arp
指定动态创建外部 VLAN ID。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set vlan-id -tags outer $junos-stacked-vlan-id
指定动态创建内部 VLAN ID。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set vlan-id -tags inner $junos-vlan-id
- (选答)
要自动配置动态配置文件,以接受以线路标识符作为电路 ID、远程 ID 的 PPPoE 数据包,或者如果未使用该
accept-no-ids mac-address选项收到标识符,则使用 mac-address。如果配置了该
accept-no-ids属性,并且收到的 PPPoE PADI 不带 ACI 或 ARI 字符串,则源 MAC 地址将串联到底层接口,串联字符串用于创建 ACI VLAN。set auto-configure line-identity includes circuit-id set auto-configure line-identity includes remote-id set auto-configure line-identity includes accept-no-ids mac-address
为动态 VLAN 指定逻辑底层接口。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set demux-options underlying-interface $junos-interface-ifd-name
指定 VLAN 多路分离接口可以接受 IP over Ethernet/DHCP 订阅者的 inet 系列数据包。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# edit family inet
将环路地址指定为 inet 家族的未编号地址和首选源地址。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit” family inet] user@host# set unnumbered-address lo0.0 preferred-source-address 100.100.100.1
指定 VLAN 多路分离接口可以接受 PPPoE 订阅者的 PPPoE 家族数据包。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# edit family pppoe
防止在同一多路分离底层接口上激活另一个动态 PPPoE 逻辑接口。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit” family pppoe] user@host# set duplicate-protection
将动态 PPP 接口配置文件应用于任何动态 PPP 接口。
[edit dynamic-profiles Auto-Stacked-VLAN-Demux interfaces demux0 unit “$junos-interface-unit” family pppoe] user@host# set dynamic-profile PPP-Base-PAP
- (选答)
要自动配置动态 PPP 接口配置文件,以接受以线路标识符作为电路 ID 的 PPPoE 数据包、远程 ID,或者如果使用该
accept-no-ids mac-address选项未收到标识符,则使用 mac 地址。如果配置了该
accept-no-ids属性,并且收到的 PPPoE PADI 不带 ACI 或 ARI 字符串,则源 MAC 地址将串联到底层接口,串联字符串用于创建 ACI VLAN。set accept pppoe line-identity includes circuit-id set accept pppoe line-identity includes remote-id set accept pppoe line-identity includes accept-no-ids mac-address
配置动态配置文件以创建动态 IP 多路分离接口
CLI 快速配置
要快速配置示例中用于动态创建 DHCP IP 多路分离接口的动态配置文件:
[edit] set dynamic-profiles DHCP-IP-Demux interfaces demux0 unit $junos-interface-unit proxy-arp set dynamic-profiles DHCP-IP-Demux interfaces demux0 unit $junos-interface-unit demux-options underlying-interface $junos-underlying-interface set dynamic-profiles DHCP-IP-Demux interfaces demux0 unit $junos-interface-unit family inet demux-source $junos-subscriber-ip-address set dynamic-profiles DHCP-IP-Demux interfaces demux0 unit $junos-interface-unit family inet unnumbered-address lo0.0 preferred-source-address 100.100.100.1
分步程序
要配置自动创建 IP 多路分离接口的动态配置文件:
创建动态配置文件以动态创建 IP 多路分离接口。
[edit] user@host# edit dynamic-profiles DHCP-IP-Demux
指定动态配置文件使用 demux0 接口。
[edit dynamic-profiles DHCP-IP-Demux] user@host# edit interfaces demux0
指定动态配置文件将接口单元值应用于动态 PPPoE 接口。
[edit dynamic-profiles DHCP-IP-Demux interfaces demux0] user@host# edit unit $junos-interface-unit
(选答)将路由器配置为响应任何 ARP 请求,只要该路由器具有到 ARP 请求目标地址的活动路由即可。
[edit dynamic-profiles DHCP-IP-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set proxy-arp
为动态 IP 多路分离接口指定逻辑底层接口。
[edit dynamic-profiles DHCP-IP-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# set demux-options underlying-interface $junos-underlying-interface
为动态 IP 多路分离接口指定协议家族信息。
[edit dynamic-profiles DHCP-IP-Demux interfaces demux0 unit “$junos-interface-unit”] user@host# edit family inet
指定从传入用户 IP 地址获取的多路分离源地址。
[edit dynamic-profiles DHCP-IP-Demux interfaces demux0 unit “$junos-interface-unit” family inet] user@host# set demux-source $junos-subscriber-ip-address
将环路接口指定为未编号地址,多路分离接口 IP 地址指定为动态 IP 多路分离接口的首选源地址。
[edit dynamic-profiles DHCP-IP-Demux interfaces demux0 unit “$junos-interface-unit” family inet] user@host# set unnumbered-address lo0.0 preferred-source-address 100.100.100.1
配置动态配置文件以创建动态 PPPoE 接口
CLI 快速配置
要快速配置示例中用于动态创建 PPPoE 接口的动态配置文件:
[edit] set dynamic-profiles PPP-Base-PAP interfaces pp0 unit $junos-interface-unit ppp-options pap set dynamic-profiles PPP-Base-PAP interfaces pp0 unit $junos-interface-unit pppoe-options underlying-interface $junos-underlying-interface server set dynamic-profiles PPP-Base-PAP interfaces pp0 unit $junos-interface-unit no-keepalives set dynamic-profiles PPP-Base-PAP interfaces pp0 unit $junos-interface-unit family inet unnumbered-address lo0.0
分步程序
创建用于自动创建 PPPoE 接口的动态配置文件。
[edit] user@host# edit dynamic-profiles PPP-Base-PAP
指定动态 PPPoE 配置文件使用 pp0 接口。
[edit dynamic-profiles PPP-Base-PAP] user@host# edit interfaces pp0
指定动态配置文件将接口单元值应用于动态 PPPoE 接口。
[edit dynamic-profiles PPP-Base-PAP interfaces pp0] user@host# edit unit $junos-interface-unit
指定动态创建的 PPPoE 接口使用 PAP 身份验证。
[edit dynamic-profiles PPP-Base-PAP interfaces pp0 unit “$junos-interface-unit”] user@host# set ppp-options pap
为动态 PPPoE 接口指定逻辑底层接口。
[edit dynamic-profiles PPP-Base-PAP interfaces pp0 unit “$junos-interface-unit”] user@host# set pppoe-options underlying-interface $junos-underlying-interface
指定路由器充当 PPPoE 服务器。
[edit dynamic-profiles PPP-Base-PAP interfaces pp0 unit “$junos-interface-unit”] user@host# set pppoe-options server
(选答)禁用在动态 PPPoE 接口上发送激活消息。
[edit dynamic-profiles PPP-Base-PAP interfaces pp0 unit “$junos-interface-unit”] user@host# set no-keepalives
为动态 PPPoE 接口指定协议家族信息。
[edit dynamic-profiles PPP-Base-PAP interfaces pp0 unit “$junos-interface-unit”] user@host# edit family inet
将环路接口指定为动态 PPPoE 接口的未编号地址。
[edit dynamic-profiles PPP-Base-PAP interfaces pp0 unit “$junos-interface-unit”] user@host# set unnumbered-address lo0.0