华为运营商级路由器配置示例 | 配置动态VPWS接入VPLS示例
Posted 一个热爱编程的通信人
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为运营商级路由器配置示例 | 配置动态VPWS接入VPLS示例相关的知识,希望对你有一定的参考价值。
组网需求
如图1所示,UPE通过VPWS接入SPE,CE1和CE2通过UPE接入VPLS全连接网络。
配置思路
-
在SPE之间配置LDP方式VPLS。
-
UPE、SPE配置MPLS L2VPN基本能力。
-
在SPE上配置VPWS和VSI,VSI使能MAC-withdraw功能。
-
在UPE上配置VPWS接入SPE。
操作步骤
1.配置IP地址
按照图1所示,配置各接口的IP地址和掩码,包括各Loopback接口。
2.配置IGP
在SPE和P设备上配置OSPF协议,发布网段及LSR ID主机路由。
# 配置SPE1。
<SPE1> system-view
[~SPE1] ospf
[*SPE1-ospf-1] area 0
[*SPE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[*SPE1-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255
[*SPE1-ospf-1-area-0.0.0.0] network 10.10.3.0 0.0.0.255
[*SPE1-ospf-1-area-0.0.0.0] quit
[*SPE1-ospf-1] quit
[*SPE1] commit
# 配置P。
<P> system-view
[~P] ospf
[*P-ospf-1] area 0
[*P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[*P-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] network 10.10.2.0 0.0.0.255
[*P-ospf-1-area-0.0.0.0] quit
[*P-ospf-1] quit
[*P] commit
# 配置SPE2。
<SPE2> system-view
[~SPE2] ospf
[*SPE2-ospf-1] area 0
[*SPE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[*SPE2-ospf-1-area-0.0.0.0] network 10.10.2.0 0.0.0.255
[*SPE2-ospf-1-area-0.0.0.0] network 10.10.4.0 0.0.0.255
[*SPE2-ospf-1-area-0.0.0.0] quit
[*SPE2-ospf-1] quit
[*SPE2] commit
# 配置UPE1。
<UPE1> system-view
[~UPE1] ospf
[*UPE1-ospf-1] area 0
[*UPE1-ospf-1-area-0.0.0.0] network 4.4.4.9 0.0.0.0
[*UPE1-ospf-1-area-0.0.0.0] network 10.10.3.0 0.0.0.255
[*UPE1-ospf-1-area-0.0.0.0] quit
[*UPE1-ospf-1] quit
[*UPE1] commit
# 配置UPE2。
<UPE2> system-view
[~UPE2] ospf
[*UPE2-ospf-1] area 0
[*UPE2-ospf-1-area-0.0.0.0] network 5.5.5.9 0.0.0.0
[*UPE2-ospf-1-area-0.0.0.0] network 10.10.4.0 0.0.0.255
[*UPE2-ospf-1-area-0.0.0.0] quit
[*UPE2-ospf-1] quit
[*UPE2] commit
3.配置MPLS基本能力和LDP
# 配置SPE1。
[~SPE1] mpls lsr-id 1.1.1.9
[*SPE1] mpls
[*SPE1-mpls] quit
[*SPE1] mpls ldp
[*SPE1-mpls-ldp] quit
[*SPE1] interface gigabitethernet 1/0/0
[*SPE1-GigabitEthernet1/0/0] mpls
[*SPE1-GigabitEthernet1/0/0] mpls ldp
[*SPE1-GigabitEthernet1/0/0] quit
[*SPE1-GigabitEthernet2/0/0] mpls
[*SPE1-GigabitEthernet2/0/0] mpls ldp
[*SPE1-GigabitEthernet2/0/0] quit
[*SPE1] commit
# 配置P。
[~P] mpls lsr-id 2.2.2.9
[*P] mpls
[*P-mpls] quit
[*P] mpls ldp
[*P-mpls-ldp] quit
[*P] interface gigabitethernet 1/0/0
[*P-GigabitEthernet1/0/0] mpls
[*P-GigabitEthernet1/0/0] mpls ldp
[*P-GigabitEthernet1/0/0] quit
[*P] interface gigabitethernet 2/0/0
[*P-GigabitEthernet2/0/0] mpls
[*P-GigabitEthernet2/0/0] mpls ldp
[*P-GigabitEthernet2/0/0] quit
[*P] commit
# 配置SPE2。
[~SPE2] mpls lsr-id 3.3.3.9
[*SPE2] mpls
[*SPE2-mpls] quit
[*SPE2] mpls ldp
[*SPE2-mpls-ldp] quit
[*SPE2] interface gigabitethernet 1/0/0
[*SPE2-GigabitEthernet1/0/0] mpls
[*SPE2-GigabitEthernet1/0/0] mpls ldp
[*SPE2-GigabitEthernet1/0/0] quit
[*SPE2-GigabitEthernet2/0/0] mpls
[*SPE2-GigabitEthernet2/0/0] mpls ldp
[*SPE2-GigabitEthernet2/0/0] quit
[*SPE2] commit
# 配置UPE1。
[~UPE1] mpls lsr-id 4.4.4.9
[*UPE1] mpls
[*UPE1-mpls] quit
[*UPE1] mpls ldp
[*UPE1-mpls-ldp] quit
[*UPE1] interface gigabitethernet 1/0/0
[*UPE1-GigabitEthernet1/0/0] mpls
[*UPE1-GigabitEthernet1/0/0] mpls ldp
[*UPE1-GigabitEthernet1/0/0] quit
[*UPE1] commit
# 配置UPE2。
[~UPE2] mpls lsr-id 5.5.5.9
[*UPE2] mpls
[*UPE2-mpls] quit
[*UPE2] mpls ldp
[*UPE2-mpls-ldp] quit
[*UPE2] interface gigabitethernet 1/0/0
[*UPE2-GigabitEthernet1/0/0] mpls
[*UPE2-GigabitEthernet1/0/0] mpls ldp
[*UPE2-GigabitEthernet1/0/0] quit
[~UPE2] commit
配置完成后,在SPE1、P和SPE2上执行display mpls ldp session命令可以看到SPE1和P之间或SPE2和P之间的对等体Status项为“Operational”,即对等体关系已建立。执行display mpls lsp命令可以看到LSP的建立情况。
以SPE1的显示为例。
<SPE1> display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
An asterisk (*) before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.9:0 Operational DU Passive 000:00:01 7/7
------------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
<SPE1> display mpls lsp
Flag after Out IF: (I) - RLFA Iterated LSP, (I*) - Normal and RLFA Iterated LSP
Flag after LDP FRR: (L) - Logic FRR LSP
----------------------------------------------------------------------
LSP Information: LDP LSP
----------------------------------------------------------------------
FEC In/Out Label In/Out IF Vrf Name
2.2.2.9/32 NULL/3 -/GigabitEthernet1/0/0
1.1.1.9/32 3/NULL -/-
3.3.3.9/32 NULL/1025 -/GigabitEthernet1/0/0
4.在SPE之间建立远端LDP会话
# 配置SPE1。
[~SPE1] mpls ldp remote-peer 3.3.3.9
[*SPE1-mpls-ldp-remote-3.3.3.9] remote-ip 3.3.3.9
[*SPE1-mpls-ldp-remote-3.3.3.9] quit
[*SPE1] commit
# 配置SPE2。
[~SPE2] mpls ldp remote-peer 1.1.1.9
[*SPE2-mpls-ldp-remote-1.1.1.9] remote-ip 1.1.1.9
[*SPE2-mpls-ldp-remote-1.1.1.9] quit
[*SPE2] commit
配置完成后,在SPE1和SPE2上执行display mpls ldp session命令可以看到SPE1和SPE2之间的对等体Status项为“Operational”,即对等体关系已建立。
以SPE1的显示为例。
<SPE1> display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
An asterisk (*) before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.9:0 Operational DU Passive 000:00:05 24/24
3.3.3.9:0 Operational DU Passive 000:00:01 5/5
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
5.使能UPE的MPLS L2VPN功能,配置UPE通过VPWS接入SPE
# 配置UPE1。
<UPE1> system-view
[~UPE1] mpls l2vpn
[*UPE1-l2vpn] quit
[*UPE1] interface gigabitethernet 2/0/0.1
[*UPE1-GigabitEthernet2/0/0.1] shutdown
[*UPE1-GigabitEthernet2/0/0.1] vlan-type dot1q 1
[*UPE1-GigabitEthernet2/0/0.1] mpls l2vc 1.1.1.9 100
[*UPE1-GigabitEthernet2/0/0.1] undo shutdown
[*UPE1-GigabitEthernet2/0/0.1] quit
[*UPE1] commit
# 配置UPE2。
<UPE2> system-view
[~UPE2] mpls l2vpn
[*UPE2-l2vpn] quit
[*UPE2] interface gigabitethernet 2/0/0.1
[*UPE2-GigabitEthernet2/0/0.1] shutdown
[*UPE2-GigabitEthernet2/0/0.1] vlan-type dot1q 1
[*UPE2-GigabitEthernet2/0/0.1] mpls l2vc 3.3.3.9 100
[*UPE2-GigabitEthernet2/0/0.1] undo shutdown
[*UPE2-GigabitEthernet2/0/0.1] quit
[*UPE2] commit
6.使能SPE的MPLS L2VPN功能,并绑定VSI
# 配置SPE1。
<SPE1> system-view
[~SPE1] mpls l2vpn
[*SPE1] vsi v100
[*SPE1-vsi-v100] pwsignal ldp
[*SPE1-vsi-v100-ldp] vsi-id 100
[*SPE1-vsi-v100-ldp] mac-withdraw enable
[*SPE1-vsi-v100-ldp] peer 3.3.3.9
[*SPE1-vsi-v100-ldp] peer 4.4.4.9 upe
[*SPE1-vsi-v100-ldp] quit
[*SPE1-vsi-v100] quit
[*SPE1] commit
# 配置SPE2。
<SPE2> system-view
[~SPE2] mpls l2vpn
[*SPE2] vsi v100
[*SPE2-vsi-v100] pwsignal ldp
[*SPE2-vsi-v100-ldp] vsi-id 100
[*SPE2-vsi-v100-ldp] mac-withdraw enable
[*SPE2-vsi-v100-ldp] peer 1.1.1.9
[*SPE2-vsi-v100-ldp] peer 5.5.5.9 upe
[*SPE2-vsi-v100-ldp] quit
[*SPE2-vsi-v100] quit
[*SPE2] commit
7.检验配置结果
完成上述配置后,在UPE上执行display mpls l2vc命令,可以看到PW已经建立,VC的状态为UP。以UPE1的显示为例。
<UPE1> display mpls l2vc interface gigabitethernet 2/0/0.1
*client interface : GigabitEthernet2/0/0.1 is up
Administrator PW : no
session state : up
AC status : up
VC state : up
Label state : 0
Token state : 0
VC ID : 100
VC type : VLAN
destination : 1.1.1.9
local group ID : 0 remote group ID : 0
local VC label : 23 remote VC label : 24
local AC OAM State : up
local PSN OAM State : up
local forwarding state : forwarding
local status code : 0x0 (forwarding)
remote AC OAM State : up
remote PSN OAM state : up
remote forwarding state: forwarding
remote status code : 0x0 (forwarding)
ignore standby state : no
BFD for PW : unavailable
VCCV State : --
manual fault : not set
active state : active
forwarding entry : exist
OAM Protocol : --
OAM Status : --
OAM Fault Type : --
PW APS ID : --
PW APS Status : --
TTL Value : 1
link state : up
local VC MTU : 1500 remote VC MTU : 1500
local VCCV : alert ttl lsp-ping bfd
remote VCCV : alert lsp-ping
local control word : disable remote control word : disable
tunnel policy name : --
PW template name : --
primary or secondary : primary
load balance type : flow
Access-port : false
Switchover Flag : false
VC tunnel info : 1 tunnels
NO.0 TNL type : ldp, TNL ID : 0x0000000001004c4b61
create time : 0 days, 0 hours, 19 minutes, 17 seconds
up time : 0 days, 0 hours, 14 minutes, 34 seconds
last change time : 0 days, 0 hours, 14 minutes, 34 seconds
VC last up time : 2012/12/05 08:13:31
VC total up time : 0 days, 0 hours, 14 minutes, 34 seconds
CKey : 65
NKey : 1493172339
PW redundancy mode : frr
AdminPw interface : --
AdminPw link state : --
Forward state : send inactive, receive inactive
Diffserv Mode : uniform
Service Class : --
Color : --
DomainId : --
Domain Name : --
在SPE上执行display vsi name v100 verbose命令,可以看到名字为v100的VSI的状态为UP;对应的PW状态也为UP。以SPE1的显示为例。
<SPE1> display vsi name v100 verbose
***VSI Name : v100
Administrator VSI : no
Isolate Spoken : disable
VSI Index : 2
PW Signaling : ldp
Member Discovery Style : --
Bridge-domain Mode : disable
PW MAC Learning Style : unqualify
Encapsulation Type : vlan
MTU : 1500
Diffserv Mode : uniform
Service Class : --
Color : --
DomainId : 255
Domain Name :
Ignore AcState : disable
P2P VSI : disable
Create Time : 0 days, 0 hours, 4 minutes, 8 seconds
VSI State : up
Resource Status : --
VSI ID : 100
*Peer Router ID : 3.3.3.9
primary or secondary : primary
ignore-standby-state : no
VC Label : 23
Peer Type : dynamic
Session : up
Tunnel ID : 0x0000000001004c4b62
Broadcast Tunnel ID : --
Broad BackupTunnel ID : --
CKey : 33
NKey : 788529266
Stp Enable : 0
PwIndex : 33
Control Word : disable
*Peer Router ID : 4.4.4.9
primary or secondary : primary
ignore-standby-state : no
VC Label : 24
Peer Type : dynamic
Session : up
Tunnel ID : 0x0000000001004c4b63
Broadcast Tunnel ID : --
Broad BackupTunnel ID : --
CKey : 34
NKey : 788529267
Stp Enable : 0
PwIndex : 34
Control Word : disable
**PW Information:
*Peer Ip Address : 3.3.3.9
PW State : up
Local VC Label : 23
Remote VC Label : 19
Remote Control Word : disable
PW Type : label
Tunnel ID : 0x0000000001004c4b62
Broadcast Tunnel ID : --
Broad BackupTunnel ID : --
Ckey : 33
Nkey : 788529266
Main PW Token : 0x0
Slave PW Token : 0x0
Tnl Type : ldp
OutInterface : LDP LSP
Backup OutInterface : --
Stp Enable : 0
PW Last Up Time : 2012/12/05 08:14:03
PW Total Up Time : 0 days, 0 hours, 2 minutes, 20 seconds
*Peer Ip Address : 4.4.4.9
PW State : up
Local VC Label : 24
Remote VC Label : 23
Remote Control Word : disable
PW Type : MEHVPLS
Tunnel ID : 0x0000000001004c4b63
Broadcast Tunnel ID : --
Broad BackupTunnel ID : --
Ckey : 34
Nkey : 788529267
Main PW Token : 0x0
Slave PW Token : 0x0
Tnl Type : ldp
OutInterface : LDP LSP
Backup OutInterface : --
Stp Enable : 0
PW Last Up Time : 2012/12/05 08:13:30
PW Total Up Time : 0 days, 0 hours, 3 minutes, 7 seconds
处于同一网段下的CE1和CE2之间应能相互ping通。把UPE或PE上绑定该VSI的接口GE2/0/0.1执行shutdown命令后,CE1与CE2之间不能互相ping通,说明业务数据通过该VSI的PW传输。
SPE1的GE2/0/0接口shutdown之前,在SPE2上查看VSI学习到的MAC表
<SPE2> display mac-address dynamic
MAC address table of slot 1:
-------------------------------------------------------------------------------
MAC Address VLAN/BD/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI/EVPN MAC-Tunnel
-------------------------------------------------------------------------------
00e0-fc00-1234 V100 - - GigabitEthernet2/0/0 dynamic 10/51
00e0-fc00-3456 V100 - - GigabitEthernet1/0/0 dynamic 10/49
-------------------------------------------------------------------------------
Total matching items on slot 1 displayed = 2
SPE1的GE2/0/0接口shutdown之后,使VSI变为Down状态,在SPE2上查看VSI学习到的MAC表,发现来自接口GE2/0/0的MAC地址已经被删除
以上是关于华为运营商级路由器配置示例 | 配置动态VPWS接入VPLS示例的主要内容,如果未能解决你的问题,请参考以下文章
华为运营商级路由器配置示例 | EVdPdNd VPWS over SRv6 BE(CE双归双活)
华为运营商级路由器配置示例 | EVdPdNd VPWS over SRv6 BE(CE双归单活)
玩转华为ENSP模拟器系列 | 配置动态VPWS接入VPLS示例