01-MPLS基本配置典型配置指导
本章节下载: 01-MPLS基本配置典型配置指导 (159.71 KB)
目 录
一般情况下,在MPLS网络中都使用动态标签发布协议LDP来实现标签自动分发和管理。但LDP是通过路由表项来触发标签分配合和发布的动作,如果LDP协议出现问题,可能导致MPLS标签发生变化甚至数据转发错误。因此,对于某些关键数据或重要业务,通过配置静态LSP来确定传输路径,可以解决这种问题。
图1-1 配置静态LSP组网示意图
在运营商网络的MPLS区域中,PE1和PE2作为边缘设备,现要求在图中11.1.1.1/24网段到21.1.1.1/24网段间,通过静态配置创建LSP隧道,使这两个网段中互访的报文能够通过MPLS进行传输。
静态LSP的标签全部由手工指定,因此,配置静态LSP最主要的原则就是在一条LSP上,上游LSR出标签的值就是下游LSR入标签的值。
另外,LSP是一种单向通道,因此需要在数据传输的两个方向上分别配置一条静态LSP,并指定各自的入节点、中间节点和出节点。例如,在图中由左向右的传输路径上,PE1是入节点、P是中间节点、PE2是出节点。
产品 |
软件版本 |
硬件版本 |
S7500E系列以太网交换机 |
Release 6100系列,Release 6300系列,Release 6600系列软件版本 |
全系列硬件版本 |
S7600系列以太网交换机 |
Release 6600系列软件版本 |
全系列硬件版本 |
Release 8100系列软件版本 |
全系列硬件版本 |
按照图1-1配置各接口的IP地址和掩码,包括Loopback接口,具体配置过程略。
(2) 配置OSPF,以保证各交换机之间路由可达。
# 配置PE1。
<PE1> system-view
[PE1] ospf
[PE1-ospf-1] area 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 10.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# 配置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.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# 配置PE2。
<PE2> system-view
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 21.1.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# 配置完成后,在各交换机上执行display ip routing-table命令,可以看到相互之间都学到了到对方的主机路由。以PE1为例:
[PE1] display ip routing-table
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.9/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.9/32 OSPF 10 1562 10.1.1.2 Vlan2
3.3.3.9/32 OSPF 10 3124 10.1.1.2 Vlan2
10.1.1.0/24 Direct 0 0 10.1.1.1 Vlan2
10.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
11.1.1.0/24 Direct 0 0 11.1.1.1 Vlan10
11.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
20.1.1.0/24 OSPF 10 3124 10.1.1.2 Vlan2
21.1.1.0/24 OSPF 10 6248 10.1.1.2 Vlan2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
(3) 使能MPLS功能
# 配置PE1。
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] interface vlan-interface 2
[PE1-Vlan-interface2] mpls
[PE1-Vlan-interface2] quit
# 配置P。
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] interface vlan-interface 2
[P-Vlan-interface2] mpls
[P-Vlan-interface2] quit
[P] interface vlan-interface 3
[P-Vlan-interface3] mpls
[P-Vlan-interface3] quit
# 配置PE2。
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] interface vlan-interface 3
[PE2-Vlan-interface3] mpls
[PE2-Vlan-interface3] quit
(4) 创建从PE1到PE2的静态LSP
# 配置Ingress PE1。
[PE1] static-lsp ingress PE1_to_PE2 destination 21.1.1.0 24 nexthop 10.1.1.2 out-label 30
# 配置Transit P
[P] static-lsp transit PE1_to_PE2 incoming-interface vlan-interface 2 in-label 30 nexthop 20.1.1.2 out-label 50
# 配置Egress PE2。
[PE2] static-lsp egress PE1_to_PE2 incoming-interface vlan-interface 3 in-label 50
(5) 创建从PE2到PE1的静态LSP
# 配置Ingress PE2。
[PE2] static-lsp ingress PE2_to_PE1 destination 11.1.1.0 24 nexthop 20.1.1.1 out-label 40
# 配置Transit P。
[P] static-lsp transit PE2_to_PE1 incoming-interface vlan-interface 3 in-label 40 nexthop 10.1.1.1 out-label 70
# 配置Egress PE1。
[PE1] static-lsp egress PE2_to_PE1 incoming-interface vlan-interface 2 in-label 70
(6) 检查配置结果
# 配置完成后,可以在各交换机上通过display mpls static-lsp命令查看静态LSP的信息。以PE1的显示信息为例:
[PE1] display mpls static-lsp
total statics-lsp : 2
Name FEC I/O Label I/O If State
PE1_to_PE2 21.1.1.0/24 NULL/30 -/Vlan2 Up
PE2_to_PE1 -/- 70/NULL Vlan2/- Up
# 在PE1上检测PE1到PE2静态LSP的可达性。
[PE1] ping lsp ipv4 21.1.1.0 24
LSP Ping FEC: LDP IPV4 PREFIX 21.1.1.1/24 : 100 data bytes, press CTRL_C to break
Reply from 20.1.1.2: bytes=100 Sequence=1 time = 76 ms
Reply from 20.1.1.2: bytes=100 Sequence=2 time = 75 ms
Reply from 20.1.1.2: bytes=100 Sequence=3 time = 75 ms
Reply from 20.1.1.2: bytes=100 Sequence=4 time = 75 ms
Reply from 20.1.1.2: bytes=100 Sequence=5 time = 75 ms
--- FEC: LDP IPV4 PREFIX 21.1.1.1/24 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 75/75/76 ms
# 在PE2上检测PE2到PE1静态LSP的可达性。
[PE2] ping lsp ipv4 11.1.1.0 24
LSP Ping FEC: LDP IPV4 PREFIX 11.1.1.1/24 : 100 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=100 Sequence=1 time = 75 ms
Reply from 10.1.1.1: bytes=100 Sequence=2 time = 75 ms
Reply from 10.1.1.1: bytes=100 Sequence=3 time = 75 ms
Reply from 10.1.1.1: bytes=100 Sequence=4 time = 74 ms
Reply from 10.1.1.1: bytes=100 Sequence=5 time = 75 ms
--- FEC: LDP IPV4 PREFIX 11.1.1.1/24 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 74/74/75 ms
l PE1的完整配置
#
mpls lsr-id 1.1.1.9
#
vlan 2
#
vlan 10
#
mpls
#
interface LoopBack0
ip address 1.1.1.9 255.255.255.255
#
interface Vlan-interface2
ip address 10.1.1.1 255.255.255.0
mpls
#
interface Vlan-interface10
ip address 11.1.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 11.1.1.0 0.0.0.255
network 10.1.1.0 0.0.0.255
network 1.1.1.9 0.0.0.0
#
static-lsp ingress PE1_to_PE2 destination 21.1.1.0 24 nexthop 10.1.1.2 out-label 30
#
static-lsp egress PE2_to_PE1 incoming-interface vlan-interface 2 in-label 70
l P的完整配置
#
mpls lsr-id 2.2.2.9
#
vlan 2
#
vlan 3
#
mpls
#
interface LoopBack0
ip address 2.2.2.9 255.255.255.255
#
interface Vlan-interface2
ip address 20.1.1.1 255.255.255.0
mpls
#
interface Vlan-interface3
ip address 11.1.1.1 255.255.255.0
mpls
#
ospf 1
area 0.0.0.0
network 11.1.1.0 0.0.0.255
network 20.1.1.0 0.0.0.255
network 2.2.2.9 0.0.0.0
#
static-lsp transit PE1_to_PE2 incoming-interface vlan-interface 2 in-label 30 nexthop 20.1.1.2 out-label 50
#
static-lsp transit PE2_to_PE1 incoming-interface vlan-interface 3 in-label 40 nexthop 10.1.1.1 out-label 70
l PE2的完整配置
mpls lsr-id 3.3.3.9
#
vlan 3
#
vlan 11
#
mpls
#
interface LoopBack0
ip address 3.3.3.9 255.255.255.255
#
interface Vlan-interface3
ip address 20.1.1.2 255.255.255.0
mpls
#
interface Vlan-interface11
ip address 21.1.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 20.1.1.0 0.0.0.255
network 21.1.1.0 0.0.0.255
network 3.3.3.9 0.0.0.0
#
static-lsp egress PE1_to_PE2 incoming-interface vlan-interface 3 in-label 50
#
static-lsp ingress PE2_to_PE1 destination 11.1.1.0 24 nexthop 20.1.1.1 out-label 40
l 如果在配置静态LSP时指定了下一跳,并且下一跳地址存在于路由信息表中,则在配置IP静态路由时也必须指定下一跳。
l 配置Ingress和Transit时,本地的公网地址不能被指定为下一跳。
l 有关配置IP静态路由的介绍请参见“IP路由分册”中的“静态路由配置”。
l 由于MPLS功能会在原有报文上封装一层或多层标签,因此建议用户在使能某VLAN接口的MPLS功能后,将该VLAN内端口的jumboframe功能开启,并根据实际应用和标签嵌套层数配置相应的帧长,避免某些报文因超长而被丢弃。
LDP是标签发布协议的一种,用来动态建立LSP。通过LDP,LSR可以把网络层的路由信息映射到数据链路层的交换路径上。
图1-2 配置静态LSP组网示意图
在运营商网络的MPLS区域中,PE1和PE2作为边缘设备,现要求在图中11.1.1.1/24网段到21.1.1.1/24网段间,通过LDP协议创建动态LSP隧道,使这两个网段中互访的报文能够通过MPLS进行传输。
相对于静态LSP,通过LDP建立动态LSP的配置更为简单,只要在LSR上启动LDP协议,并选择能够触发生成标签的路由协议即可。
需要注意的是动态路由协议的配置要保证准确,否则LDP将不能生成和发布正确的MPLS标签信息,影响数据的转发。
表1-2 配置适用的产品与软硬件版本关系
产品 |
软件版本 |
硬件版本 |
S7500E系列以太网交换机 |
Release 6100系列,Release 6300系列,Release 6600系列软件版本 |
全系列硬件版本 |
S7600系列以太网交换机 |
Release 6600系列软件版本 |
全系列硬件版本 |
Release 8100系列软件版本 |
全系列硬件版本 |
(1) 配置各接口的IP地址
按照图1-2配置各接口的IP地址和掩码,包括Loopback接口,具体配置过程略。
(2) 配置OSPF,以保证各交换机之间路由可达。
# 配置PE1。
<PE1> system-view
[PE1] ospf
[PE1-ospf-1] area 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 10.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# 配置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.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# 配置PE2。
<PE2> system-view
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 21.1.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# 配置完成后,在各交换机上执行display ip routing-table命令,可以看到相互之间都学到了到对方的主机路由。以PE1为例:
[PE1] display ip routing-table
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.9/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.9/32 OSPF 10 1562 10.1.1.2 Vlan2
3.3.3.9/32 OSPF 10 3124 10.1.1.2 Vlan2
10.1.1.0/24 Direct 0 0 10.1.1.1 Vlan2
10.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
11.1.1.0/24 Direct 0 0 11.1.1.1 Vlan10
11.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
20.1.1.0/24 OSPF 10 3124 10.1.1.2 Vlan2
21.1.1.0/24 OSPF 10 6248 10.1.1.2 Vlan2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
PE1和P,P和PE2之间应建立起OSPF邻居关系,执行display ospf peer verbose命令可以看到邻居达到FULL状态。以PE1为例:
[PE1] display ospf peer verbose
OSPF Process 1 with Switch ID 1.1.1.9
Neighbors
Area 0.0.0.0 interface 10.1.1.1(Vlan-interface10)'s neighbors
Router ID: 2.2.2.9 Address: 10.1.1.2 GR State: Normal
State: Full Mode:Nbr is Master Priority: 1
DR: None BDR: None MTU: 1500
Dead timer due in 39 sec
Neighbor is up for 00:02:13
Authentication Sequence: [ 0 ]
(3) 配置基本能力,并使能LDP
# 配置PE1。
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface vlan-interface 2
[PE1-Vlan-interface2] mpls
[PE1-Vlan-interface2] mpls ldp
[PE1-Vlan-interface2] quit
# 配置P。
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface vlan-interface 2
[P-Vlan-interface2] mpls
[P-Vlan-interface2] mpls ldp
[P-Vlan-interface2] quit
[P] interface vlan-interface 3
[P-Vlan-interface3] mpls
[P-Vlan-interface3] mpls ldp
[P-Vlan-interface3] quit
# 配置PE2。
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface vlan-interface 3
[PE2-Vlan-interface3] mpls
[PE2-Vlan-interface3] mpls ldp
[PE2-Vlan-interface3] quit
完成上述配置后,PE1和P、P和PE2之间的本地LDP会话建立成功。
在各设备上执行display mpls ldp session命令,可以看到LDP会话的建立情况;执行display mpls ldp peer命令,可以看到LDP的对等体情况。以PE1为例:
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Total number of sessions: 1
----------------------------------------------------------------
Peer-ID Status LAM SsnRole FT MD5 KA-Sent/Rcv
----------------------------------------------------------------
2.2.2.9:0 Operational DU Passive Off Off 5/5
----------------------------------------------------------------
LAM : Label Advertisement Mode FT : Fault Tolerance
[SwitchA] display mpls ldp peer
LDP Peer Information in Public network
Total number of peers: 1
-----------------------------------------------------------------
Peer-ID Transport-Address Discovery-Source
----------------------------------------------------------------
2.2.2.9:0 2.2.2.9 Vlan-interface10
----------------------------------------------------------------
(4) 配置LSP的触发策略
# 配置PE1。
[PE1] mpls
[PE1-mpls] lsp-trigger all
[PE1-mpls] return
# 配置P。
[P] mpls
[P-mpls] lsp-trigger all
[P-mpls] return
# 配置PE2。
[PE2] mpls
[PE2-mpls] lsp-trigger all
[PE2-mpls] return
配置完成后,在各设备上执行display mpls ldp lsp命令,可以看到LDP LSP的建立情况。以PE1为例。
<PE1> display mpls ldp lsp
LDP LSP Information
-------------------------------------------------------------------
SN DestAddress/Mask In/OutLabel Next-Hop In/Out-Interface
------------------------------------------------------------------
1 1.1.1.9/32 3/NULL 127.0.0.1 Vlan10/InLoop0
2 2.2.2.9/32 NULL/3 10.1.1.2 ----/Vlan10
3 3.3.3.9/32 NULL/1025 10.1.1.2 ----/Vlan10
4 20.1.1.0/24 NULL/3 10.1.1.2 ----/Vlan10
-------------------------------------------------------------------
A '*' before an LSP means the LSP is not established
A '*' before a Label means the USCB or DSCB is stale
# 使用LSP Ping检测MPLS LSP的有效性和可达性。
<PE1> ping lsp ipv4 3.3.3.9 32
LSP PING FEC: LDP IPV4 PREFIX 3.3.3.9/32 : 100 data bytes, press CTRL_C to break
Reply from 20.1.1.2: bytes=100 Sequence=1 time = 1 ms
Reply from 20.1.1.2: bytes=100 Sequence=2 time = 1 ms
Reply from 20.1.1.2: bytes=100 Sequence=3 time = 1 ms
Reply from 20.1.1.2: bytes=100 Sequence=4 time = 1 ms
Reply from 20.1.1.2: bytes=100 Sequence=5 time = 1 ms
--- FEC: LDP IPV4 PREFIX 3.3.3.9/32 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms
l PE1的完整配置
#
mpls lsr-id 1.1.1.9
#
vlan 2
#
Mpls
lsp-trigger all
#
mpls ldp
#
interface LoopBack0
ip address 1.1.1.9 255.255.255.255
#
interface Vlan-interface2
ip address 10.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface Vlan-interface10
ip address 11.1.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 11.1.1.0 0.0.0.255
network 10.1.1.0 0.0.0.255
network 1.1.1.9 0.0.0.0
#
l P的完整配置
#
mpls lsr-id 2.2.2.9
#
vlan 2
#
vlan 3
#
mpls
lsp-trigger all
#
mpls ldp
#
interface LoopBack0
ip address 2.2.2.9 255.255.255.255
#
#
interface Vlan-interface2
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlan-interface3
ip address 20.1.1.1 255.255.255.0
mpls
mpls ldp
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 20.1.1.0 0.0.0.255
network 2.2.2.9 0.0.0.0
#
l PE2的完整配置
#
mpls lsr-id 3.3.3.9
#
vlan 3
#
vlan 11
#
mpls
lsp-trigger all
#
mpls ldp
#
interface LoopBack0
ip address 3.3.3.9 255.255.255.255
#
interface Vlan-interface3
ip address 20.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface Vlan-interface11
ip address 21.1.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 20.1.1.0 0.0.0.255
network 21.1.1.0 0.0.0.255
network 3.3.3.9 0.0.0.0
#
无
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!