配置Kompella方式VPLS over TE示例
组网需求
如图6-35,某企业机构,自建骨干网。分支site站点较多(举例中只列出2个站点,其余省略),同时PE间支持建立MPLS TE隧道。分支Site1使用CE1连接PE1设备接入骨干网,分支Site2使用CE2连接PE2接入骨干网。现在Site1和Site2的用户需要进行二层业务的互通,同时要求在穿越骨干网时保留二层报文中用户信息。
配置思路
采用如下的思路配置Kompella方式VPLS over TE:
为实现Site1和Site2的二层业务互通,同时在穿越骨干网时保留二层报文的用户信息,故需要使用VPLS技术在骨干网透传二层报文。
由于企业site站点较多且网络环境经常发生变动,可以选择Kompella方式的VPLS,实现各CE设备二层网络的互通。
为实现PE间数据的公网传输,需要在骨干网上配置IGP路由协议实现互通。
VPLS实现依靠MPLS基本功能,故需要在骨干网上的设备配置MPLS基本功能。
为使PE间传输的数据不被公网感知,需要在PE间建立TE隧道。
为实现VPLS功能,需要在PE上使能MPLS L2VPN。
为实现MPLS TE隧道承载VPLS业务,需要在PE上配置相应的隧道策略并在VSI中引用。
为实现Kompella方式VPLS,需要在PE上使能BGP对等体交换VPLS信息的能力,同时在PE上创建VSI,指定信令为BGP,指定RD、VPN-Target和Site,再将AC接口与VSI进行绑定。
操作步骤
- 配置接口所属的VLAN
# 配置PE1。P、PE2、CE1和CE2的配置与PE1类似,不再赘述。
<HUAWEI> system-view [HUAWEI] sysname PE1 [PE1] vlan batch 10 20 [PE1] interface vlanif 20 [PE1-Vlanif20] ip address 100.1.1.1 255.255.255.0 [PE1-Vlanif20] quit [PE1] interface gigabitethernet 1/0/0 [PE1-GigabitEthernet1/0/0] port link-type trunk [PE1-GigabitEthernet1/0/0] port trunk allow-pass vlan 20 [PE1-GigabitEthernet1/0/0] quit [PE1] interface gigabitethernet 2/0/0 [PE1-GigabitEthernet2/0/0] port link-type trunk [PE1-GigabitEthernet2/0/0] port trunk allow-pass vlan 10 [PE1-GigabitEthernet2/0/0] quit
- 配置IGP,本例中使用OSPF
配置OSPF时,注意需要发布PE1、P和PE2的32位Loopback接口地址(LSR-ID)。
在PE1、P和PE2上配置OSPF。
#配置PE1。P和PE2的配置与PE1类似,不再赘述。
[PE1] interface loopback 1 [PE1-LoopBack1] ip address 1.1.1.9 255.255.255.255 [PE1-LoopBack1] quit [PE1] ospf 1 [PE1-ospf-1] area 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.255 [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
配置完成后,在PE1、P和PE2上执行display ip routing-table命令可以看到已学到彼此的路由。
- 使能MPLS、MPLS TE、MPLS RSVP-TE及MPLS TE CSPF
在隧道沿途各节点的系统视图及接口视图下使能MPLS、MPLS TE和MPLS RSVP-TE,并在隧道入节点使能MPLS TE CSPF。
# 配置PE1。
[PE1] mpls lsr-id 1.1.1.9 [PE1] mpls [PE1-mpls] mpls te [PE1-mpls] mpls rsvp-te [PE1-mpls] mpls te cspf [PE1-mpls] quit [PE1] interface vlanif 20 [PE1-Vlanif20] mpls [PE1-Vlanif20] mpls te [PE1-Vlanif20] mpls rsvp-te [PE1-Vlanif20] quit
# 配置P。
[P] mpls lsr-id 2.2.2.9 [P] mpls [P-mpls] mpls te [P-mpls] mpls rsvp-te [P-mpls] quit [P] interface vlanif 20 [P-Vlanif20] mpls [P-Vlanif20] mpls te [P-Vlanif20] mpls rsvp-te [P-Vlanif20] quit [P] interface vlanif 30 [P-Vlanif30] mpls [P-Vlanif30] mpls te [P-Vlanif30] mpls rsvp-te [P-Vlanif30] quit
# 配置PE2。
[PE2] mpls lsr-id 3.3.3.9 [PE2] mpls [PE2-mpls] mpls te [PE2-mpls] mpls rsvp-te [PE2-mpls] mpls te cspf [PE2-mpls] quit [PE2] interface vlanif 30 [PE2-Vlanif30] mpls [PE2-Vlanif30] mpls te [PE2-Vlanif30] mpls rsvp-te [PE2-Vlanif30] quit
- 在骨干网上配置OSPF TE
# 配置PE1。
[PE1] ospf [PE1-ospf-1] opaque-capability enable [PE1-ospf-1] area 0.0.0.0 [PE1-ospf-1-area-0.0.0.0] mpls-te enable [PE1-ospf-1-area-0.0.0.0] quit [PE1-ospf-1] quit
# 配置P。
[P] ospf [P-ospf-1] opaque-capability enable [P-ospf-1] area 0.0.0.0 [P-ospf-1-area-0.0.0.0] mpls-te enable [P-ospf-1-area-0.0.0.0] quit [P-ospf-1] quit
# 配置PE2。
[PE2] ospf [PE2-ospf-1] opaque-capability enable [PE2-ospf-1] area 0.0.0.0 [PE2-ospf-1-area-0.0.0.0] mpls-te enable [PE2-ospf-1-area-0.0.0.0] quit [PE2-ospf-1] quit
- 配置Tunnel接口
# 在PE上创建Tunnel接口,指定隧道协议为MPLS TE,信令协议为RSVP-TE。
# 配置PE1。
[PE1] interface tunnel 1 [PE1-Tunnel1] ip address unnumbered interface loopback 1 [PE1-Tunnel1] tunnel-protocol mpls te [PE1-Tunnel1] destination 3.3.3.9 [PE1-Tunnel1] mpls te tunnel-id 100 [PE1-Tunnel1] mpls te reserved-for-binding [PE1-Tunnel1] mpls te commit [PE1-Tunnel1] quit
# 配置PE2。
[PE2] interface tunnel 1 [PE2-Tunnel1] ip address unnumbered interface loopback 1 [PE2-Tunnel1] tunnel-protocol mpls te [PE2-Tunnel1] destination 1.1.1.9 [PE2-Tunnel1] mpls te tunnel-id 100 [PE2-Tunnel1] mpls te reserved-for-binding [PE2-Tunnel1] mpls te commit [PE2-Tunnel1] quit
配置完此步骤后,在隧道接口视图下执行display this interface命令,可以看见MPLS TE隧道已建立成功,即显示结果中“Line protocol current state”对应值为“UP”。
在系统视图下执行display tunnel-info all命令,可以看到PE之间存在目的地址为对方MPLS LSR ID的TE隧道。以PE1的显示为例。
[PE1] display tunnel-info all * -> Allocated VC Token Tunnel ID Type Destination Token ---------------------------------------------------------------------- 0x4 cr lsp 3.3.3.9 109 0x5 lsp 3.3.3.9 110
- 建立BGP对等体,使能交换VPLS信息的能力
# 配置PE1。
[PE1] bgp 100 [PE1-bgp] peer 3.3.3.9 as-number 100 [PE1-bgp] peer 3.3.3.9 connect-interface loopback 1 [PE1-bgp] vpls-family [PE1-bgp-af-vpls] peer 3.3.3.9 enable [PE1-bgp-af-vpls] quit [PE1-bgp] quit
# 配置PE2。
[PE2] bgp 100 [PE2-bgp] peer 1.1.1.9 as-number 100 [PE2-bgp] peer 1.1.1.9 connect-interface loopback 1 [PE2-bgp] vpls-family [PE2-bgp-af-vpls] peer 1.1.1.9 enable [PE2-bgp-af-vpls] quit [PE2-bgp] quit
- 配置隧道策略
# 配置PE1。
[PE1] tunnel-policy policy1 [PE1-tunnel-policy-policy1] tunnel binding destination 3.3.3.9 te tunnel 1 [PE1-tunnel-policy-policy1] quit
# 配置PE2。
[PE2] tunnel-policy policy1 [PE2-tunnel-policy-policy1] tunnel binding destination 1.1.1.9 te tunnel 1 [PE2-tunnel-policy-policy1] quit
- 在PE上使能MPLS L2VPN
# 配置PE1。
[PE1] mpls l2vpn [PE1-l2vpn] quit
# 配置PE2。
[PE2] mpls l2vpn [PE2-l2vpn] quit
- 在PE上创建VSI,并配置隧道策略。
VSI两端的Site ID不能设置成相同。
# 配置PE1。
[PE1] vsi bgp1 auto [PE1-vsi-bgp1] pwsignal bgp [PE1-vsi-bgp1-bgp] route-distinguisher 100.1.1.1:1 [PE1-vsi-bgp1-bgp] vpn-target 100:1 import-extcommunity [PE1-vsi-bgp1-bgp] vpn-target 100:1 export-extcommunity [PE1-vsi-bgp1-bgp] site 1 range 5 default-offset 0 [PE1-vsi-bgp1-bgp] quit [PE1-vsi-bgp1] tnl-policy policy1 [PE1-vsi-bgp1] quit
# 配置PE2。
[PE2] vsi bgp1 auto [PE2-vsi-bgp1] pwsignal bgp [PE2-vsi-bgp1-bgp] route-distinguisher 100.2.1.2:1 [PE2-vsi-bgp1-bgp] vpn-target 100:1 import-extcommunity [PE2-vsi-bgp1-bgp] vpn-target 100:1 export-extcommunity [PE2-vsi-bgp1-bgp] site 2 range 5 default-offset 0 [PE2-vsi-bgp1-bgp] quit [PE2-vsi-bgp1] tnl-policy policy1 [PE2-vsi-bgp1] quit
- 在PE上配置VSI与接口的绑定
# 配置PE1。
[PE1] interface vlanif 10 [PE1-Vlanif10] l2 binding vsi bgp1 [PE1-Vlanif10] quit
# 配置PE2。
[PE2] interface vlanif 40 [PE2-Vlanif40] l2 binding vsi bgp1 [PE2-Vlanif40] quit
- 检查配置结果
在网络稳定后,在PE1上执行display vsi name bgp1 verbose命令,可以看到名字为bgp1的VSI建立了一条PW到PE2,VSI状态为Up。
[PE1] display vsi name bgp1 verbose ***VSI Name : bgp1 Administrator VSI : no Isolate Spoken : disable VSI Index : 0 PW Signaling : bgp Member Discovery Style : auto PW MAC Learn Style : unqualify Encapsulation Type : vlan MTU : 1500 Diffserv Mode : uniform Mpls Exp : -- DomainId : 255 Domain Name : Tunnel Policy Name : policy1 Ignore AcState : disable P2P VSI : disable Create Time : 0 days, 0 hours, 1 minutes, 3 seconds VSI State : up BGP RD : 100.1.1.1:1 SiteID/Range/Offset : 1/5/0 Import vpn target : 100:1 Export vpn target : 100:1 Remote Label Block : 35840/5/0 Local Label Block : 0/35840/5/0 Interface Name : Vlanif10 State : up Access Port : false Last Up Time : 2018/08/20 20:34:49 Total Up Time : 0 days, 0 hours, 1 minutes, 3 seconds **PW Information: *Peer Ip Address : 3.3.3.9 PW State : up Local VC Label : 35842 Remote VC Label : 35841 PW Type : label Local VCCV : alert lsp-ping bfd Remote VCCV : alert lsp-ping bfd Tunnel ID : 0x4 Broadcast Tunnel ID : 0x4 Broad BackupTunnel ID : 0x0 Ckey : 0x2 Nkey : 0x1 Main PW Token : 0x4 Slave PW Token : 0x0 Tnl Type : CR-LSP OutInterface : Tunnel1 Backup OutInterface : Stp Enable : 0 PW Last Up Time : 2018/08/20 20:35:51 PW Total Up Time : 0 days, 0 hours, 9 minutes, 1 seconds
在PE1上执行display vsi pw out-interface vsi bgp1 命令,可以看到1.1.1.9与3.3.3.9之间建立的MPLS TE隧道的出接口为Tunnel1,实际出接口为VLANIF20。
[PE1] display vsi pw out-interface vsi bgp1 Total: 1 -------------------------------------------------------------------------------- Vsi Name peer vcid interface -------------------------------------------------------------------------------- bgp1 3.3.3.9 2 Tunnel1 Vlanif20
CE1与CE2可以相互Ping通对方。
[CE1] ping 10.1.1.2 PING 10.1.1.2: 56 data bytes, press CTRL_C to break Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=1 ms Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=1 ms --- 10.1.1.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/1 ms
CE1 Ping通CE2后,在PE上执行display interface tunnel 1命令查看Tunnel接口信息,可看到显示信息结果中,经过该接口的数据包的统计数据变大了。以PE1的显示为例:
[PE1] display interface tunnel 1 Tunnel1 current state : UP Line protocol current state : UP Last line protocol up time : 2018-08-20 14:50:22 Description: Route Port,The Maximum Transmit Unit is 1500 Internet Address is unnumbered, using address of LoopBack1(1.1.1.9/32) Encapsulation is TUNNEL, loopback not set Tunnel destination 3.3.3.9 Tunnel up/down statistics 1 Tunnel protocol/transport MPLS/MPLS, ILM is available, primary tunnel id is 0x5, secondary tunnel id is 0x0 Current system time: 2018-08-20 15:54:54+00:00 300 seconds output rate 0 bits/sec, 0 packets/sec 0 seconds output rate 0 bits/sec, 0 packets/sec 1249 packets output, 21526 bytes 0 output error 0 output drop Input bandwidth utilization : 0% Output bandwidth utilization : 0%
配置文件
CE1的配置文件
# sysname CE1 # vlan batch 10 # interface Vlanif10 ip address 10.1.1.1 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 10 # return
PE1的配置文件
# sysname PE1 # vlan batch 10 20 # mpls lsr-id 1.1.1.9 mpls mpls te mpls rsvp-te mpls te cspf # mpls l2vpn # vsi bgp1 auto pwsignal bgp route-distinguisher 100.1.1.1:1 vpn-target 100:1 import-extcommunity vpn-target 100:1 export-extcommunity site 1 range 5 default-offset 0 tnl-policy policy1 # interface Vlanif10 l2 binding vsi bgp1 # interface Vlanif20 ip address 100.1.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 10 # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # interface Tunnel1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.9 mpls te tunnel-id 100 mpls te reserved-for-binding mpls te commit # bgp 100 peer 3.3.3.9 as-number 100 peer 3.3.3.9 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 3.3.3.9 enable # vpls-family policy vpn-target peer 3.3.3.9 enable # ospf 1 opaque-capability enable area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 100.1.1.0 0.0.0.255 mpls-te enable # tunnel-policy policy1 tunnel binding destination 3.3.3.9 te Tunnel1 # return
P的配置文件
# sysname P # vlan batch 20 30 # mpls lsr-id 2.2.2.9 mpls mpls te mpls rsvp-te # interface Vlanif20 ip address 100.1.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface Vlanif30 ip address 100.2.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 30 # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 100.1.1.0 0.0.0.255 network 100.2.1.0 0.0.0.255 mpls-te enable # return
PE2的配置文件
# sysname PE2 # vlan batch 30 40 # mpls lsr-id 3.3.3.9 mpls mpls te mpls rsvp-te mpls te cspf # mpls l2vpn # vsi bgp1 auto pwsignal bgp route-distinguisher 100.2.1.2:1 vpn-target 100:1 import-extcommunity vpn-target 100:1 export-extcommunity site 2 range 5 default-offset 0 tnl-policy policy1 # interface Vlanif30 ip address 100.2.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface Vlanif40 l2 binding vsi bgp1 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 30 # interface GigabitEthernet2/0/0 port link-type trunk port trunk allow-pass vlan 40 # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # interface Tunnel1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 1.1.1.9 mpls te tunnel-id 100 mpls te reserved-for-binding mpls te commit # bgp 100 peer 1.1.1.9 as-number 100 peer 1.1.1.9 connect-interface LoopBack1 # ipv4-family unicast undo synchronization peer 1.1.1.9 enable # vpls-family policy vpn-target peer 1.1.1.9 enable # ospf 1 opaque-capability enable area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 100.2.1.0 0.0.0.255 mpls-te enable # tunnel-policy policy1 tunnel binding destination 1.1.1.9 te Tunnel1 # return
CE2的配置文件
# sysname CE2 # vlan batch 40 # interface Vlanif40 ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet1/0/0 port link-type trunk port trunk allow-pass vlan 40 # return