素材来源:华为路由器配置指南
一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全
目标
交换PW两端都是动态PW。动态PW使用扩展的LDP传递二层信息和VC标签。
组网需求
如图1所示。CE1、CE2分别接入U-PE1和U-PE2。U-PE1和U-PE2通过MPLS骨干网连接。使用LSP隧道,并以S-PE作为交换节点,在U-PE1和U-PE2之间建立多段动态PW。
配置思路
- 在骨干网上运行IGP路由协议,使骨干网各设备能互通。
- 在骨干网上配置MPLS基本能力,建立LSP隧道。U-PE1与S-PE之间、U-PE2与S-PE之间需建立MPLS LDP远端对等体关系。
- 创建PW模板,并使能控制字和LSP Ping功能。
操作步骤
- 配置CE上接入PE的接口的IP地址
配置CE1
CE1:
interface Ethernet1/0/0
ip address 10.10.1.1 255.255.255.0
配置CE2
CE2:
interface Ethernet1/0/0
ip address 10.10.1.2 255.255.255.0
- 配置MPLS骨干网的IGP
在MPLS骨干网上配置IGP,本示例采用OSPF。
配置U-PE、S-PE和P各接口的IP地址。配置OSPF时,注意需要发布U-PE1、S-PE和U-PE2的32位Loopback接口地址。
配置U-PE1
U-PE1:
interface LoopBack0
ip address 1.1.1.9 255.255.255.255
interface Ethernet1/0/1
ip address 10.1.1.1 255.255.255.0
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 10.1.1.0 0.0.0.255
配置P1
P1:
interface LoopBack0
ip address 2.2.2.9 255.255.255.255
interface Ethernet1/0/1
ip address 10.1.1.2 255.255.255.0
interface Ethernet1/0/0
ip address 10.2.1.1 255.255.255.0
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.2.1.0 0.0.0.255
配置S-PE
S-PE:
interface LoopBack0
ip address 3.3.3.9 255.255.255.255
interface Ethernet1/0/1
ip address 10.2.1.2 255.255.255.0
interface Ethernet1/0/0
ip address 10.3.1.1 255.255.255.0
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 10.2.1.0 0.0.0.255
network 10.3.1.0 0.0.0.255
配置P2
P2:
interface LoopBack0
ip address 4.4.4.9 255.255.255.255
interface Ethernet1/0/1
ip address 10.3.1.2 255.255.255.0
interface Ethernet1/0/0
ip address 10.4.1.1 255.255.255.0
ospf 1
area 0.0.0.0
network 4.4.4.9 0.0.0.0
network 10.3.1.0 0.0.0.255
network 10.4.1.0 0.0.0.255
配置U-PE2
U-PE2:
interface LoopBack0
ip address 5.5.5.9 255.255.255.255
interface Ethernet1/0/1
ip address 10.4.1.2 255.255.255.0
ospf 1
area 0.0.0.0
network 5.5.5.9 0.0.0.0
network 10.4.1.0 0.0.0.255
- 使能MPLS,建立LSP隧道和远端LDP会话
在MPLS骨干网上配置MPLS基本能力,在U-PE1与S-PE之间及S-PE和U-PE2之间建立隧道和远端LDP会话。
配置U-PE1
U-PE1:
mpls lsr-id 1.1.1.9
mpls
mpls ldp
interface Ethernet1/0/1
mpls
mpls ldp
mpls ldp remote-peer 3.3.3.9
remote-ip 3.3.3.9
配置P1
P1:
mpls lsr-id 2.2.2.9
mpls
mpls ldp
interface Ethernet1/0/1
mpls
mpls ldp
interface Ethernet1/0/0
mpls
mpls ldp
配置S-PE
S-PE:
mpls lsr-id 3.3.3.9
mpls
mpls ldp
interface Ethernet1/0/1
mpls
mpls ldp
interface Ethernet1/0/0
mpls
mpls ldp
mpls ldp remote-peer 1.1.1.9
remote-ip 1.1.1.9
mpls ldp remote-peer 5.5.5.9
remote-ip 5.5.5.9
配置P2
P2:
mpls lsr-id 4.4.4.9
mpls
mpls ldp
interface Ethernet1/0/0
mpls
mpls ldp
interface Ethernet1/0/1
mpls
mpls ldp
配置U-PE2
U-PE2:
mpls lsr-id 5.5.5.9
mpls
mpls ldp
interface Ethernet1/0/1
mpls
mpls ldp
mpls ldp remote-peer 3.3.3.9
remote-ip 3.3.3.9
配置完成后,在各U-PE、P或者S-PE上执行display mpls ldp session命令可以看到显示结果中Session State项为Operational。执行display mpls ldp peer命令可以看到LDP会话和对等体的建立情况。执行display mpls lsp命令可以看到LSP的建立情况。以S-PE上的显示为例:
[~S-PE]dis 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
--------------------------------------------------------------------------
1.1.1.9:0 Operational DU Active 0000:00:07 33/33
2.2.2.9:0 Operational DU Active 0000:00:08 34/34
4.4.4.9:0 Operational DU Passive 0000:00:04 21/21
5.5.5.9:0 Operational DU Passive 0000:00:01 7/7
--------------------------------------------------------------------------
TOTAL: 4 Session(s) Found.
[~S-PE] dis mpls ldp pe
[~S-PE] dis mpls ldp peer
LDP Peer Information in Public network
An asterisk (*) before a peer means the peer is being deleted.
-------------------------------------------------------------------------------
PeerID TransportAddress DiscoverySource
-------------------------------------------------------------------------------
1.1.1.9:0 1.1.1.9 Remote Peer : 1.1.1.9
2.2.2.9:0 2.2.2.9 Ethernet1/0/1
4.4.4.9:0 4.4.4.9 Ethernet1/0/0
5.5.5.9:0 5.5.5.9 Remote Peer : 5.5.5.9
-------------------------------------------------------------------------------
TOTAL: 4 Peer(s) Found.
[~S-PE]dis 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
1.1.1.9/32 NULL/48121 -/Eth1/0/1
1.1.1.9/32 48121/48121 -/Eth1/0/1
2.2.2.9/32 NULL/3 -/Eth1/0/1
2.2.2.9/32 48122/3 -/Eth1/0/1
3.3.3.9/32 3/NULL -/-
4.4.4.9/32 NULL/3 -/Eth1/0/0
4.4.4.9/32 48123/3 -/Eth1/0/0
5.5.5.9/32 NULL/48123 -/Eth1/0/0
5.5.5.9/32 48124/48123 -/Eth1/0/0
[~S-PE]
- 创建并配置PW模板
在U-PE上创建PW模板,并使能控制字和LSP Ping功能。
配置U-PE1
U-PE1:
mpls l2vpn
pw-template pwt
peer-address 3.3.3.9
control-word
配置U-PE2
U-PE2:
mpls l2vpn
pw-template pwt
peer-address 3.3.3.9
control-word
- 创建VC连接
在U-PE1、U-PE2和S-PE上使能MPLS L2VPN。
在U-PE上配置动态PW,并在S-PE完成纯动态PW的交换。
配置U-PE1。
U-PE1:
interface Ethernet1/0/0
mpls l2vc pw-template pwt 100
配置S-PE。
S-PE:
mpls l2vpn
mpls switch-l2vc 1.1.1.9 100 between 5.5.5.9 200 encapsulation ethernet
配置U-PE2。
U-PE2:
interface Ethernet1/0/0
mpls l2vc pw-template pwt 200
- 验证配置结果
查看PWE3的连接信息
在U-PE和S-PE上查看L2VPN连接信息,可以看到建立了一条L2 VC,VC State为UP。
以U-PE1的显示为例:
[~U-PE1-Ethernet1/0/0]DIS MPLS L2VC interface ETHE1/0/0
*client interface : Ethernet1/0/0 is up
Administrator PW : no
session state : up
AC status : up
Ignore AC state : disable
VC state : up
Label state : 0
Token state : 0
VC ID : 100
VC type : Ethernet
destination : 3.3.3.9
local group ID : 0 remote group ID : 0
local VC label : 48124 remote VC label : 48125
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 : up
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 : cw alert ttl lsp-ping bfd
remote VCCV : cw alert ttl lsp-ping bfd
local control word : enable remote control word : enable
tunnel policy name : --
PW template name : pwt
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 : 0x0000000001004c4b43
create time : 0 days, 0 hours, 2 minutes, 43 seconds
up time : 0 days, 0 hours, 0 minutes, 52 seconds
last change time : 0 days, 0 hours, 0 minutes, 52 seconds
VC last up time : 2020/01/09 14:38:21
VC total up time : 0 days, 0 hours, 0 minutes, 52 seconds
CKey : 1
NKey : 16777373
PW redundancy mode : frr
AdminPw interface : --
AdminPw link state : --
Forward state : send active, receive active
Diffserv Mode : uniform
Service Class : --
Color : --
DomainId : --
Domain Name : --
[~U-PE1-Ethernet1/0/0]
查看S-PE上的交换虚电路状态:
[~S-PE]dis mpls switch-l2vc
Total Switch VC : 1, 1 up, 0 down
*Switch-l2vc type : LDP<---->LDP
Peer IP Address : 1.1.1.9, 5.5.5.9
VC ID : 100, 200
VC Type : Ethernet
VC State : up
VC StatusCode |PSN |OAM | FW | |PSN |OAM | FW |
-Local VC :| UP | UP | UP | | UP | UP | UP |
-Remote VC:| UP | UP | UP | | UP | UP | UP |
Session State : up, up
Local/Remote Label : 48125/48124, 48126/48124
InLabel Status : 0 , 0
Local/Remote MTU : 1500/1500, 1500/1500
Local/Remote Control Word : Enable/Enable, Enable/Enable
Local/Remote VCCV Capability : cw alert ttl lsp-ping bfd / cw alert ttl lsp-pin
g bfd, cw alert ttl lsp-ping bfd / cw alert ttl lsp-ping bfd
Switch-l2vc tunnel info :
1 tunnels for peer 1.1.1.9
NO.0 TNL Type : ldp , TNL ID : 0x000
0000001004c6b42
1 tunnels for peer 5.5.5.9
NO.0 TNL Type : ldp , TNL ID : 0x000
0000001004c6b45
CKey : 2, 3
NKey : 16777379, 16777380
Tunnel policy : --, --
Control-Word transparent : NO
Create time : 0 days, 0 hours, 36 minutes, 30 seconds
UP time : 0 days, 0 hours, 35 minutes, 38 seconds
Last change time : 0 days, 0 hours, 35 minutes, 38 seconds
VC last up time : 2020/01/09 14:38:21
VC total up time : 0 days, 0 hours, 35 minutes, 38 seconds
[~S-PE]
检测CE之间的连接性和CE之间的路径信息
CE1和CE2应能相互Ping通。
[~CE1-Ethernet1/0/0]ping 10.10.1.2
PING 10.10.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.10.1.2: bytes=56 Sequence=1 ttl=255 time=27 ms
Reply from 10.10.1.2: bytes=56 Sequence=2 ttl=255 time=15 ms
Reply from 10.10.1.2: bytes=56 Sequence=3 ttl=255 time=17 ms
Reply from 10.10.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.10.1.2: bytes=56 Sequence=5 ttl=255 time=14 ms
--- 10.10.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 14/18/27 ms
[~CE1-Ethernet1/0/0]
CE1到CE2的路径信息。
[~CE1-Ethernet1/0/0]tracert 10.10.1.2
traceroute to 10.10.1.2(10.10.1.2), max hops: 30, packet length: 40, press CTRL
_C to break
1 10.10.1.2 6 ms 16 ms 17 ms
[~CE1-Ethernet1/0/0]
?
|