示例:VPLS 配置(BGP 信令)
在图 1 中,在路由器 PE1 和 PE2 之间启用了简单的 VPLS 拓扑。客户边缘路由器 CE1 和 CE2 使用基于以太网的接口将 VLAN 600 连接到其本地 PE 路由器 。PE 路由器 PE1 和 PE2 通过运行 MPLS、BGP、RSVP 和 OSPF 的服务提供商骨干网中启用的 LSP 相互连接。
在名为 green的 VPLS 路由实例中,PE1 具有本地接口fe-0/1/0 和虚拟端口(vt-0/3/0.32770配置 VPLS 时,虚拟端口将在隧道服务 PIC 上动态创建)。PE2 在同一实例中green具有本地接口fe-0/1/0和虚拟vt-0/3/0.32771端口。因此,路由器 CE1 和 CE2 相互发送以太网流量,就像它们在 LAN 上物理连接一样。
在路由器 CE1 上,您唯一需要配置的是连接到 PE1 的快速以太网接口。请务必记下 VLAN 标识符和 IP 地址,以便稍后在 CE2 上匹配它们。
路由器 CE1
[edit]
interfaces {
fe-0/1/0 {
vlan-tagging; # Configure VLAN tagging for VLAN VPLS or extended VLAN VPLS.
unit 0 {
vlan-id 600; # The Ethernet interface on CE2 must use the same VLAN ID.
family inet {
address 10.11.3.1/24; # The interface on CE2 must use the same prefix.
}
}
}
}
如果路由器 PE1 是 MX 系列设备,则需要配置隧道服务接口。
要在 MX 系列路由器上创建隧道接口,请在 [edit chassis fpc slot-number pic number] 层次结构级别包含tunnel-services语句。要配置隧道接口的带宽,请在 [edit chassis fpc slot-number pic number tunnel services] 层次结构级别包含bandwidth语句。
以下示例显示了在 MX 系列路由器插槽 0 中安装的 DPC 的 PFE 3 上配置了 1 Gbps 带宽的隧道接口:
[edit chassis]
fpc 0 {
pic 3 {
tunnel services {
bandwidth 1g;
}
}
}
在路由器 PE1 上,通过配置 BGP、MPLS、OSPF 和 RSVP 为 VPLS 准备路由器。(这些协议是大多数第 2 层 VPN 相关应用程序(包括 VPLS)的基础。在层次结构级别包含语句signaling [edit protocols bgp group group-name family l2vpn],因为 VPLS 对内部 BGP 使用与第 2 层 VPN 相同的基础架构。
在 Junos OS 7.3 版及更高版本中,该 signaling 语句将替换 unicast 层次结构级别的语句 [edit protocols bgp group group-name family l2vpn] 。如果您希望同时配置 VPLS 域和第 2 层 VPN,则必须使用该 signaling 语句。
接下来,在连接到路由器 CE1 的快速以太网接口上配置 VLAN 标记。在物理和逻辑接口级别包括 VLAN VPLS 封装。请务必对属于单个 VPLS 实例的所有以太网接口使用相同的 VLAN ID。最后,将快速以太网接口添加到 VPLS 路由实例中,并指定站点范围、站点 ID 号和站点名称。
路由器 PE1
[edit]
interfaces {
fe-0/1/0 {
vlan-tagging;# Configure VLAN tagging for VLAN VPLS or extended VLAN VPLS.
encapsulation vlan-vpls; # Configure VPLS encapsulation on both the
unit 0 { # physical interface and the logical interface.
encapsulation vlan-vpls;
vlan-id 600;# The VLAN ID is the same one used by the CE routers.
}
}
so-1/1/0 {
unit 0 {
family inet {
address 10.11.1.5/30;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.245.14.218/32;
}
}
}
}
routing-options {
autonomous-system 69;
forwarding-table {
export exp-to-fwd; # Apply a policy that selects an LSP for the VPLS instance.
}
}
protocols {
rsvp {
interface all {
aggregate;
}
}
mpls {
label-switched-path pe1-to-pe2 { # Configure an LSP to reach other VPLS PEs.
to 10.245.14.219;
}
interface all;
}
bgp {
group vpls-pe {
type internal;
local-address 10.245.14.218;
family l2vpn { # VPLS uses the same infrastructure as Layer 2 VPNs
signaling; # for internal BGP.
}
neighbor 10.245.14.217;
neighbor 10.245.14.219;
}
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface so-1/1/0.0 {
metric 11;
}
interface lo0.0 {
passive;
}
}
}
}
policy-options {
policy-statement exp-to-fwd {
term a {
from community grn-com; # Matches the community in the VPLS instance.
then {
install-nexthop lsp pe1-to-pe2; # If there are multiple LSPs that exist
accept; # between VPLS PE routers, this statement sends VPLS traffic
} # over a specific LSP.
}
}
community grn-com members target:11111:1; # Adds the instance to a BGP
} # community.
routing-instances {
green {
instance-type vpls; # Configure a VPLS routing instance.
interface fe-0/1/0.0;
route-distinguisher 10.245.14.218:1;
vrf-target target:11111:1; # This value is important to the BGP community.
protocols {
vpls { # Configure a VPLS site range, site name, and site identifier.
site-range 10;
site greenPE1 {
site-identifier 1;
}
}
}
}
}
在路由器 P0 上,配置 BGP、MPLS、OSPF 和 RSVP 以互连 PE1 和 PE2。
路由器 P0
[edit]
interfaces {
so-0/0/0 {
unit 0 {
family inet {
address 10.11.2.6/30;
}
family mpls;
}
}
so-1/1/0 {
unit 0 {
family inet {
address 10.11.1.6/30;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.245.14.217/32;
}
}
}
}
routing-options {
autonomous-system 69;
}
protocols {
rsvp {
interface all {
aggregate;
}
}
mpls {
interface all;
}
bgp {
group vpls-pe {
type internal;
local-address 10.245.14.217;
family l2vpn { # VPLS uses the same infrastructure as Layer 2 VPNs
signaling; # for internal BGP.
}
neighbor 10.245.14.218;
neighbor 10.245.14.219;
}
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface so-1/1/0.0 {
metric 11;
}
interface so-0/0/0.0 {
metric 15;
}
interface lo0.0 {
passive;
}
}
}
}
如果路由器 PE2 是 MX 系列设备,则需要配置隧道服务接口。
要在 MX 系列路由器上创建隧道接口,请在 [edit chassis fpc slot-number pic number] 层次结构级别包含tunnel-services语句。要配置隧道接口的带宽,请在 [edit chassis fpc slot-number pic number] 层次结构级别包含bandwidth语句。
以下示例显示了在 MX 系列路由器插槽 0 中安装的 DPC 的 PFE 3 上配置了 1 Gbps 带宽的隧道接口:
[edit chassis]
fpc 0 {
pic 3 {
tunnel services {
bandwidth 1g;
}
}
}
在路由器 PE2 上,配置 BGP、MPLS、OSPF 和 RSVP 以补充 PE1 上的配置。接下来,在连接到路由器 CE2 的快速以太网接口上配置 VLAN 标记。在物理和逻辑接口级别包括 VLAN VPLS 封装。请务必对属于单个 VPLS 实例的所有以太网接口使用相同的 VLAN ID。最后,将快速以太网接口添加到 VPLS 路由实例中,并指定站点范围、站点 ID 号和站点名称。
路由器 PE2
[edit]
interfaces {
fe-0/1/0 {
vlan-tagging; # Configure VLAN tagging for VLAN VPLS or extended VLAN VPLS.
encapsulation vlan-vpls; # Configure VPLS encapsulation on both the
unit 0 { # physical interface and logical interface.
encapsulation vlan-vpls;
vlan-id 600;# The VLAN ID is the same one used by the CE routers.
}
}
so-0/0/0 {
unit 0 {
family inet {
address 10.11.2.5/30;
}
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 10.245.14.219/32;
}
}
}
}
routing-options {
autonomous-system 69;
forwarding-table {
export exp-to-fwd; # Apply a policy that selects an LSP for the VPLS instance.
}
}
protocols {
rsvp {
interface all {
aggregate;
}
}
mpls {
label-switched-path pe2-to-pe1 { # Configure an LSP to other VPLS PE routers.
to 10.245.14.218;
}
interface all;
}
bgp {
group vpls-pe {
type internal;
local-address 10.245.14.219;
family l2vpn { # VPLS uses the same infrastructure as Layer 2 VPNs
signaling; # for internal BGP.
}
neighbor 10.245.14.217;
neighbor 10.245.14.218;
}
}
ospf {
traffic-engineering;
area 0.0.0.0 {
interface so-0/0/0.0 {
metric 15;
}
interface lo0.0 {
passive;
}
}
}
}
policy-options {
policy-statement exp-to-fwd {
term a {
from community grn-com; # Matches the community with the VPLS instance.
then {
install-nexthop lsp pe2-to-pe1; # If there are multiple LSPs that exist
accept; # between VPLS PE routers, this statement sends VPLS traffic
} # over a specific LSP.
}
}
community grn-com members target:11111:1; # This adds the instance into a BGP community.
}
routing-instances {
green {
instance-type vpls; # Configure a VPLS routing instance.
interface fe-0/1/0.0;
route-distinguisher 10.245.14.219:1;
vrf-target target:11111:1; # This value is important for the BGP community.
protocols {
vpls { # Configure a VPLS site range, site name, and site identifier.
site-range 10;
site greenPE2 {
site-identifier 2;
}
}
}
}
}
在路由器 CE2 上,通过配置连接到 PE2 的快速以太网接口来完成您的 VPLS 网络。使用路由器 CE1 上使用的相同 VLAN 标识符和 IP 地址前缀。
路由器 CE2
[edit]
interfaces {
fe-0/1/0 {
vlan-tagging; # Configure VLAN tagging for VLAN VPLS or extended VLAN VPLS.
unit 0 {
vlan-id 600; # The Ethernet interface on CE1 must use the same VLAN ID.
family inet {
address 10.11.3.2/24; # The interface on CE1 must use the same prefix.
}
}
}
}
验证您的工作
要验证 VPLS 的正常运行,请使用以下命令:
clear vpls mac-address instance instance-nameshow interfaces terseshow route forwarding-table family mplsshow route forwarding-table family vpls (destination | extensive | matching | table)show route instance (detail)show system statistics vplsshow vpls connectionsshow vpls statistics
以下部分显示了作为配置示例结果的路由器 PE1 上这些命令的输出:
user@PE1> show interfaces terse
Interface Admin Link Proto Local Remote
so-1/1/0 up up
so-1/1/0.0 up up inet 10.11.1.5/30
mpls
so-1/1/1 up up
so-1/1/2 up up
so-1/1/3 up up
fe-0/1/0 up up
fe-0/1/0.0 up up vpls # This is the local Fast Ethernet
# interface.
fe-0/1/1 up up
fe-0/1/2 up up
fe-0/1/3 up up
gr-0/3/0 up up
ip-0/3/0 up up
mt-0/3/0 up up
pd-0/3/0 up up
pe-0/3/0 up up
vt-0/3/0 up up
vt-0/3/0.32770 up up # This is the dynamically generated virtual port.
dsc up up
fxp0 up up
fxp0.0 up up inet 192.186.14.218/24
fxp1 up up
fxp1.0 up up tnp 4
gre up up
ipip up up
lo0 up up
lo0.0 up up inet 10.245.14.218 --> 0/0
127.0.0.1 --> 0/0
inet6 fe80::2a0:a5ff:fe28:13e0
feee::10:245:14:218
lsi up up
mtun up up
pimd up up
pime up up
tap up up
user@PE1> show system statistics vpls
vpls:
0 total packets received
0 with size smaller than minimum
0 with incorrect version number
0 packets for this host
0 packets with no logical interface
0 packets with no family
0 packets with no route table
0 packets with no auxiliary table
0 packets with no corefacing entry
0 packets with no CE-facing entry
6 mac route learning requests # This indicates that VPLS is working.
6 mac routes learnt
0 mac routes aged
0 mac routes moved
要显示 VPLS 源和目标 MAC 地址记帐信息,请通过命令使用 destinationshow route forwarding-table family vpls 、 extensive、 matching或 table 选项。分析显示输出时,请记住以下几点:
VPLS MAC 地址计费基于每个 VPLS 实例的每个 MAC 地址进行处理。所有信息都从 MAC 地址表中的 MAC 地址条目中检索。VPLS MAC 地址记帐仅在本地客户边缘路由器上执行。
源和目标 MAC 地址的 VPLS 计数器会持续递增,直到从内存缓冲区中删除最早的 MAC 地址条目(当条目超时或重新启动 VPLS 实例时)。
user@PE1> show route forwarding-table family vpls extensive Routing table: green.vpls [Index 2] VPLS: Destination: default Route type: dynamic Route reference: 0 Flags: sent to PFE Next-hop type: flood Index: 353 Reference: 1 Destination: default Route type: permanent Route reference: 0 Flags: none Next-hop type: discard Index: 298 Reference: 1 Destination: fe-0/1/0.0 Route type: dynamic Route reference: 0 Flags: sent to PFE Next-hop type: flood Index: 355 Reference: 1 Destination: bb:bb:bb:bb:bb:bb/48 # This MAC address belongs to remote CE2. Route type: dynamic Route reference: 0 Flags: sent to PFE, prefix load balance Next-hop type: indirect Index: 351 Reference: 4 Next-hop type: Push 800000, Push 100002(top) Next-hop interface: so-1/1/0.0 Destination: aa:aa:aa:aa:aa:aa/48 # This MAC address belongs to local CE1. Route type: dynamic Route reference: 0 Flags: sent to PFE, prefix load balance Next-hop type: unicast Index: 354 Reference: 2 Next-hop interface: fe-0/1/0.0 user@PE1> show route forwarding-table family vpls Routing table: green.vpls VPLS: Destination Type RtRef Next hop Type Index NhRef Netif default dynm 0 flood 353 1 default perm 0 dscd 298 1 fe-0/1/0.0 dynm 0 flood 355 1 bb:bb:bb:bb:bb:bb/48 # This MAC address belongs to remote CE2. dynm 0 indr 351 4 Push 800000, Push 100002(top) so-1/1/0.0 aa:aa:aa:aa:aa:aa/48 # This MAC address belongs to local CE1. dynm 0 ucst 354 2 fe-0/1/0.0 user@PE1> show route forwarding-table family mpls Routing table: mpls MPLS: Destination Type RtRef Next hop Type Index NhRef Netif default perm 0 dscd 19 1 0 user 0 recv 18 3 1 user 0 recv 18 3 2 user 0 recv 18 3 100000 user 0 10.11.1.6 swap 100001 so-1/1/0.0 800002 user 0 Pop vt-0/3/0.32770 vt-0/3/0.32770 (VPLS) user 0 indr 351 4 Push 800000, Push 100002(top) so-1/1/0.0 user@PE1> show route instance green detail green: Router ID: 0.0.0.0 Type: vpls State: Active Interfaces: fe-0/1/0.0 # This is the local Fast Ethernet interface. vt-0/3/0.32770 # This is the dynamically generated VPLS virtual port. Route-distinguisher: 10.245.14.218:1 Vrf-import: [ __vrf-import-green-internal__ ] Vrf-export: [ __vrf-export-green-internal__ ] Vrf-import-target: [ target:11111:1 ] Vrf-export-target: [ target:11111:1 ] Tables: green.l2vpn.0 : 2 routes (2 active, 0 holddown, 0 hidden) user@PE1> show vpls connections L2VPN Connections: Legend for connection status (St) OR -- out of range WE -- intf encaps != instance encaps EI -- encapsulation invalid Dn -- down EM -- encapsulation mismatch VC-Dn -- Virtual circuit down CM -- control-word mismatch -> -- only outbound conn is up CN -- circuit not present <- -- only inbound conn is up OL -- no outgoing label Up -- operational NC -- intf encaps not CCC/TCC XX -- unknown NP -- interface not present Legend for interface status Up -- operational Dn -- down Instance: green Local site: greenPE1 (1) connection-site Type St Time last up # Up trans 2 rmt Up Jan 24 06:26:49 2003 1 Local interface: vt-0/3/0.32770, Status: Up, Encapsulation: VPLS Remote PE: 10.245.14.219, Negotiated control-word: No Incoming label: 800002, Outgoing label: 800000 user@PE1> show system statistics vpls vpls: 0 total packets received 0 with size smaller than minimum 0 with incorrect version number 0 packets for this host 0 packets with no logical interface 0 packets with no family 0 packets with no route table 0 packets with no auxiliary table 0 packets with no corefacing entry 0 packets with no CE-facing entry 7 mac route learning requests 7 mac routes learnt 0 mac routes aged 0 mac routes moved user@PE1> show route instance green detail green: Router ID: 0.0.0.0 Type: vpls State: Active Interfaces: fe-0/1/0.0 vt-0/3/0.32770 Route-distinguisher: 10.245.14.218:1 Vrf-import: [ __vrf-import-green-internal__ ] Vrf-export: [ __vrf-export-green-internal__ ] Vrf-import-target: [ target:11111:1 ] Vrf-export-target: [ target:11111:1 ] Tables: green.l2vpn.0 : 2 routes (2 active, 0 holddown, 0 hidden) user@PE1> show vpls statistics Layer-2 VPN Statistics: Instance: green Local interface: fe-0/1/0.0, Index: 351 Remote provider edge router: 10.245.14.219 Multicast packets: 363 Multicast bytes : 30956 Flood packets : 0 Flood bytes : 0 Local interface: vt-0/3/0.32770, Index: 354 Remote provider edge router: 10.245.14.219 Multicast packets: 135 Multicast bytes : 12014 Flood packets : 135 Flood bytes : 12014
要从 VPLS 表中清除 VPLS 实例的所有 MAC 地址条目,请发出 clear vpls mac-address instance instance-name 命令。 logical-system logical-system-name 添加用于清除逻辑系统中 VPLS 实例中条目的选项。使用该 mac-address 选项删除单个 MAC 地址。