示例:配置 MBGP MVPN 外联网
了解 MBGP 组播 VPN 外联网
组播 VPN (MVPN) 外联网使服务提供商能够将源自一个 VPN 路由和转发 (VRF) 实例的 IP 组播流量转发到另一个 VRF 实例中的接收方。此功能也称为 重叠 MVPN。
MVPN 外联网功能支持以量:
一个 VRF 中的接收方可以从连接到不同 VRF 中不同路由器的源接收组播流量。
一个 VRF 中的接收方可以从连接到不同 VRF 中的同一路由器的源接收组播流量。
一个 VRF 中的接收方可以从连接到同一 VRF 中不同路由器的源接收组播流量。
可以阻止一个 VRF 中的接收方从另一个 VRF 中的特定源接收组播流量。
MBGP 组播 VPN 外联网应用程序
MVPN 外部网在以下应用程序中很有用。
Mergers and Data Sharing
当不同的企业 VPN 客户之间存在业务合作关系,要求他们能够相互通信时,MVPN 外部网非常有用。例如,批发公司可能希望向其承包商和经销商广播库存。当公司合并并且一组 VPN 站点需要从另一个 VPN 接收内容时,MVPN 外部网也很有用。从服务提供商的角度来看,参与合并的企业是不同的VPN客户。MVPN 外联网使连接成为可能。
Video Distribution
MVPN 外部网的另一个用途是从视频头端到接收站点的视频组播分发。给定组播 VPN 中的站点可能位于不同的组织中。接收方可以订阅来自特定内容提供商的内容。
MVPN 提供商网络上的 PE 路由器了解使用 MVPN 机制的源和接收器。这些 PE 路由器可以使用选择性树作为主干网中的组播分配机制。网络仅承载来自一个或多个组播 VPN 的一组指定一个或多个组播组的流量。因此,如果需要,此模型有助于有选择地分发来自多个提供商的内容。
Financial Services
MVPN 外联网的第三个用途是企业和金融服务基础设施。财务数据(如金融市场更新、股票行情价值和金融电视频道)的交付是必须向数百甚至数千名最终用户提供相同数据流的应用程序的一个示例。内容分发机制在很大程度上依赖于金融提供商网络内的组播。在这种情况下,经纪公司和银行网络中还可以存在广泛的组播拓扑,以实现内容的进一步分发和交易应用程序。金融服务提供商要求在访问内容的客户之间进行流量分离,而 MVPN 外联网提供了这种分离。
MBGP 组播 VPN 外联网配置指南
配置 MVPN 外联网时,请记住以下几点:
如果提供商边缘 (PE) 路由器上有多个 VRF 路由实例,且接收方有兴趣从同一源接收组播流量,则必须在所有实例上配置虚拟隧道 (VT) 接口。
对于自动 RP 操作,必须在外部网网络中的至少两个 PE 上配置映射代理。
对于使用 auto-RP 的非对称配置外联网,当一个 VRF 实例是唯一从所有其他外联网实例导入路由的实例时,必须在 VRF 中配置映射代理,以便可以从所有 VRF 实例接收所有 RP 发现消息,并且应禁用映射代理选择。
对于引导路由器 (BSR) 操作,候选和当选的 BSR 可以位于 PE、CE 或 C 路由器上。将 BSR 连接到 MVPN 外联网的 PE 路由器必须在路由实例中配置提供商隧道或其他物理接口。唯一不支持的情况是,BSR 位于连接到 PE 路由实例的 CE 或 C 路由器上,该路由实例是 Extranet 的一部分,但没有配置的提供商隧道,并且除了连接到客户边缘路由器的接口之外没有任何其他接口。
RSVP-TE 点对多点 LSP 必须用于提供商隧道。
MVPN 外联网 VRF 实例不支持 PIM 密集模式。
示例:配置 MBGP 组播 VPN 外联网
此示例提供使用静态集合点配置组播 VPN 外联网的分步过程。它分为以下部分:
要求
此示例使用以下硬件和软件组件:
Junos OS 9.5 或更高版本
6 个 T 系列或 MX 系列瞻博网络路由器
在充当 PE 路由器的每个 T 系列路由器中都有一个自适应服务 PIC 或多服务 PIC。
一个能够发送组播流量并支持互联网组管理协议 (IGMP) 的主机系统
三个主机系统能够接收组播流量并支持 IGMP
概述和拓扑
在 图 1 所示的网络拓扑中:
主机 H1 是绿色 VPN 中组 244.1.1.1 的源。
源自源 H1 的组播流量可由连接到路由器 CE2 的主机 H4 在绿色 VPN 中接收。
源自源 H1 的组播流量可由蓝色 VPN 中连接到路由器 CE3 的主机 H3 接收。
源自源 H1 的组播流量可由直接连接到红色 VPN 中的路由器 PE1 的主机 H2 接收。
任何主机都可以是发送方站点或接收方站点。
拓扑学

