示例:为 VPN 中的直接 PE-PE 连接配置链式复合下一跃点
要求
此示例说明如何为 MX 系列和 T4000 路由器上的 MIC 和 MPC 接口启用提供商边缘 (PE) 路由器第 2 层虚拟专用网络 (VPN) 连接与链式复合下一跃点。此示例使用以下硬件和软件组件
五个路由器,可以是 MX240、MX480、MX960 或 T4000 路由器的组合。
在所有设备上运行的 Junos OS 17.3R1 或更高版本。
概述和拓扑
图 1 显示了 MX 系列路由器上为 MIC 和 MPC 接口提供链式复合下一跃点的第 2 层 VPN 连接拓扑示例。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
CE1
set interfaces ge-1/1/1 unit 0 family inet address 192.0.2.2/24 set interfaces ge-1/1/1 unit 0 family iso set interfaces ge-1/1/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 198.51.100.1/24
PE1
set interfaces ge-0/0/4 unit 0 family inet address 10.38.0.5/30 set interfaces ge-0/0/4 unit 0 family mpls set interfaces ge-0/1/1 encapsulation ethernet-ccc set interfaces ge-0/1/1 unit 0 family ccc set interfaces lo0 unit 0 family inet address 10.255.104.133/32 set routing-options forwarding-table chained-composite-next-hop ingress l2vpn set routing-options autonomous-system 200 set routing-options forwarding-table export lbpp set protocols mpls interface ge-0/0/4.0 set protocols ospf area 0.0.0.0 interface ge-0/0/4.0 set protocols bgp group PEs type internal set protocols bgp group PEs local-address 10.255.104.133 set protocols bgp group PEs family l2vpn signaling set protocols bgp group PEs family inet-vpn unicast set protocols bgp group PEs neighbor 10.255.104.134 set routing-instances vpn-a instance-type l2vpn set routing-instances vpn-a interface ge-0/1/1.0 set routing-instances vpn-a route-distinguisher 200:1 set routing-instances vpn-a vrf-target target:200:1 set routing-instances vpn-a protocols l2vpn encapsulation-type ethernet set routing-instances vpn-a protocols l2vpn site 100 site-identifier 100 set routing-instances vpn-a protocols l2vpn site 100 interface ge-0/1/1.0 remote-site-id 200
PE2
set interfaces ge-1/0/2 unit 0 family inet address 10.38.0.13/30 set interfaces ge-1/0/2 unit 0 family mpls set interfaces ge-1/0/5 encapsulation ethernet-ccc set interfaces ge-1/0/5 unit 0 family ccc set interfaces lo0 unit 0 family inet address 10.255.104.134/32 set routing-options forwarding-table chained-composite-next-hop ingress l2vpn set routing-options autonomous-system 200 set routing-options forwarding-table export lbpp set protocols mpls interface ge-1/0/2.0 set protocols ospf area 0.0.0.0 interface ge-1/0/2.0 set protocols bgp group PEs type internal set protocols bgp group PEs local-address 10.255.104.134 set protocols bgp group PEs family l2vpn signaling set protocols bgp group PEs family inet-vpn unicast set protocols bgp group PEs neighbor 10.255.104.133 set routing-instances vpn-a instance-type l2vpn set routing-instances vpn-a interface ge-1/0/5.0 set routing-instances vpn-a route-distinguisher 200:1 set routing-instances vpn-a vrf-target target:200:1 set routing-instances vpn-a protocols l2vpn encapsulation-type ethernet set routing-instances vpn-a protocols l2vpn site 200 site-identifier 200 set routing-instances vpn-a protocols l2vpn site 200 interface ge-1/0/5.0 remote-site-id 100
P
set interfaces ge-2/0/1 unit 0 family inet address 10.38.0.6/30 set interfaces ge-2/0/1 unit 0 family mpls set interfaces ge-2/0/2 unit 0 family inet address 10.38.0.14/30 set interfaces ge-2/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.104.136/32 set protocols mpls interface ge-2/0/1.0 set protocols ospf area 0.0.0.0 interface ge-2/0/1.0 set protocols mpls interface ge-2/0/2.0 set protocols ospf area 0.0.0.0 interface ge-2/0/2.0 set routing-options autonomous-system 200
CE2
set interfaces ge-2/2/2 unit 0 family inet address 192.0.2.4/24 set interfaces ge-2/2/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 198.51.100.2/24
程序
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
要配置基本第 2 层 VPN 以及 PE1 路由器上的链接复合下一跃点:
修改路由器的相应接口名称、地址和任何其他参数后,对 MPLS 域中的 PE2 路由器重复此过程。
配置 PE1 路由器上的接口。
PE1 to CE1
[edit interfaces]
user@PE1# set interfaces ge-0/1/1 encapsulation ethernet-ccc user@PE1# set interfaces ge-0/1/1 unit 0 family cccPE1 to P
[edit interfaces]
user@PE1 # set ge-0/0/4 unit 0 family inet address 10.38.0.5/30 user@PE1 # set ge-0/0/4 unit 0 family mplsLoopback interface
[edit interfaces]
user@PE1 # set lo0 unit 0 family inet address 10.255.104.133/32在全球第 2 层 VPN 上启用链复合下一跃点。
[edit routing-options]
use@PE1# set forwarding-table chained-composite-next-hop ingress l2vpn为 PE1 配置自治系统。
[edit routing-options]
user@PE1# set autonomous-system 200导出为负载平衡配置的策略。
[edit routing-options]
user@PE1# set forwarding-table export lbpp在连接到 P 路由器的 PE1 接口上配置 MPLS。
[edit protocols]
set mpls interface ge-0/0/4.0在 PE1 界面上配置 OSPF。
[edit protocols]
user@PE1# set ospf area 0.0.0.0 interface ge-0/0/4.0配置 PE1 到 PE2 路由器的 IBGP 组。
[edit protocols]
user@PE1# set bgp group PEs type internal user@PE1# set bgp group PEs local-address 10.255.104.133 user@PE1# set bgp group PEs family l2vpn signaling user@PE1# set bgp group PEs family inet-vpn unicast user@PE1# set bgp group PEs neighbor 10.255.104.134配置路由实例参数。
[edit routing-instances]
user@PE1# set vpn-a instance-type l2vpn user@PE1# set vpn-a interface ge-0/1/1.0 user@PE1# set vpn-a route-distinguisher 200:1 user@PE1# set vpn-a vrf-target target:200:1 user@PE1# set vpn-a protocols l2vpn encapsulation-type ethernet user@PE1# set vpn-a protocols l2vpn site 100 site-identifier 100 user@PE1# set vpn-a protocols l2vpn site 100 interface ge-0/1/1.0 remote-site-id 200
结果
在配置模式下,输入 、 show chassis
show interfaces
、 show protocols
、 show routing-options
、 show routing-instances
和show policy-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
PE1
user@PE1# show interfaces
ge-0/0/4 {
unit 0 {
family inet {
address 10.38.0.5/30;
}
family mpls;
}
}
ge-0/1/1 {
encapsulation ethernet-ccc;
unit 0 {
family iso;
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.255.104.133/32;
}
}
}
user@PE1# show protocols
mpls {
interface ge0/0/4.0;
}
bgp {
group PEs {
type internal;
local-address 10.255.104.133;
family inet-vpn {
unicast;
}
family l2vpn {
signaling;
}
neighbor 10.255.104.134;
}
}
ospf {
area 0.0.0.0 {
interface ge-0/0/4.0;
}
}
user@PE1# show routing-options
autonomous-system 200;
forwarding-table {
export lbpp;
chained-composite-next-hop {
ingress {
l2vpn;
}
}
}
user@PE1# show routing-instances
vpn-a {
instance-type l2vpn;
interface ge-0/1/1.0;
route-distinguisher 200:1;
vrf-target target:200:1;
protocols {
l2vpn {
encapsulation-type ethernet;
site 100 {
site-identifier 100;
interface ge-0/1/1.0 {
remote-site-id 200;
}
}
}
}
}