示例:构建从路由器 1 到路由器 3 的 VPLS 以验证标签块
此示例说明了如何为特定配置分配 VPLS 标签块。它分为以下部分:
要求
此配置示例需要三台瞻博网络路由器。
概述和拓扑
在 图 1 所示的网络中,路由器 1 正在建立与路由器 3 的伪线
每个 PE 都会根据路由目标社区过滤 BGP 更新消息中包含的 VPLS NLRI。将导入与路由目标匹配的 VPLS NLRI 实例(在本例中为 8717:2000:2:1)以进行进一步处理。路由器 1 和路由器 3 的 NLRI 如 表 1 所示。
|
路由器 1 向路由器 3 的 NLRI 播发 |
路由器 3 NLRI 通告到路由器 1 |
|---|---|
|
RD - 8717:1000 |
RD - 8717:1000 |
|
VE ID - 1 |
VE ID - 2 |
|
VE 块偏移 - 1 |
VE 块偏移 - 1 |
|
VE 块大小 - 8 |
VE 块大小 - 8 |
|
标签库 - 262161 |
标签库 - 262153 |
要设置到路由器 3 的伪线,路由器 1 必须选择要用于向路由器 3 发送流量的标签,并选择路由器 3 用于向自身发送流量的标签。路由器 3 的 VPLS NLRI 中包含的站点 ID 为 2。
路由器 1 获知同一 VPLS 域中存在站点 ID 2。路由器 1 使用等式 VBO <= 本地站点 ID < (VBO +VBS),检查站点 ID 2 播发的路由是否适合之前播发给路由器 3 的标签块和块偏移。在此示例中,它确实适合,因此站点 ID 2 由路由器 1 播发的 VPLS NLRI 映射,路由器 1 已准备好设置到路由器 3 的伪线。
要选择要到达路由器 3 的标签,路由器 1 会查看路由器 3 播发的标签块并执行计算。PE 路由器用于检查其站点 ID 是否映射到来自远程对等方的标签块中的计算为 VBO <= 本地站点 ID < (VBO +VBS)。因此,路由器 1 选择标签 (262153 + (1 -1)) = 262153 以将流量发送到路由器 3。使用相同的等式,路由器 1 查看其播发的自己的标签块,然后选择标签 (262161 + (2 - 1)) = 262162 以接收来自路由器 3 的流量。路由器 1 可对其转发状态进行编程,以便发往路由器 3 的任何流量都带有伪线标签262153,并且来自路由器 3 的任何流量都应具有伪线标签262162。对从路由器 3 接收的 VPLS NLRI 的操作到此完成。路由器 1 现在已设置到路由器 3 的伪线。
路由器 3 的操作与路由器 1 的操作非常相似。由于路由器 3 站点 ID 2 适合路由器 1 播发的标签块和块偏移量,因此路由器 3 选择标签 (262161 + (2 - 1)) = 262162 以向路由器 1 发送流量。路由器 3 查看其播发的自身标签块,然后选择标签 (262153 + (1 - 1)) = 262153 以接收来自路由器 1 的流量。这样就完成了到路由器 1 的伪线的创建。
默认情况下,对于 VPLS 操作,Junos OS 使用虚拟隧道 (VT) 环路接口来表示伪线。此示例使用标签交换接口 (LSI) 而非 VT 接口,因为 VPLS 控制平面操作没有更改。因此,对于 MX 平台,如果配置了隧道物理接口卡 (PIC),则必须在层次结构级别包含[edit routing-instances routing-instance-name protocols vpls]该no-tunnel-services语句。
配置
以下部分介绍配置和验证 图 1 中示例的步骤。
配置路由器 1
分步程序
-
配置路由器 1.创建
edut路由实例。指定vpls实例类型。配置路由识别符并指定值8717:1000。配置路由目标并指定值8717:100配置 VPLS 协议。指定10为站点范围。指定1为站点 ID。包括该no-tunnel-services语句。[edit routing-instances] edut { instance-type vpls; interface ge-5/0/2.0; route-distinguisher 8717:1000; vrf-target target:8717:100; protocols { vpls { site-range 10; no-tunnel-services; site router-1 { site-identifier 1; } } } }
配置路由器 3
分步程序
-
配置路由器 3.创建
edut路由实例。指定vpls实例类型。配置路由识别符并指定值8717:2000。配置路由目标并指定值8717:200配置 VPLS 协议。指定10为站点范围。指定2为站点 ID。包括该no-tunnel-services语句。[edit routing-instances] edut { instance-type vpls; interface ge-4/0/2.0; route-distinguisher 8717:2000; vrf-target target:8717:100; protocols { vpls { site-range 10; no-tunnel-services; site router-3 { site-identifier 2; } } } }
验证 VPLS 标签分配
分步程序
-
如图和配置所示,站点 A 连接到路由器 1。为站点 A 分配的站点 ID 为 1。路由器 1 需要先分配一个默认标签块,然后才能使用 BGP 更新消息向 VPLS
edut通告其成员资格。在此示例中,路由器 1 分配的标签块的标签库为 262161。由于路由器 1 的站点 ID 为 1,路由器 1 会将分配的标签块与块偏移量 1 相关联。以下消息从路由器 1 发送到路由器 3,并使用命令显示monitor traffic interface interface-name:user@Router1> monitor traffic interface ge-5/3/2 Jun 14 12:26:31.280818 BGP SEND 10.10.10.1+179 -> 10.10.10.3+53950 Jun 14 12:26:31.280824 BGP SEND message type 2 (Update) length 88 Jun 14 12:26:31.280828 BGP SEND flags 0x40 code Origin(1): IGP Jun 14 12:26:31.280833 BGP SEND flags 0x40 code ASPath(2) length 0: <null> Jun 14 12:26:31.280837 BGP SEND flags 0x40 code LocalPref(5): 100 Jun 14 12:26:31.280844 BGP SEND flags 0xc0 code Extended Communities(16): 2:8717:100 800a:19:0:0 Jun 14 12:26:31.280848 BGP SEND flags 0x90 code MP_reach(14): AFI/SAFI 25/65 Jun 14 12:26:31.280853 BGP SEND nhop 10.10.10.1 len 4 Jun 14 12:26:31.280862 BGP SEND 8717:1000:1:1 (label base : 262161 range : 8, ce id: 1, offset: 1) Jun 14 12:26:31.405067 BGP RECV 10.10.10.3+53950 -> 10.10.10.1+179 Jun 14 12:26:31.405074 BGP RECV message type 2 (Update) length 88 Jun 14 12:26:31.405080 BGP RECV flags 0x40 code Origin(1): IGP Jun 14 12:26:31.405085 BGP RECV flags 0x40 code ASPath(2) length 0: <null> Jun 14 12:26:31.405089 BGP RECV flags 0x40 code LocalPref(5): 100 Jun 14 12:26:31.405096 BGP RECV flags 0xc0 code Extended Communities(16): 2:8717:100 800a:19:0:0 Jun 14 12:26:31.405101 BGP RECV flags 0x90 code MP_reach(14): AFI/SAFI 25/65 Jun 14 12:26:31.405106 BGP RECV nhop 10.10.10.3 len 4 Jun 14 12:26:31.405116 BGP RECV 8717:2000:2:1 (label base : 262153 range : 8, ce id: 2, offset: 1)
-
如图和配置所示,站点 B 连接到路由器 3。站点 B 的站点 ID 为 2。路由器 3 可以使用 BGP 更新消息向 VPLS
edut通告其成员资格之前,路由器 3 会分配一个标签库262153为 的默认标签块。此标签块的块偏移量为 1,因为它自己的站点 ID 为 2 适合正在播发的块。以下消息从路由器 3 发送到路由器 1,并使用命令显示monitor traffic interface interface-name:user@Router3> monitor traffic interface ge-2/0/1 Jun 14 12:26:31.282008 BGP SEND 10.10.10.3+53950 -> 10.10.10.1+179 Jun 14 12:26:31.282018 BGP SEND message type 2 (Update) length 88 Jun 14 12:26:31.282026 BGP SEND flags 0x40 code Origin(1): IGP Jun 14 12:26:31.282034 BGP SEND flags 0x40 code ASPath(2) length 0: <null> Jun 14 12:26:31.282041 BGP SEND flags 0x40 code LocalPref(5): 100 Jun 14 12:26:31.282052 BGP SEND flags 0xc0 code Extended Communities(16): 2:8717:100 800a:19:0:0 Jun 14 12:26:31.282078 BGP SEND flags 0x90 code MP_reach(14): AFI/SAFI 25/65 Jun 14 12:26:31.282088 BGP SEND nhop 10.10.10.3 len 4 Jun 14 12:26:31.282102 BGP SEND 8717:2000:2:1 (label base : 262153 range : 8, ce id: 2, offset: 1) Jun 14 12:26:31.283395 BGP RECV 10.10.10.1+179 -> 10.10.10.3+53950 Jun 14 12:26:31.283405 BGP RECV message type 2 (Update) length 88 Jun 14 12:26:31.283412 BGP RECV flags 0x40 code Origin(1): IGP Jun 14 12:26:31.283419 BGP RECV flags 0x40 code ASPath(2) length 0: <null> Jun 14 12:26:31.283426 BGP RECV flags 0x40 code LocalPref(5): 100 Jun 14 12:26:31.283435 BGP RECV flags 0xc0 code Extended Communities(16): 2:8717:100 800a:19:0:0 Jun 14 12:26:31.283443 BGP RECV flags 0x90 code MP_reach(14): AFI/SAFI 25/65 Jun 14 12:26:31.283471 BGP RECV nhop 10.10.10.1 len 4 Jun 14 12:26:31.283486 BGP RECV 8717:1000:1:1 (label base : 262161 range : 8, ce id: 1, offset: 1)
-
使用
show vpls connections命令验证路由器 1 的连接状态消息。请注意,基本标签是262161,从路由器 3 传入标签是262162,到路由器 3 的传出标签是262153。user@Router1> show vpls connections instance edut extensive Instance: edut Local site: router-1 (1) Number of local interfaces: 1 Number of local interfaces up: 1 IRB interface present: no ge-5/0/2.0 lsi.1049600 2 Intf - vpls edut local site 1 remote site 2 Label-base Offset Range Preference 262161 1 8 100 connection-site Type St Time last up # Up trans 2 rmt Up Jun 14 12:26:31 2009 1 Remote PE: 10.10.10.3, Negotiated control-word: No Incoming label: 262162, Outgoing label: 262153 Local interface: lsi.1049600, Status: Up, Encapsulation: VPLS Description: Intf - vpls edut local site 1 remote site 2 Connection History: Jun 14 12:26:31 2009 status update timer Jun 14 12:26:31 2009 loc intf up lsi.1049600 Jun 14 12:26:31 2009 PE route changed Jun 14 12:26:31 2009 Out lbl Update 262153 Jun 14 12:26:31 2009 In lbl Update 262162 Jun 14 12:26:31 2009 loc intf down Layer-2 VPN connections: Legend for connection status (St) EI -- encapsulation invalid NC -- interface encapsulation not CCC/TCC/VPLS EM -- encapsulation mismatch WE -- interface and instance encaps not same VC-Dn -- Virtual circuit down NP -- interface hardware not present CM -- control-word mismatch -< -- only outbound connection is up CN -- circuit not provisioned >- -- only inbound connection is up OR -- out of range Up -- operational OL -- no outgoing label Dn -- down LD -- local site signaled down CF -- call admission control failure RD -- remote site signaled down SC -- local and remote site ID collision LN -- local site not designated LM -- local site ID not minimum designated RN -- remote site not designated RM -- remote site ID not minimum designated XX -- unknown connection status IL -- no incoming label MM -- MTU mismatch MI -- Mesh-Group ID not availble BK -- Backup connection ST -- Standby connection PF -- Profile parse failure PB -- Profile busy Legend for interface status Up -- operational Dn -- down -
使用
show vpls connections命令验证路由器 3 的连接状态消息。请注意,基本标签是262153,从路由器 1 传入标签是262153,到路由器 1 的传出标签是262162。user@Router3> show vpls connections instance edut extensive Instance: edut Local site: router-3 (2) Number of local interfaces: 1 Number of local interfaces up: 1 IRB interface present: no ge-4/0/2.0 lsi.1050368 1 Intf - vpls edut local site 2 remote site 1 Label-base Offset Range Preference 262153 1 8 100 connection-site Type St Time last up # Up trans 1 rmt Up Jun 14 12:26:31 2009 1 Remote PE: 10.10.10.1, Negotiated control-word: No Incoming label: 262153, Outgoing label: 262162 Local interface: lsi.1050368, Status: Up, Encapsulation: VPLS Description: Intf - vpls edut local site 2 remote site 1 Connection History: Jun 14 12:26:31 2009 status update timer Jun 14 12:26:31 2009 loc intf up lsi.1050368 Jun 14 12:26:31 2009 PE route changed Jun 14 12:26:31 2009 Out lbl Update 262162 Jun 14 12:26:31 2009 In lbl Update 262153 Jun 14 12:26:31 2009 loc intf down Layer-2 VPN connections: Legend for connection status (St) EI -- encapsulation invalid NC -- interface encapsulation not CCC/TCC/VPLS EM -- encapsulation mismatch WE -- interface and instance encaps not same VC-Dn -- Virtual circuit down NP -- interface hardware not present CM -- control-word mismatch -< -- only outbound connection is up CN -- circuit not provisioned >- -- only inbound connection is up OR -- out of range Up -- operational OL -- no outgoing label Dn -- down LD -- local site signaled down CF -- call admission control failure RD -- remote site signaled down SC -- local and remote site ID collision LN -- local site not designated LM -- local site ID not minimum designated RN -- remote site not designated RM -- remote site ID not minimum designated XX -- unknown connection status IL -- no incoming label MM -- MTU mismatch MI -- Mesh-Group ID not availble BK -- Backup connection ST -- Standby connection PF -- Profile parse failure PB -- Profile busy Legend for interface status Up -- operational Dn -- down