配置
在任何配置会话中,最好定期验证是否可以使用 commit check
命令提交配置。
在此示例中,使用以下命令提示符标识正在配置的路由器:
CE1
标识客户边缘 1 (CE1) 路由器PE1
标识提供商边缘 1 (PE1) 路由器CE2
识别客户边缘 2 (CE2) 路由器PE2
标识提供商边缘 2 (PE2) 路由器CE3
标识客户边缘 3 (CE3) 路由器PE3
标识提供商边缘 3 (PE3) 路由器
配置组播 VPN 外联网涉及以下任务:
- 配置接口
- 在核心中配置 IGP
- 在核心中配置 BGP
- 配置 LDP
- 配置 RSVP
- 配置 MPLS
- 配置 VRF 路由实例
- 配置 MVPN 外联网策略
- 配置 CE-PE BGP
- 在 PE 路由器上配置 PIM
- 在客户边缘路由器上配置 PIM
- 配置集合点
- 测试 MVPN 外联网
- 结果
配置接口
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
在每个路由器上,在环路逻辑接口 0 ()
lo0.0
上配置 IP 地址。user@CE1# set interfaces lo0 unit 0 family inet address 192.168.6.1/32 primary user@PE1# set interfaces lo0 unit 0 family inet address 192.168.1.1/32 primary user@PE2# set interfaces lo0 unit 0 family inet address 192.168.2.1/32 primary user@CE2# set interfaces lo0 unit 0 family inet address 192.168.4.1/32 primary user@PE3# set interfaces lo0 unit 0 family inet address 192.168.7.1/32 primary user@CE3# set interfaces lo0 unit 0 family inet address 192.168.9.1/32 primary
使用命令验证
show interfaces terse
环路接口上是否配置了正确的 IP 地址。在 PE 和客户边缘路由器上,在快速以太网和千兆以太网接口上配置 IP 地址和协议家族。
inet
指定地址族类型。user@CE1# set interfaces fe-1/3/0 unit 0 family inet address 10.10.12.1/24 user@PE1# set interfaces fe-0/1/0 unit 0 description "to H2" user@PE1# set interfaces fe-0/1/0 unit 0 family inet address 10.2.11.2/30 user@PE1# set interfaces fe-0/1/1 unit 0 description "to PE3 fe-0/1/1.0" user@PE1# set interfaces fe-0/1/1 unit 0 family inet address 10.0.17.13/30 user@PE1# set interfaces ge-0/3/0 unit 0 family inet address 10.0.12.9/30 user@PE2# set interfaces fe-0/1/3 unit 0 description "to PE3 fe-0/1/3.0" user@PE2# set interfaces fe-0/1/3 unit 0 family inet address 10.0.27.13/30 user@PE2# set interfaces ge-1/3/0 unit 0 description "to PE1 ge-0/3/0.0" user@PE2# set interfaces ge-1/3/0 unit 0 family inet address 10.0.12.10/30 user@CE2# set interfaces fe-0/1/1 unit 0 description "to H4" user@CE2# set interfaces fe-0/1/1 unit 0 family inet address 10.10.11.2/24 user@PE3# set interfaces fe-0/1/1 unit 0 description "to PE1 fe-0/1/1.0" user@PE3# set interfaces fe-0/1/1 unit 0 family inet address 10.0.17.14/30 user@PE3# set interfaces fe-0/1/3 unit 0 description "to PE2 fe-0/1/3.0" user@PE3# set interfaces fe-0/1/3 unit 0 family inet address 10.0.27.14/30 user@CE3# set interfaces fe-0/1/0 unit 0 description "to H3" user@CE3# set interfaces fe-0/1/0 unit 0 family inet address 10.3.11.3/24
使用命令验证
show interfaces terse
接口上是否配置了正确的 IP 地址和地址族类型。在 PE 和 客户边缘 路由器上,配置 SONET 接口。指定
inet
地址族类型和本地 IP 地址。user@CE1# set interfaces so-0/0/3 unit 0 description "to PE1 so-0/0/3.0;" user@CE1# set interfaces so-0/0/3 unit 0 family inet address 10.0.16.1/30 user@PE1# set interfaces so-0/0/3 unit 0 description "to CE1 so-0/0/3.0" user@PE1# set interfaces so-0/0/3 unit 0 family inet address 10.0.16.2/30 user@PE2# set interfaces so-0/0/1 unit 0 description "to CE2 so-0/0/1:0.0" user@PE2# set interfaces so-0/0/1 unit 0 family inet address 10.0.24.1/30 user@CE2# set interfaces so-0/0/1 unit 0 description "to PE2 so-0/0/1" user@CE2# set interfaces so-0/0/1 unit 0 family inet address 10.0.24.2/30 user@PE3# set interfaces so-0/0/1 unit 0 description "to CE3 so-0/0/1.0" user@PE3# set interfaces so-0/0/1 unit 0 family inet address 10.0.79.1/30 user@CE3# set interfaces so-0/0/1 unit 0 description "to PE3 so-0/0/1" user@CE3# set interfaces so-0/0/1 unit 0 family inet address 10.0.79.2/30
使用命令验证
show configuration interfaces
接口上是否配置了正确的 IP 地址和地址族类型。在每个路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
使用
ping
命令验证每个之间的单播连接:客户边缘路由器和连接的主机
客户边缘路由器和 PE 路由器上的直接连接接口
PE 路由器和其他 PE 路由器上的直接连接的接口
在核心中配置 IGP
分步过程
在 PE 路由器上,配置内部网关协议,例如 OSPF 或 IS-IS。此示例说明如何配置 OSPF。
lo0.0
指定面向 SONET 核心的逻辑接口。user@PE1# set protocols ospf area 0.0.0.0 interface ge-0/3/0.0 metric 100 user@PE1# set protocols ospf area 0.0.0.0 interface fe-0/1/1.0 metric 100 user@PE1# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@PE1# set protocols ospf area 0.0.0.0 interface fxp0.0 disable user@PE2# set protocols ospf area 0.0.0.0 interface fe-0/1/3.0 metric 100 user@PE2# set protocols ospf area 0.0.0.0 interface ge-1/3/0.0 metric 100 user@PE2# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@PE2# set protocols ospf area 0.0.0.0 interface fxp0.0 disable user@PE3# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@PE3# set protocols ospf area 0.0.0.0 interface fe-0/1/3.0 metric 100 user@PE3# set protocols ospf area 0.0.0.0 interface fe-0/1/1.0 metric 100 user@PE3# set protocols ospf area 0.0.0.0 interface fxp0.0 disable
在 PE 路由器上,配置路由器 ID。
user@PE1# set routing-options router-id 192.168.1.1 user@PE2# set routing-options router-id 192.168.2.1 user@PE3# set routing-options router-id 192.168.7.1
使用 和
show ospf overview
show configuration protocols ospf
命令验证是否为 OSPF 协议配置了正确的接口。在 PE 路由器上,配置 OSPF 流量工程支持。启用信息流工程扩展支持约束最短路径优先算法,该算法是支持资源预留协议 - 流量工程 (RSVP-TE) 点对多点标签交换路径 (LSP) 所必需的。如果要配置 IS-IS,则无需任何其他配置即可支持流量工程。
user@PE1# set protocols ospf traffic-engineering user@PE2# set protocols ospf traffic-engineering user@PE3# set protocols ospf traffic-engineering
使用 和
show ospf overview
show configuration protocols ospf
命令验证是否为 OSPF 协议启用了信息流工程支持。在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在 PE 路由器上,验证 OSPF 邻居是否形成邻接。
user@PE1> show ospf neighbors Address Interface State ID Pri Dead 10.0.17.14 fe-0/1/1.0 Full 192.168.7.1 128 32 10.0.12.10 ge-0/3/0.0 Full 192.168.2.1 128 33
验证其他两个 PE 路由器的邻居状态是否为
Full
。
在核心中配置 BGP
分步过程
在 PE 路由器上,配置 BGP。配置 BGP 本地自治系统编号。
user@PE1# set routing-options autonomous-system 65000 user@PE2# set routing-options autonomous-system 65000 user@PE3# set routing-options autonomous-system 65000
配置 BGP 对等组。将本地地址配置为
lo0.0
路由器上的地址。邻居地址是lo0.0
其他 PE 路由器的地址。该
unicast
语句使路由器能够使用 BGP 通告网络层可达性信息 (NLRI)。该signaling
语句使路由器能够使用 BGP 作为 VPN 的信令协议。user@PE1# set protocols bgp group group-mvpn type internal user@PE1# set protocols bgp group group-mvpn local-address 192.168.1.1 user@PE1# set protocols bgp group group-mvpn family inet-vpn unicast user@PE1# set protocols bgp group group-mvpn family inet-mvpn signaling user@PE1# set protocols bgp group group-mvpn neighbor 192.168.2.1 user@PE1# set protocols bgp group group-mvpn neighbor 192.168.7.1 user@PE2# set protocols bgp group group-mvpn type internal user@PE2# set protocols bgp group group-mvpn local-address 192.168.2.1 user@PE2# set protocols bgp group group-mvpn family inet-vpn unicast user@PE2# set protocols bgp group group-mvpn family inet-mvpn signaling user@PE2# set protocols bgp group group-mvpn neighbor 192.168.1.1 user@PE2# set protocols bgp group group-mvpn neighbor 192.168.7.1 user@PE3# set protocols bgp group group-mvpn type internal user@PE3# set protocols bgp group group-mvpn local-address 192.168.7.1 user@PE3# set protocols bgp group group-mvpn family inet-vpn unicast user@PE3# set protocols bgp group group-mvpn family inet-mvpn signaling user@PE3# set protocols bgp group group-mvpn neighbor 192.168.1.1 user@PE3# set protocols bgp group group-mvpn neighbor 192.168.2.1
在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在 PE 路由器上,验证 BGP 邻居是否形成对等会话。
user@PE1> show bgp group Group Type: Internal AS: 65000 Local AS: 65000 Name: group-mvpn Index: 0 Flags: Export Eval Holdtime: 0 Total peers: 2 Established: 2 192.168.2.1+54883 192.168.7.1+58933 bgp.l3vpn.0: 0/0/0/0 bgp.mvpn.0: 0/0/0/0 Groups: 1 Peers: 2 External: 0 Internal: 2 Down peers: 0 Flaps: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 0 0 0 0 0 0 bgp.mvpn.0 0 0 0 0 0 0
验证其他两个 PE 路由器的对等状态是否为
Established
,以及其他 PE 路由器的地址是否lo0.0
显示为对等方。
配置 LDP
分步过程
在 PE 路由器上,配置 LDP 以支持单播流量。指定 PE 路由器之间面向核心的快速以太网和千兆以太网接口。同时配置 LDP 指定
lo0.0
接口。最佳做法是在接口上fxp0
禁用 LDP。user@PE1# set protocols ldp deaggregate user@PE1# set protocols ldp interface fe-0/1/1.0 user@PE1# set protocols ldp interface ge-0/3/0.0 user@PE1# set protocols ldp interface fxp0.0 disable user@PE1# set protocols ldp interface lo0.0 user@PE2# set protocols ldp deaggregate user@PE2# set protocols ldp interface fe-0/1/3.0 user@PE2# set protocols ldp interface ge-1/3/0.0 user@PE2# set protocols ldp interface fxp0.0 disable user@PE2# set protocols ldp interface lo0.0 user@PE3# set protocols ldp deaggregate user@PE3# set protocols ldp interface fe-0/1/1.0 user@PE3# set protocols ldp interface fe-0/1/3.0 user@PE3# set protocols ldp interface fxp0.0 disable user@PE3# set protocols ldp interface lo0.0
在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在 PE 路由器上,使用命令验证
show ldp route
LDP 路由。user@PE1> show ldp route Destination Next-hop intf/lsp Next-hop address 10.0.12.8/30 ge-0/3/0.0 10.0.12.9/32 10.0.17.12/30 fe-0/1/1.0 10.0.17.13/32 10.0.27.12/30 fe-0/1/1.0 10.0.17.14 ge-0/3/0.0 10.0.12.10 192.168.1.1/32 lo0.0 192.168.2.1/32 ge-0/3/0.0 10.0.12.10 192.168.7.1/32 fe-0/1/1.0 10.0.17.14 224.0.0.5/32 224.0.0.22/32
验证是否已为核心网络中的每个远程目标建立下一跃点接口和下一跃点地址。请注意,本地目标没有下一跃点接口,核心外部的远程目标没有下一跃点地址。
配置 RSVP
分步过程
在 PE 路由器上,配置 RSVP。指定参与 LSP 的面向核心的快速以太网和千兆以太网接口。还要指定
lo0.0
接口。最佳做法是在接口上fxp0
禁用 RSVP。user@PE1# set protocols rsvp interface ge-0/3/0.0 user@PE1# set protocols rsvp interface fe-0/1/1.0 user@PE1# set protocols rsvp interface lo0.0 user@PE1# set protocols rsvp interface fxp0.0 disable user@PE2# set protocols rsvp interface fe-0/1/3.0 user@PE2# set protocols rsvp interface ge-1/3/0.0 user@PE2# set protocols rsvp interface lo0.0 user@PE2# set protocols rsvp interface fxp0.0 disable user@PE3# set protocols rsvp interface fe-0/1/3.0 user@PE3# set protocols rsvp interface fe-0/1/1.0 user@PE3# set protocols rsvp interface lo0.0 user@PE3# set protocols rsvp interface fxp0.0 disable
在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
使用命令验证
show configuration protocols rsvp
这些步骤。只有在建立 LSP 后,才能验证 RSVP 的运行情况。
配置 MPLS
分步过程
在 PE 路由器上,配置 MPLS。指定参与 LSP 的面向核心的快速以太网和千兆以太网接口。最佳做法是在 fxp0 接口上禁用 MPLS。
user@PE1# set protocols mpls interface ge-0/3/0.0 user@PE1# set protocols mpls interface fe-0/1/1.0 user@PE1# set protocols mpls interface fxp0.0 disable user@PE2# set protocols mpls interface fe-0/1/3.0 user@PE2# set protocols mpls interface ge-1/3/0.0 user@PE2# set protocols mpls interface fxp0.0 disable user@PE3# set protocols mpls interface fe-0/1/3.0 user@PE3# set protocols mpls interface fe-0/1/1.0 user@PE3# set protocols mpls interface fxp0.0 disable
使用命令验证
show configuration protocols mpls
是否为 MPLS 配置了面向核心的快速以太网和千兆以太网接口。在 PE 路由器上,配置与 LSP 关联的面向核心的接口。
mpls
指定地址族类型。user@PE1# set interfaces fe-0/1/1 unit 0 family mpls user@PE1# set interfaces ge-0/3/0 unit 0 family mpls user@PE2# set interfaces fe-0/1/3 unit 0 family mpls user@PE2# set interfaces ge-1/3/0 unit 0 family mpls user@PE3# set interfaces fe-0/1/3 unit 0 family mpls user@PE3# set interfaces fe-0/1/1 unit 0 family mpls
使用命令验证
show mpls interface
面向核心的接口是否配置了 MPLS 地址族。在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
您可以在建立 LSP 后验证 MPLS 的运行。
配置 VRF 路由实例
分步过程
在路由器 PE1 上,为绿色和红色 VPN 配置路由实例。 指定
vrf
实例类型并指定面向客户的 SONET 接口。在每个 PE 上的所有 MVPN 路由实例上配置虚拟隧道 (VT) 接口,其中不同实例中的主机需要从同一源接收组播流量。
user@PE1# set routing-instances green instance-type vrf user@PE1# set routing-instances green interface so-0/0/3.0 user@PE1# set routing-instances green interface vt-1/2/0.1 multicast user@PE1# set routing-instances green interface lo0.1 user@PE1# set routing-instances red instance-type vrf user@PE1# set routing-instances red interface fe-0/1/0.0 user@PE1# set routing-instances red interface vt-1/2/0.2 user@PE1# set routing-instances red interface lo0.2
使用 和
show configuration routing-instances green
show configuration routing-instances red
命令验证是否已正确配置虚拟隧道接口。在路由器 PE2 上,为绿色 VPN 配置路由实例。指定
vrf
实例类型并指定面向客户的 SONET 接口。user@PE2# set routing-instances green instance-type vrf user@PE2# set routing-instances green interface so-0/0/1.0 user@PE2# set routing-instances green interface vt-1/2/0.1 user@PE2# set routing-instances green interface lo0.1
使用
show configuration routing-instances green
命令。在路由器 PE3 上,为蓝色 VPN 配置路由实例。指定
vrf
实例类型并指定面向客户的 SONET 接口。user@PE3# set routing-instances blue instance-type vrf user@PE3# set routing-instances blue interface so-0/0/1.0 user@PE3# set routing-instances blue interface vt-1/2/0.3 user@PE3# set routing-instances blue interface lo0.1
使用命令验证
show configuration routing-instances blue
是否已正确配置实例类型,以及是否已在路由实例中配置正确的接口。在路由器 PE1 上,为绿色和红色路由实例配置路由识别符。路由识别符允许路由器区分用作 VPN 路由的两个相同 IP 前缀。
提示:为了帮助排除故障,此示例说明如何配置路由识别符以匹配路由器 ID。这允许您将路由与播发它的路由器相关联。
user@PE1# set routing-instances green route-distinguisher 192.168.1.1:1 user@PE1# set routing-instances red route-distinguisher 192.168.1.1:2
在路由器 PE2 上,为绿色路由实例配置路由识别符。
user@PE2# set routing-instances green route-distinguisher 192.168.2.1:1
在路由器 PE3 上,为蓝色路由实例配置路由识别符。
user@PE3# set routing-instances blue route-distinguisher 192.168.7.1:3
在 PE 路由器上,配置 VPN 路由实例以支持组播。
user@PE1# set routing-instances green protocols mvpn user@PE1# set routing-instances red protocols mvpn user@PE2# set routing-instances green protocols mvpn user@PE3# set routing-instances blue protocols mvpn
使用命令验证
show configuration routing-instance
路由识别器配置是否正确,以及路由实例中是否启用了 MVPN 协议。在 PE 路由器上,在其他环路逻辑接口上配置 IP 地址。这些逻辑接口用作 VPN 的环路地址。
user@PE1# set interfaces lo0 unit 1 description "green VRF loopback" user@PE1# set interfaces lo0 unit 1 family inet address 10.10.1.1/32 user@PE1# set interfaces lo0 unit 2 description "red VRF loopback" user@PE1# set interfaces lo0 unit 2 family inet address 10.2.1.1/32 user@PE2# set interfaces lo0 unit 1 description "green VRF loopback" user@PE2# set interfaces lo0 unit 1 family inet address 10.10.22.2/32 user@PE3# set interfaces lo0 unit 1 description "blue VRF loopback" user@PE3# set interfaces lo0 unit 1 family inet address 10.3.33.3/32
使用命令验证
show interfaces terse
是否正确配置了环路逻辑接口。在 PE 路由器上,配置虚拟隧道接口。这些接口用于 VRF 实例,在这些实例中,到达提供商隧道的组播流量需要转发到多个 VPN。
user@PE1# set interfaces vt-1/2/0 unit 1 description "green VRF multicast vt" user@PE1# set interfaces vt-1/2/0 unit 1 family inet user@PE1# set interfaces vt-1/2/0 unit 2 description "red VRF unicast and multicast vt" user@PE1# set interfaces vt-1/2/0 unit 2 family inet user@PE1# set interfaces vt-1/2/0 unit 3 description "blue VRF multicast vt" user@PE1# set interfaces vt-1/2/0 unit 3 family inet user@PE2# set interfaces vt-1/2/0 unit 1 description "green VRF unicast and multicast vt" user@PE2# set interfaces vt-1/2/0 unit 1 family inet user@PE2# set interfaces vt-1/2/0 unit 3 description "blue VRF unicast and multicast vt" user@PE2# set interfaces vt-1/2/0 unit 3 family inet user@PE3# set interfaces vt-1/2/0 unit 3 description "blue VRF unicast and multicast vt" user@PE3# set interfaces vt-1/2/0 unit 3 family inet
使用命令验证
show interfaces terse
虚拟隧道接口是否配置了正确的地址族类型。在 PE 路由器上,配置提供商隧道。
user@PE1# set routing-instances green provider-tunnel rsvp-te label-switched-path-template default-template user@PE1# set routing-instances red provider-tunnel rsvp-te label-switched-path-template default-template user@PE2# set routing-instances green provider-tunnel rsvp-te label-switched-path-template default-template user@PE3# set routing-instances blue provider-tunnel rsvp-te label-switched-path-template default-template
使用命令验证
show configuration routing-instance
提供程序隧道是否配置为使用默认 LSP 模板。注意:在下一节中配置 VRF 目标之前,您无法提交 VRF 实例的配置。
配置 MVPN 外联网策略
分步过程
在 PE 路由器上,为每个 VPN 的路由目标定义 VPN 公共组名称。VPN 导入和导出策略中使用公共组名称。
user@PE1# set policy-options community green-com members target:65000:1 user@PE1# set policy-options community red-com members target:65000:2 user@PE1# set policy-options community blue-com members target:65000:3 user@PE2# set policy-options community green-com members target:65000:1 user@PE2# set policy-options community red-com members target:65000:2 user@PE2# set policy-options community blue-com members target:65000:3 user@PE3# set policy-options community green-com members target:65000:1 user@PE3# set policy-options community red-com members target:65000:2 user@PE3# set policy-options community blue-com members target:65000:3
使用
show policy-options
命令验证是否配置了正确的 VPN 社区名称和路由目标。在 PE 路由器上,配置 VPN 导入策略。包括要接受的路由目标的社区名称。不要包含您不想接受的路由目标的团体名称。例如,省略您不希望从中接收组播流量的组播发送方 VPN 中的路由的社区名称。
user@PE1# set policy-options policy-statement green-red-blue-import term t1 from community green-com user@PE1# set policy-options policy-statement green-red-blue-import term t1 from community red-com user@PE1# set policy-options policy-statement green-red-blue-import term t1 from community blue-com user@PE1# set policy-options policy-statement green-red-blue-import term t1 then accept user@PE1# set policy-options policy-statement green-red-blue-import term t2 then reject user@PE2# set policy-options policy-statement green-red-blue-import term t1 from community green-com user@PE2# set policy-options policy-statement green-red-blue-import term t1 from community red-com user@PE2# set policy-options policy-statement green-red-blue-import term t1 from community blue-com user@PE2# set policy-options policy-statement green-red-blue-import term t1 then accept user@PE2# set policy-options policy-statement green-red-blue-import term t2 then reject user@PE3# set policy-options policy-statement green-red-blue-import term t1 from community green-com user@PE3# set policy-options policy-statement green-red-blue-import term t1 from community red-com user@PE3# set policy-options policy-statement green-red-blue-import term t1 from community blue-com user@PE3# set policy-options policy-statement green-red-blue-import term t1 then accept user@PE3# set policy-options policy-statement green-red-blue-import term t2 then reject
使用
show policy green-red-blue-import
命令验证是否正确配置了 VPN 导入策略。在 PE 路由器上,应用 VRF 导入策略。在此示例中,策略在策略中
policy-statement
定义,目标社区在层次结构级别下[edit policy-options]
定义。user@PE1# set routing-instances green vrf-import green-red-blue-import user@PE1# set routing-instances red vrf-import green-red-blue-import user@PE2# set routing-instances green vrf-import green-red-blue-import user@PE3# set routing-instances blue vrf-import green-red-blue-import
使用命令验证
show configuration routing-instances
是否已应用正确的 VRF 导入策略。在 PE 路由器上,配置 VRF 导出目标。语句
vrf-target
和export
选项会导致播发的路由标有目标社区。对于路由器 PE3,包含语句
vrf-target
而不指定export
选项。如果未指定import
或export
选项,则会生成默认的 VRF 导入和导出策略,以接受导入的路由并使用指定的目标社区标记导出的路由。注意:您必须在每个 PE 路由器上为给定的 VPN 路由实例配置相同的路由目标。
user@PE1# set routing-instances green vrf-target export target:65000:1 user@PE1# set routing-instances red vrf-target export target:65000:2 user@PE2# set routing-instances green vrf-target export target:65000:1 user@PE3# set routing-instances blue vrf-target target:65000:3
使用命令验证
show configuration routing-instances
是否配置了正确的 VRF 导出目标。在 PE 路由器上,配置 VRF 实例之间的路由自动导出。包含
auto-export
语句时,vrf-import
将在所有 VRF 实例中比较和vrf-export
策略。如果实例之间存在公共路由目标社区,则共享路由。在此示例中,该auto-export
语句必须包含在需要向位于同一路由器上的另一个实例发送流量和从其接收流量的所有实例下。user@PE1# set routing-instances green routing-options auto-export user@PE1# set routing-instances red routing-options auto-export user@PE2# set routing-instances green routing-options auto-export user@PE3# set routing-instances blue routing-options auto-export
在 PE 路由器上,配置负载平衡策略语句。虽然负载平衡可以更好地利用可用链接,但 MVPN 外部网不需要这样做。此处包含它作为最佳实践。
user@PE1# set policy-options policy-statement load-balance then load-balance per-packet user@PE2# set policy-options policy-statement load-balance then load-balance per-packet user@PE3# set policy-options policy-statement load-balance then load-balance per-packet
使用该
show policy-options
命令验证是否已正确配置负载平衡策略语句。在 PE 路由器上,应用负载平衡策略。
user@PE1# set routing-options forwarding-table export load-balance user@PE2# set routing-options forwarding-table export load-balance user@PE3# set routing-options forwarding-table export load-balance
在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在 PE 路由器上,使用命令验证
show rsvp neighbor
是否已建立 RSVP 邻居。user@PE1> show rsvp neighbor RSVP neighbor: 2 learned Address Idle Up/Dn LastChange HelloInt HelloTx/Rx MsgRcvd 10.0.17.14 5 1/0 43:52 9 293/293 247 10.0.12.10 0 1/0 50:15 9 336/336 140
验证其他 PE 路由器是否列为 RSVP 邻居。
在 PE 路由器上,显示 MPLS LSP。
user@PE1> show mpls lsp p2mp Ingress LSP: 2 sessions P2MP name: 192.168.1.1:1:mvpn:green, P2MP branch count: 2 To From State Rt P ActivePath LSPname 192.168.2.1 192.168.1.1 Up 0 * 192.168.2.1:192.168.1.1:1:mvpn:green 192.168.7.1 192.168.1.1 Up 0 * 192.168.7.1:192.168.1.1:1:mvpn:green P2MP name: 192.168.1.1:2:mvpn:red, P2MP branch count: 2 To From State Rt P ActivePath LSPname 192.168.2.1 192.168.1.1 Up 0 * 192.168.2.1:192.168.1.1:2:mvpn:red 192.168.7.1 192.168.1.1 Up 0 * 192.168.7.1:192.168.1.1:2:mvpn:red Total 4 displayed, Up 4, Down 0 Egress LSP: 2 sessions P2MP name: 192.168.2.1:1:mvpn:green, P2MP branch count: 1 To From State Rt Style Labelin Labelout LSPname 192.168.1.1 192.168.2.1 Up 0 1 SE 299888 3 192.168.1.1:192.168.2.1:1:mvpn:green P2MP name: 192.168.7.1:3:mvpn:blue, P2MP branch count: 1 To From State Rt Style Labelin Labelout LSPname 192.168.1.1 192.168.7.1 Up 0 1 SE 299872 3 192.168.1.1:192.168.7.1:3:mvpn:blue Total 2 displayed, Up 2, Down 0 Transit LSP: 0 sessions Total 0 displayed, Up 0, Down 0
在路由器 PE1 的此显示中,请注意,此路由器上配置的绿色 VPN 有两个入口 LSP,红色 VPN 有两个入口 LSP。验证每个入口 LSP 的状态是否为
up
。另请注意,绿色和蓝色 VPN 各有一个出口 LSP。 验证每个出口 LSP 的状态是否为up
。提示:命令输出中显示的
show mpls lsp p2mp
LSP 名称可在命令中使用ping mpls rsvp <lsp-name> multipath
。
配置 CE-PE BGP
分步过程
在 PE 路由器上,配置 BGP 导出策略。BGP 导出策略用于允许将静态路由和源自直接连接接口的路由导出到 BGP。
user@PE1# set policy-options policy-statement BGP-export term t1 from protocol direct user@PE1# set policy-options policy-statement BGP-export term t1 then accept user@PE1# set policy-options policy-statement BGP-export term t2 from protocol static user@PE1# set policy-options policy-statement BGP-export term t2 then accept user@PE2# set policy-options policy-statement BGP-export term t1 from protocol direct user@PE2# set policy-options policy-statement BGP-export term t1 then accept user@PE2# set policy-options policy-statement BGP-export term t2 from protocol static user@PE2# set policy-options policy-statement BGP-export term t2 then accept user@PE3# set policy-options policy-statement BGP-export term t1 from protocol direct user@PE3# set policy-options policy-statement BGP-export term t1 then accept user@PE3# set policy-options policy-statement BGP-export term t2 from protocol static user@PE3# set policy-options policy-statement BGP-export term t2 then accept
使用命令验证
show policy BGP-export
是否正确配置了 BGP 导出策略。在 PE 路由器上,配置 CE 到 PE BGP 会话。使用 SONET 接口的 IP 地址作为邻居地址。指定所连接的客户边缘路由器的 VPN 网络的自治系统编号。
user@PE1# set routing-instances green protocols bgp group PE-CE export BGP-export user@PE1# set routing-instances green protocols bgp group PE-CE neighbor 10.0.16.1 peer-as 65001 user@PE2# set routing-instances green protocols bgp group PE-CE export BGP-export user@PE2# set routing-instances green protocols bgp group PE-CE neighbor 10.0.24.2 peer-as 65009 user@PE3# set routing-instances blue protocols bgp group PE-CE export BGP-export user@PE3# set routing-instances blue protocols bgp group PE-CE neighbor 10.0.79.2 peer-as 65003
在客户边缘路由器上,配置 BGP 本地自治系统编号。
user@CE1# set routing-options autonomous-system 65001 user@CE2# set routing-options autonomous-system 65009 user@CE3# set routing-options autonomous-system 65003
在客户边缘路由器上,配置 BGP 导出策略。BGP 导出策略用于允许将静态路由和源自直接连接接口的路由导出到 BGP。
user@CE1# set policy-options policy-statement BGP-export term t1 from protocol direct user@CE1# set policy-options policy-statement BGP-export term t1 then accept user@CE1# set policy-options policy-statement BGP-export term t2 from protocol static user@CE1# set policy-options policy-statement BGP-export term t2 then accept user@CE2# set policy-options policy-statement BGP-export term t1 from protocol direct user@CE2# set policy-options policy-statement BGP-export term t1 then accept user@CE2# set policy-options policy-statement BGP-export term t2 from protocol static user@CE2# set policy-options policy-statement BGP-export term t2 then accept user@CE3# set policy-options policy-statement BGP-export term t1 from protocol direct user@CE3# set policy-options policy-statement BGP-export term t1 then accept user@CE3# set policy-options policy-statement BGP-export term t2 from protocol static user@CE3# set policy-options policy-statement BGP-export term t2 then accept
使用命令验证
show policy BGP-export
是否正确配置了 BGP 导出策略。在客户边缘路由器上,配置 CE 到 PE BGP 会话。使用 SONET 接口的 IP 地址作为邻居地址。指定核心网络的自治系统编号。应用 BGP 导出策略。
user@CE1# set protocols bgp group PE-CE export BGP-export user@CE1# set protocols bgp group PE-CE neighbor 10.0.16.2 peer-as 65000 user@CE2# set protocols bgp group PE-CE export BGP-export user@CE2# set protocols bgp group PE-CE neighbor 10.0.24.1 peer-as 65000 user@CE3# set protocols bgp group PE-CE export BGP-export user@CE3# set protocols bgp group PE-CE neighbor 10.0.79.1 peer-as 65000
在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在 PE 路由器上,使用命令验证
show bgp group pe-ce
BGP 邻居是否形成对等会话。user@PE1> show bgp group pe-ce Group Type: External Local AS: 65000 Name: PE-CE Index: 1 Flags: <> Export: [ BGP-export ] Holdtime: 0 Total peers: 1 Established: 1 10.0.16.1+60500 green.inet.0: 2/3/3/0
验证客户边缘路由器的对等状态是否为
Established
,以及在对等 SONET 接口上配置的 IP 地址是否显示为对等方。
在 PE 路由器上配置 PIM
分步过程
在 PE 路由器上,在每个 VPN 中启用 PIM 实例。
lo0.1
配置、lo0.2
和面向客户的 SONET 和快速以太网接口。将模式指定为sparse
。user@PE1# set routing-instances green protocols pim interface lo0.1 mode sparse user@PE1# set routing-instances green protocols pim interface so-0/0/3.0 mode sparse user@PE1# set routing-instances red protocols pim interface lo0.2 mode sparse user@PE1# set routing-instances red protocols pim interface fe-0/1/0.0 mode sparse user@PE2# set routing-instances green protocols pim interface lo0.1 mode sparse user@PE2# set routing-instances green protocols pim interface so-0/0/1.0 mode sparse user@PE3# set routing-instances blue protocols pim interface lo0.1 mode sparse user@PE3# set routing-instances blue protocols pim interface so-0/0/1.0 mode sparse
在 PE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在 PE 路由器上,使用命令并
show pim interfaces instance green
替换相应的 VRF 实例名称,以验证 PIM 接口是否为up
。user@PE1> show pim interfaces instance green Instance: PIM.green Name Stat Mode IP V State NbrCnt JoinCnt DR address lo0.1 Up Sparse 4 2 DR 0 0 10.10.1.1 lsi.0 Up SparseDense 4 2 P2P 0 0 pe-1/2/0.32769 Up Sparse 4 2 P2P 0 0 so-0/0/3.0 Up Sparse 4 2 P2P 1 2 vt-1/2/0.1 Up SparseDense 4 2 P2P 0 0 lsi.0 Up SparseDense 6 2 P2P 0 0
另请注意,虚拟隧道接口和标签交换接口的正常模式为
SparseDense
。
在客户边缘路由器上配置 PIM
分步过程
在客户边缘路由器上,为 PIM 配置面向客户和面向核心的接口。将模式指定为
sparse
。user@CE1# set protocols pim interface fe-1/3/0.0 mode sparse user@CE1# set protocols pim interface so-0/0/3.0 mode sparse user@CE2# set protocols pim interface fe-0/1/1.0 mode sparse user@CE2# set protocols pim interface so-0/0/1.0 mode sparse user@CE3# set protocols pim interface fe-0/1/0.0 mode sparse user@CE3# set protocols pim interface so-0/0/1.0 mode sparse
使用命令验证
show pim interfaces
PIM 接口是否已配置为使用稀疏模式。在 CE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在客户边缘路由器上,使用命令验证
show pim interfaces
PIM 接口状态是否为up
。user@CE1> show pim interfaces Instance: PIM.master Name Stat Mode IP V State NbrCnt JoinCnt DR address fe-1/3/0.0 Up Sparse 4 2 DR 0 0 10.10.12.1 pe-1/2/0.32769 Up Sparse 4 2 P2P 0 0 so-0/0/3.0 Up Sparse 4 2 P2P 1 1
配置集合点
分步过程
将路由器 PE1 配置为 PIM 的红色 VPN 实例的集合点。指定本地
lo0.2
地址。user@PE1# set routing-instances red protocols pim rp local address 10.2.1.1
将路由器 PE2 配置为 PIM 的绿色 VPN 实例的汇聚点。指定
lo0.1
路由器 PE2 的地址。user@PE2# set routing-instances green protocols pim rp local address 10.10.22.2
将路由器 PE3 配置为 PIM 的蓝色 VPN 实例的集合点。指定本地
lo0.1
.user@PE3# set routing-instances blue protocols pim rp local address 10.3.33.3
在 PE1、CE1 和 CE2 路由器上,为 PIM 的绿色 VPN 实例配置静态集合点。指定
lo0.1
路由器 PE2 的地址。user@PE1# set routing-instances green protocols pim rp static address 10.10.22.2 user@CE1# set protocols pim rp static address 10.10.22.2 user@CE2# set protocols pim rp static address 10.10.22.2
在路由器 CE3 上,为 PIM 的蓝色 VPN 实例配置静态集合点。指定
lo0.1
路由器 PE3 的地址。user@CE3# set protocols pim rp static address 10.3.33.3
在 CE 路由器上,提交配置:
user@host> commit check
configuration check succeeds
user@host> commit
commit complete
在 PE 路由器上,使用
show pim rps instance <instance-name>
命令并替换相应的 VRF 实例名称,以验证是否已正确配置 RP。user@PE1> show pim rps instance <instance-name> Instance: PIM.green Address family INET RP address Type Holdtime Timeout Groups Group prefixes 10.10.22.2 static 0 None 1 224.0.0.0/4 Address family INET6
验证正确的 IP 地址是否显示为 RP。
在客户边缘路由器上,使用命令验证
show pim rps
是否已正确配置 RP。user@CE1> show pim rps Instance: PIM.master Address family INET RP address Type Holdtime Timeout Groups Group prefixes 10.10.22.2 static 0 None 1 224.0.0.0/4 Address family INET6
验证正确的 IP 地址是否显示为 RP。
在路由器 PE1 上,使用命令验证
show route table green.mvpn.0 | find 1
是否已从 PE2 和 PE3 路由器接收到 1 类路由。user@PE1> show route table green.mvpn.0 | find 1 green.mvpn.0: 7 destinations, 9 routes (7 active, 1 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1:192.168.1.1:1:192.168.1.1/240 *[MVPN/70] 03:38:09, metric2 1 Indirect 1:192.168.1.1:2:192.168.1.1/240 *[MVPN/70] 03:38:05, metric2 1 Indirect 1:192.168.2.1:1:192.168.2.1/240 *[BGP/170] 03:12:18, localpref 100, from 192.168.2.1 AS path: I > to 10.0.12.10 via ge-0/3/0.0 1:192.168.7.1:3:192.168.7.1/240 *[BGP/170] 03:12:18, localpref 100, from 192.168.7.1 AS path: I > to 10.0.17.14 via fe-0/1/1.0
在路由器 PE1 上,使用命令验证
show route table green.mvpn.0 | find 5
是否已从路由器 PE2 接收到 5 类路由。对于具有活动成员的每个组,指定路由器 (DR) 会定期发送加入消息和修剪消息到特定于组的集合点 (RP)。当 PIM 路由器获知源时,如果它是上游接口上的 DR,则会发出组播源发现协议 (MSDP) 源地址消息。如果还配置了 MBGP MVPN,则 PE 设备将发起 5 类 MVPN 路由。
user@PE1> show route table green.mvpn.0 | find 5 5:192.168.2.1:1:32:10.10.12.52:32:224.1.1.1/240 *[BGP/170] 03:12:18, localpref 100, from 192.168.2.1 AS path: I > to 10.0.12.10 via ge-0/3/0.0
在路由器 PE1 上,使用命令验证
show route table green.mvpn.0 | find 7
是否已从路由器 PE2 接收到 7 类路由。user@PE1> show route table green.mvpn.0 | find 7 7:192.168.1.1:1:65000:32:10.10.12.52:32:224.1.1.1/240 *[MVPN/70] 03:22:47, metric2 1 Multicast (IPv4) [PIM/105] 03:34:18 Multicast (IPv4) [BGP/170] 03:12:18, localpref 100, from 192.168.2.1 AS path: I > to 10.0.12.10 via ge-0/3/0.0
在路由器 PE1 上,使用命令验证
show route advertising-protocol bgp 192.168.2.1 table green.mvpn.0 detail
路由器 PE2 播发的路由是否使用设置为 RSVP-TE 的 PMSI 属性。user@PE1> show route advertising-protocol bgp 192.168.2.1 table green.mvpn.0 detail green.mvpn.0: 7 destinations, 9 routes (7 active, 1 holddown, 0 hidden) * 1:192.168.1.1:1:192.168.1.1/240 (1 entry, 1 announced) BGP group group-mvpn type Internal Route Distinguisher: 192.168.1.1:1 Nexthop: Self Flags: Nexthop Change Localpref: 100 AS path: [65000] I Communities: target:65000:1 PMSI: Flags 0:RSVP-TE:label[0:0:0]:Session_13[192.168.1.1:0:56822:192.168.1.1]
测试 MVPN 外联网
分步过程
启动连接到路由器 CE2 的组播接收器设备。
启动连接到路由器 CE1 的组播发送器设备。
验证接收方是否收到组播流。
在路由器 PE1 上,使用命令显示
show mvpn c-multicast
提供商隧道到组播组的映射。user@PE1> show mvpn c-multicast MVPN instance: Legend for provider tunnel I-P-tnl -- inclusive provider tunnel S-P-tnl -- selective provider tunnel Legend for c-multicast routes properties (Pr) DS -- derived from (*, c-g) RM -- remote VPN route Instance: green C-mcast IPv4 (S:G) Ptnl St 10.10.12.52/32:224.1.1.1/32 RSVP-TE P2MP:192.168.1.1, 56822,192.168.1.1 RM 0.0.0.0/0:239.255.255.250/32 MVPN instance: Legend for provider tunnel I-P-tnl -- inclusive provider tunnel S-P-tnl -- selective provider tunnel Legend for c-multicast routes properties (Pr) DS -- derived from (*, c-g) RM -- remote VPN route Instance: red C-mcast IPv4 (S:G) Ptnl St 10.10.12.52/32:224.1.1.1/32 DS 0.0.0.0/0:224.1.1.1/32
在路由器 PE2 上,使用命令验证
show route table green.mvpn.0 | find 6
是否已由于接收 PIM 加入消息而创建了类型 6 路由。user@PE2> show route table green.mvpn.0 | find 6 6:192.168.2.1:1:65000:32:10.10.22.2:32:224.1.1.1/240 *[PIM/105] 04:01:23 Multicast (IPv4) 6:192.168.2.1:1:65000:32:10.10.22.2:32:239.255.255.250/240 *[PIM/105] 22:39:46 Multicast (IPv4)
注意:上一步中显示的组播地址 239.255.255.250 与此示例无关。此地址由某些主机发送。
启动连接到路由器 CE3 的组播接收器设备。
验证接收器是否正在接收组播流。
在路由器 PE2 上,使用命令验证
show route table green.mvpn.0 | find 6
是否已创建类型 6 路由,这是从连接到路由器 CE3 的组播接收器设备接收 PIM 加入消息的结果。user@PE2> show route table green.mvpn.0 | find 6 6:192.168.2.1:1:65000:32:10.10.22.2:32:239.255.255.250/240 *[PIM/105] 06:43:39 Multicast (IPv4)
启动直接连接到路由器 PE1 的组播接收器设备。
验证接收器是否正在接收组播流。
在路由器 PE1 上,使用命令验证
show route table green.mvpn.0 | find 6
是否已创建类型 6 路由,这是从直接连接的组播接收器设备接收 PIM 加入消息的结果。user@PE1> show route table green.mvpn.0 | find 6 6:192.168.1.1:2:65000:32:10.2.1.1:32:224.1.1.1/240 *[PIM/105] 00:02:32 Multicast (IPv4) 6:192.168.1.1:2:65000:32:10.2.1.1:32:239.255.255.250/240 *[PIM/105] 00:05:49 Multicast (IPv4)
注意:上述步骤中显示的组播地址 255.255.255.250 与此示例无关。
结果
此示例的配置和验证部分已完成。以下部分供您参考。
路由器 CE1 的相关配置示例如下。
路由器 CE1
interfaces { so-0/0/3 { unit 0 { description "to PE1 so-0/0/3.0"; family inet { address 10.0.16.1/30; } } } fe-1/3/0 { unit 0 { family inet { address 10.10.12.1/24; } } } lo0 { unit 0 { description "CE1 Loopback"; family inet { address 192.168.6.1/32 { primary; } address 127.0.0.1/32; } } } } routing-options { autonomous-system 65001; router-id 192.168.6.1; forwarding-table { export load-balance; } } protocols { bgp { group PE-CE { export BGP-export; neighbor 10.0.16.2 { peer-as 65000; } } } pim { rp { static { address 10.10.22.2; } } interface fe-1/3/0.0 { mode sparse; } interface so-0/0/3.0 { mode sparse; } } } policy-options { policy-statement BGP-export { term t1 { from protocol direct; then accept; } term t2 { from protocol static; then accept; } } policy-statement load-balance { then { load-balance per-packet; } } }
路由器 PE1 的相关配置示例如下。
路由器 PE1
interfaces { so-0/0/3 { unit 0 { description "to CE1 so-0/0/3.0"; family inet { address 10.0.16.2/30; } } } fe-0/1/0 { unit 0 { description "to H2"; family inet { address 10.2.11.2/30; } } } fe-0/1/1 { unit 0 { description "to PE3 fe-0/1/1.0"; family inet { address 10.0.17.13/30; } family mpls; } } ge-0/3/0 { unit 0 { description "to PE2 ge-1/3/0.0"; family inet { address 10.0.12.9/30; } family mpls; } } vt-1/2/0 { unit 1 { description "green VRF multicast vt"; family inet; } unit 2 { description "red VRF unicast and multicast vt"; family inet; } unit 3 { description "blue VRF multicast vt"; family inet; } } lo0 { unit 0 { description "PE1 Loopback"; family inet { address 192.168.1.1/32 { primary; } address 127.0.0.1/32; } } unit 1 { description "green VRF loopback"; family inet { address 10.10.1.1/32; } } unit 2 { description "red VRF loopback"; family inet { address 10.2.1.1/32; } } } } routing-options { autonomous-system 65000; router-id 192.168.1.1; forwarding-table { export load-balance; } } protocols { rsvp { interface ge-0/3/0.0; interface fe-0/1/1.0; interface lo0.0; interface fxp0.0 { disable; } } mpls { interface ge-0/3/0.0; interface fe-0/1/1.0; interface fxp0.0 { disable; } } bgp { group group-mvpn { type internal; local-address 192.168.1.1; family inet-vpn { unicast; } family inet-mvpn { signaling; } neighbor 192.168.2.1; neighbor 192.168.7.1; } } ospf { traffic-engineering; area 0.0.0.0 { interface ge-0/3/0.0 { metric 100; } interface fe-0/1/1.0 { metric 100; } interface lo0.0 { passive; } interface fxp0.0 { disable; } } } ldp { deaggregate; interface ge-0/3/0.0; interface fe-0/1/1.0; interface fxp0.0 { disable; } interface lo0.0; } } policy-options { policy-statement BGP-export { term t1 { from protocol direct; then accept; } term t2 { from protocol static; then accept; } } policy-statement green-red-blue-import { term t1 { from community [ green-com red-com blue-com ]; then accept; } term t2 { then reject; } } policy-statement load-balance { then { load-balance per-packet; } } community green-com members target:65000:1; community red-com members target:65000:2; community blue-com members target:65000:3; } routing-instances { green { instance-type vrf; interface so-0/0/3.0; interface vt-1/2/0.1 { multicast; } interface lo0.1; route-distinguisher 192.168.1.1:1; provider-tunnel { rsvp-te { label-switched-path-template { default-template; } } } vrf-import green-red-blue-import; vrf-target export target:65000:1; vrf-table-label; routing-options { auto-export; } protocols { bgp { group PE-CE { export BGP-export; neighbor 10.0.16.1 { peer-as 65001; } } } pim { rp { static { address 10.10.22.2; } } interface so-0/0/3.0 { mode sparse; } interface lo0.1 {a mode sparse; } } mvpn; } red { instance-type vrf; interface fe-0/1/0.0; interface vt-1/2/0.2; interface lo0.2; route-distinguisher 192.168.1.1:2; provider-tunnel { rsvp-te { label-switched-path-template { default-template; } } } vrf-import green-red-blue-import; vrf-target export target:65000:2; routing-options { auto-export; } protocols { pim { rp { local { address 10.2.1.1; } } interface fe-0/1/0.0 { mode sparse; } interface lo0.2 { mode sparse; } } mvpn; } } }
下面是路由器 PE2 的相关示例配置。
路由器 PE2
interfaces { so-0/0/1 { unit 0 { description "to CE2 so-0/0/1:0.0"; family inet { address 10.0.24.1/30; } } } fe-0/1/3 { unit 0 { description "to PE3 fe-0/1/3.0"; family inet { address 10.0.27.13/30; } family mpls; } vt-1/2/0 { unit 1 { description "green VRF unicast and multicast vt"; family inet; } unit 3 { description "blue VRF unicast and multicast vt"; family inet; } } } ge-1/3/0 { unit 0 { description "to PE1 ge-0/3/0.0"; family inet { address 10.0.12.10/30; } family mpls; } } lo0 { unit 0 { description "PE2 Loopback"; family inet { address 192.168.2.1/32 { primary; } address 127.0.0.1/32; } } unit 1 { description "green VRF loopback"; family inet { address 10.10.22.2/32; } } } routing-options { router-id 192.168.2.1; autonomous-system 65000; forwarding-table { export load-balance; } } protocols { rsvp { interface fe-0/1/3.0; interface ge-1/3/0.0; interface lo0.0; interface fxp0.0 { disable; } } mpls { interface fe-0/1/3.0; interface ge-1/3/0.0; interface fxp0.0 { disable; } } bgp { group group-mvpn { type internal; local-address 192.168.2.1; family inet-vpn { unicast; } family inet-mvpn { signaling; } neighbor 192.168.1.1; neighbor 192.168.7.1; } } ospf { traffic-engineering; area 0.0.0.0 { interface fe-0/1/3.0 { metric 100; } interface ge-1/3/0.0 { metric 100; } interface lo0.0 { passive; } interface fxp0.0 { disable; } } } ldp { deaggregate; interface fe-0/1/3.0; interface ge-1/3/0.0; interface fxp0.0 { disable; } interface lo0.0; } } policy-options { policy-statement BGP-export { term t1 { from protocol direct; then accept; } term t2 { from protocol static; then accept; } } policy-statement green-red-blue-import { term t1 { from community [ green-com red-com blue-com ]; then accept; } term t2 { then reject; } } policy-statement load-balance { then { load-balance per-packet; } } community green-com members target:65000:1; community red-com members target:65000:2; community blue-com members target:65000:3; } routing-instances { green { instance-type vrf; interface so-0/0/1.0; interface vt-1/2/0.1; interface lo0.1; route-distinguisher 192.168.2.1:1; provider-tunnel { rsvp-te { label-switched-path-template { default-template; } } } vrf-import green-red-blue-import; vrf-target export target:65000:1; routing-options { auto-export; } protocols { bgp { group PE-CE { export BGP-export; neighbor 10.0.24.2 { peer-as 65009; } } } pim { rp { local { address 10.10.22.2; } } interface so-0/0/1.0 { mode sparse; } interface lo0.1 { mode sparse; } } mvpn; } } } }
路由器 CE2 的相关配置示例如下。
路由器 CE2
interfaces { fe-0/1/1 { unit 0 { description "to H4"; family inet { address 10.10.11.2/24; } } } so-0/0/1 { unit 0 { description "to PE2 so-0/0/1"; family inet { address 10.0.24.2/30; } } } lo0 { unit 0 { description "CE2 Loopback"; family inet { address 192.168.4.1/32 { primary; } address 127.0.0.1/32; } } } } routing-options { router-id 192.168.4.1; autonomous-system 65009; forwarding-table { export load-balance; } } protocols { bgp { group PE-CE { export BGP-export; neighbor 10.0.24.1 { peer-as 65000; } } } pim { rp { static { address 10.10.22.2; } } interface so-0/0/1.0 { mode sparse; } interface fe-0/1/1.0 { mode sparse; } } } policy-options { policy-statement BGP-export { term t1 { from protocol direct; then accept; } term t2 { from protocol static; then accept; } } policy-statement load-balance { then { load-balance per-packet; } } }
路由器 PE3 的相关配置示例如下。
路由器 PE3
interfaces { so-0/0/1 { unit 0 { description "to CE3 so-0/0/1.0"; family inet { address 10.0.79.1/30; } } } fe-0/1/1 { unit 0 { description "to PE1 fe-0/1/1.0"; family inet { address 10.0.17.14/30; } family mpls; } } fe-0/1/3 { unit 0 { description "to PE2 fe-0/1/3.0"; family inet { address 10.0.27.14/30; } family mpls; } } vt-1/2/0 { unit 3 { description "blue VRF unicast and multicast vt"; family inet; } } lo0 { unit 0 { description "PE3 Loopback"; family inet { address 192.168.7.1/32 { primary; } address 127.0.0.1/32; } } unit 1 { description "blue VRF loopback"; family inet { address 10.3.33.3/32; } } } } routing-options { router-id 192.168.7.1; autonomous-system 65000; forwarding-table { export load-balance; } } protocols { rsvp { interface fe-0/1/3.0; interface fe-0/1/1.0; interface lo0.0; interface fxp0.0 { disable; } } mpls { interface fe-0/1/3.0; interface fe-0/1/1.0; interface fxp0.0 { disable; } } bgp { group group-mvpn { type internal; local-address 192.168.7.1; family inet-vpn { unicast; } family inet-mvpn { signaling; } neighbor 192.168.1.1; neighbor 192.168.2.1; } } ospf { traffic-engineering; area 0.0.0.0 { interface fe-0/1/3.0 { metric 100; } interface fe-0/1/1.0 { metric 100; } interface lo0.0 { passive; } interface fxp0.0 { disable; } } } ldp { deaggregate; interface fe-0/1/3.0; interface fe-0/1/1.0; interface fxp0.0 { disable; } interface lo0.0; } } policy-options { policy-statement BGP-export { term t1 { from protocol direct; then accept; } term t2 { from protocol static; then accept; } } policy-statement green-red-blue-import { term t1 { from community [ green-com red-com blue-com ]; then accept; } term t2 { then reject; } } policy-statement load-balance { then { load-balance per-packet; } } community green-com members target:65000:1; community red-com members target:65000:2; community blue-com members target:65000:3; } routing-instances { blue { instance-type vrf; interface vt-1/2/0.3; interface so-0/0/1.0; interface lo0.1; route-distinguisher 192.168.7.1:3; provider-tunnel { rsvp-te { label-switched-path-template { default-template; } } } vrf-import green-red-blue-import; vrf-target target:65000:3; routing-options { auto-export; } protocols { bgp { group PE-CE { export BGP-export; neighbor 10.0.79.2 { peer-as 65003; } } } pim { rp { local { address 10.3.33.3; } } interface so-0/0/1.0 { mode sparse; } interface lo0.1 { mode sparse; } } mvpn ; } } }
路由器 CE3 的相关配置示例如下。
路由器 CE3
interfaces { so-0/0/1 { unit 0 { description "to PE3"; family inet { address 10.0.79.2/30; } } } fe-0/1/0 { unit 0 { description "to H3"; family inet { address 10.3.11.3/24; } } } lo0 { unit 0 { description "CE3 loopback"; family inet { address 192.168.9.1/32 { primary; } address 127.0.0.1/32; } } } } routing-options { router-id 192.168.9.1; autonomous-system 65003; forwarding-table { export load-balance; } } protocols { bgp { group PE-CE { export BGP-export; neighbor 10.0.79.1 { peer-as 65000; } } } pim { rp { static { address 10.3.33.3; } } interface so-0/0/1.0 { mode sparse; } interface fe-0/1/0.0 { mode sparse; } } } policy-options { policy-statement BGP-export { term t1 { from protocol direct; then accept; } term t2 { from protocol static; then accept; } } policy-statement load-balance { then { load-balance per-packet; } } }