• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S6820系列以太网交换机 典型配置举例-Release 630x系列-6W100

目录

30-MPLS基础典型配置举例

本章节下载 30-MPLS基础典型配置举例  (227.83 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S6800/S6820/Configure/Typical_Configuration_Example/H3C_S6820_CE-Release_630x-6W100/202002/1273707_30005_0.htm

30-MPLS基础典型配置举例

H3C S6820产品MPLS基础典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2020 新华三技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。

本文档中的信息可能变动,恕不另行通知。



1  简介

本文档介绍通过静态方式和LDP(Label Distribution Protocol,标签分发协议)方式建立LSP的基本过程。

建立静态LSP需要用户在报文转发路径中的各个LSR上手工配置为FEC分配的标签。通过静态方式建立LSP消耗的资源比较少,但静态建立的LSP不能根据网络拓扑变化动态调整。因此,静态LSP适用于拓扑结构简单并且稳定的小型网络。

LDP协议是MPLS的一种信令协议,负责划分FEC、通告FEC—标签绑定、建立维护LSP等。通过LDP建立LSP消耗资源比较多,但动态建立的LSP能根据网络拓扑变化动态调整。因此,LDP方式建立LSP适用于拓扑结构复杂并且不太稳定的大中型网络。

2  配置前提

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文档假设您已了解MPLS特性。

3  静态LSP配置举例

3.1  组网需求

图1所示,运营商网络运行MPLS,Switch A和Switch C作为MPLS网络的边缘设备,现要求在172.20.2.0/24网段和172.16.2.0/24网段间,通过配置静态LSP隧道,使这两个网段中互访的报文能够通过LSP在MPLS网络中进行传输。

图1 配置静态LSP组网图

 

3.2  配置思路

·            为了使设备能够按正确的路径转发MPLS报文,需要在手工配置LSP的标签时,确保上游LSR出标签的值就是下游LSR入标签的值。

·            LSP是一种单向通道,为了实现数据的双向正常传输,需要在数据传输的两个方向上分别配置一条静态LSP,并指定各自的入节点、中间节点和出节点。

·            在静态LSP环境中,只需要Ingress节点上存在到达FEC目的地址的路由即可,Transit和Egress节点上无需存在到达FEC目的地址的路由,因此本例中使用简单的静态路由即可完成路由配置。

3.3  使用版本

本举例是在R6301版本上进行配置和验证的。

3.4  配置注意事项

·            通过静态路由配置路由信息时,如果静态路由指定的是出接口,则静态LSP必须指定相同的出接口;如果静态路由指定的是下一跳,则静态LSP必须指定相同的下一跳。

·            配置Ingress和Transit时,本地的公网地址不能被指定为下一跳。

·            由于MPLS功能会在原有报文上封装一层或多层标签,因此建议用户在使能某VLAN接口的MPLS功能后,将该VLAN内端口的jumboframe帧功能开启,并根据实际应用和标签嵌套层数配置相应的帧长,避免某些报文因超长而被丢弃。

3.5  配置步骤

(1)       配置各接口的IP地址

按照图1配置各接口的IP地址和掩码,包括LoopBack接口,具体配置过程略。

(2)       配置静态路由,使两条LSP的Ingress节点上存在到达FEC目的地址的路由。

# 配置Switch A。

<SwitchA> system-view

[SwitchA] ip route-static 172.16.2.1 24 10.0.3.2

# 配置Switch C。

<SwitchC> system-view

[SwitchC] ip route-static 172.20.2.1 24 10.0.6.1

# 配置完成后,在Ingress设备上执行display ip routing-table命令,可以看到静态路由已生效。以Switch A为例:

[SwitchA] display ip routing-table

 

Destinations : 13        Routes : 13

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

0.0.0.0/32          Direct 0    0            127.0.0.1       InLoop0

172.16.2.1/24       Static 60   0            10.0.3.2        Vlan3

10.0.3.0/24         Direct 0    0            10.0.3.1        Vlan3

10.0.3.0/32         Direct 0    0            10.0.3.1        Vlan3

10.0.3.1/32         Direct 0    0            127.0.0.1       InLoop0

1.1.1.9/32          Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.0/32        Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

127.255.255.255/32  Direct 0    0            127.0.0.1       InLoop0

224.0.0.0/4         Direct 0    0            0.0.0.0         NULL0

224.0.0.0/24        Direct 0    0            0.0.0.0         NULL0

255.255.255.255/32  Direct 0    0            127.0.0.1       InLoop0

(3)       使能MPLS功能

# 配置Switch A。

[SwitchA] mpls lsr-id 1.1.1.9

[SwitchA] interface vlan-interface 3

[SwitchA-Vlan-interface3] mpls enable

[SwitchA-Vlan-interface3] quit

# 配置Switch B。

[SwitchB] mpls lsr-id 2.2.2.9

[SwitchB] interface vlan-interface 3

[SwitchB-Vlan-interface3] mpls enable

[SwitchB-Vlan-interface3] quit

[SwitchB] interface vlan-interface 6

[SwitchB-Vlan-interface6] mpls enable

[SwitchB-Vlan-interface6] quit

# 配置Switch C。

[SwitchC] mpls lsr-id 3.3.3.9

[SwitchC] interface vlan-interface 6

[SwitchC-Vlan-interface6] mpls enable

[SwitchC-Vlan-interface6] quit

(4)       创建从Switch A到Switch C的静态LSP

# 为Ingress节点Switch A配置一条到目的地址172.16.2.1/24的静态LSP,LSP的名称为AtoC,下一跳地址为10.0.3.2,出标签为30。

[SwitchA] static-lsp ingress AtoC destination 172.16.2.1 24 nexthop 10.0.3.2 out-label 30

# 为Transit节点Switch B配置一条名为AtoC的静态LSP,入标签为30,下一跳地址为10.0.6.2,出标签为50。

[SwitchB] static-lsp transit AtoC in-label 30 nexthop 10.0.6.2 out-label 50

# 为Egress节点 Switch C上配置一条名为AtoC的静态LSP,入标签为50。

[SwitchC] static-lsp egress AtoC in-label 50

(5)       创建从Switch C到Switch A的静态LSP

# 为Ingress节点Switch C配置一条到目的地址172.20.2.1/24的静态LSP,LSP的名称为CtoA,下一跳地址为10.0.6.1,出标签为40。

[SwitchC] static-lsp ingress CtoA destination 172.20.2.1 24 nexthop 10.0.6.1 out-label 40

# 为Transit节点Switch B配置一条名为CtoA的静态LSP,入标签为40,下一跳地址为10.0.3.1,出标签为70。

[SwitchB] static-lsp transit CtoA in-label 40 nexthop 10.0.3.1 out-label 70

# 为Egress节点 Switch A配置一条名为CtoA的静态LSP,入标签为70。

[SwitchA] static-lsp egress CtoA in-label 70

3.6  验证配置

# 配置完成后,可以在各交换机上通过display mpls static-lsp命令查看静态LSP的信息。以Switch A的显示信息为例:

[SwitchA] display mpls static-lsp

Total: 2

Name            FEC                In/Out Label Nexthop/Out Interface    State

AtoC            172.16.2.1/24      NULL/30      10.0.3.2                 Up

CtoA            -/-                70/NULL      -                        Up

# 在Switch A上检测Switch A到Switch C静态LSP的可达性。

[SwitchA] ping mpls -a 172.20.2.1 ipv4 172.16.2.0 24

MPLS ping FEC 172.16.2.0/24 with 100 bytes of data:

100 bytes from 10.0.6.2: Sequence=1 time=3 ms

100 bytes from 10.0.6.2: Sequence=2 time=2 ms

100 bytes from 10.0.6.2: Sequence=3 time=2 ms

100 bytes from 10.0.6.2: Sequence=4 time=2 ms

100 bytes from 10.0.6.2: Sequence=5 time=27 ms

 

--- Ping statistics for FEC 172.16.2.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 2/7/27 ms

# 在Switch C上检测Switch C到Switch A静态LSP的可达性。

[SwitchC] ping mpls -a 172.16.2.1 ipv4 172.20.2.0 24

MPLS ping FEC 172.20.2.0/24 with 100 bytes of data:

100 bytes from 10.0.3.2: Sequence=1 time=3 ms

100 bytes from 10.0.3.2: Sequence=2 time=2 ms

100 bytes from 10.0.3.2: Sequence=3 time=2 ms

100 bytes from 10.0.3.2: Sequence=4 time=2 ms

100 bytes from 10.0.3.2: Sequence=5 time=27 ms

 

--- Ping statistics for FEC 172.20.2.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 2/7/27 ms

3.7  配置文件

·            Switch A

#

 mpls lsr-id 1.1.1.9

#

vlan 3

#

vlan 10

#

interface LoopBack0

 ip address 1.1.1.9 255.255.255.255

#

interface Vlan-interface3

 ip address 10.0.3.1 255.255.255.0

 mpls enable

#

interface Vlan-interface10

 ip address 172.20.2.1 255.255.255.0

#

 ip route-static 172.16.2.1 255.255.255.0 10.0.3.2

#

 static-lsp ingress AtoC destination 172.16.2.1 24 nexthop 10.0.3.2 out-label 30

 static-lsp egress CtoA in-label 70

#

·            Switch B

#

 mpls lsr-id 2.2.2.9

#

vlan 3

#

vlan 6

#

interface LoopBack0

 ip address 2.2.2.9 255.255.255.255

#

interface Vlan-interface3

 ip address 10.0.3.2 255.255.255.0

 mpls enable

#

interface Vlan-interface6

 ip address 10.0.6.1 255.255.255.0

 mpls enable

#

 static-lsp transit AtoC in-label 30 nexthop 10.0.6.2 out-label 50

 static-lsp transit CtoA in-label 40 nexthop 10.0.3.1 out-label 70

#

·            Switch C

#

 mpls lsr-id 3.3.3.9

#

vlan 6

#

vlan 10

#

interface LoopBack0

 ip address 3.3.3.9 255.255.255.255

#

interface Vlan-interface6

 ip address 10.0.6.2 255.255.255.0

 mpls enable

#

interface Vlan-interface10

 ip address 172.16.2.1 255.255.255.0

#

 ip route-static 172.20.2.1 255.255.255.0 10.0.6.2

#

 static-lsp ingress CtoA destination 172.20.2.1 24 nexthop 10.0.6.1 out-label 40

 static-lsp egress AtoC in-label 50

#

4  利用LDP动态建立LSP配置举例

4.1  组网需求

图2所示,在运营商网络的MPLS区域中,PE 1和PE 2之间有两条路由可达,现要求:

·            在MPLS网络中配置LDP协议,动态建立LSP,使192.168.10.0/24网段与192.168.20.0/24网段之间转发的报文沿建立的LSP转发。

·            缺省情况下,报文通过LSP 1路径传输;当P 1故障时,报文通过LSP 2路径传输。

·            所有设备上只允许目的地址为1.1.1.1/32、2.2.2.2/32、3.3.3.3/32、4.4.4.4/32、5.5.5.5/32、192.168.10.0/24和192.168.20.0/24的路由表项触发LDP建立LSP,其他路由表项不能触发LDP建立LSP,以避免建立的LSP数量过多,影响设备性能。

图2 动态LSP配置组网图

 

4.2  配置思路

·            为了通过LDP动态创建LSP,需要配置路由协议,使得各设备间路由可达,本例中使用OSPF路由协议。

·            为了实现缺省情况下报文通过LSP 1路径传输,并且当P 1故障时,报文通过LSP 2路径传输,需要配置192.168.10.0/24和192.168.20.0/24之间的主路由为LSP 1,备份路由为LSP 2(本例通过配置OSPF路由协议来实现:使能OSPF协议后,会自动计算出LSP 1路径的开销小于LSP 2,所以走LSP 1)。

·            为了只允许目的地址为1.1.1.1/32、2.2.2.2/32、3.3.3.3/32、4.4.4.4/32、5.5.5.5/32、192.168.10.0/24和192.168.20.0/24的路由表项触发LDP建立LSP,需要配置LSP触发策略。

4.3  使用版本

本举例是在R6301版本上进行配置和验证的。

4.4  配置步骤

说明

进行下面配置之前,需要先关闭STP功能,或为每个VLAN映射一个MSTP实例。

 

(1)       配置各接口的IP地址

按照图2配置各接口的IP地址和掩码,包括LoopBack接口,具体配置过程略。

(2)       配置OSPF,以保证各交换机之间路由可达

# 配置PE 1。

[PE1] ospf

[PE1-ospf-1] area 0

[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0

[PE1-ospf-1-area-0.0.0.0] network 12.12.12.0 0.0.0.255

[PE1-ospf-1-area-0.0.0.0] network 14.14.14.0 0.0.0.255

[PE1-ospf-1-area-0.0.0.0] network 192.168.10.0 0.0.0.255

[PE1-ospf-1-area-0.0.0.0] quit

[PE1-ospf-1] quit

# 配置P 1。

[P1] ospf

[P1-ospf-1] area 0

[P1-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0

[P1-ospf-1-area-0.0.0.0] network 12.12.12.0 0.0.0.255

[P1-ospf-1-area-0.0.0.0] network 23.23.23.0 0.0.0.255

[P1-ospf-1-area-0.0.0.0] quit

[P1-ospf-1] quit

# 配置P 2。

[P2] ospf

[P2-ospf-1] area 0

[P2-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0

[P2-ospf-1-area-0.0.0.0] network 14.14.14.0 0.0.0.255

[P2-ospf-1-area-0.0.0.0] network 45.45.45.0 0.0.0.255

[P2-ospf-1-area-0.0.0.0] quit

[P2-ospf-1] quit

# 配置P 3。

[P3] ospf

[P3-ospf-1] area 0

[P3-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0

[P3-ospf-1-area-0.0.0.0] network 45.45.45.0 0.0.0.255

[P3-ospf-1-area-0.0.0.0] network 35.35.35.0 0.0.0.255

[P3-ospf-1-area-0.0.0.0] quit

[P3-ospf-1] quit

# 配置PE 2。

[PE2] ospf

[PE2-ospf-1] area 0

[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0

[PE2-ospf-1-area-0.0.0.0] network 23.23.23.0 0.0.0.255

[PE2-ospf-1-area-0.0.0.0] network 35.35.35.0 0.0.0.255

[PE2-ospf-1-area-0.0.0.0] network 192.168.20.0 0.0.0.255

[PE2-ospf-1-area-0.0.0.0] quit

[PE2-ospf-1] quit

# 配置完成后,在各交换机上执行display ospf routing命令,可以看到相互之间都学到了到对方的路由。以PE 1为例:

[PE1] display ospf routing

 

          OSPF Process 1 with Router ID 1.1.1.1

                   Routing Table

                Topology base (MTID 0)

 

 Routing for network

 Destination        Cost     Type    NextHop         AdvRouter       Area

 45.45.45.0/24      2        Transit 14.14.14.4      5.5.5.5         0.0.0.0

 35.35.35.0/24      3        Transit 14.14.14.4      5.5.5.5         0.0.0.0

 35.35.35.0/24      3        Transit 12.12.12.2      5.5.5.5         0.0.0.0

 192.168.10.0/24    1        Stub    192.168.10.1    1.1.1.1         0.0.0.0

 5.5.5.5/32         2        Stub    14.14.14.4      5.5.5.5         0.0.0.0

 14.14.14.0/24      1        Transit 14.14.14.1      4.4.4.4         0.0.0.0

 23.23.23.0/24      2        Transit 12.12.12.2      3.3.3.3         0.0.0.0

 4.4.4.4/32         1        Stub    14.14.14.4      4.4.4.4         0.0.0.0

 3.3.3.3/32         2        Stub    12.12.12.2      3.3.3.3         0.0.0.0

 12.12.12.0/24      1        Transit 12.12.12.1      2.2.2.2         0.0.0.0

 2.2.2.2/32         1        Stub    12.12.12.2      2.2.2.2         0.0.0.0

 1.1.1.1/32         0        Stub    1.1.1.1         1.1.1.1         0.0.0.0

 192.168.20.0/24    3        Stub    12.12.12.2      3.3.3.3         0.0.0.0

PE 1和P 1、P 2,P 2、P 3和PE 2之间应建立起OSPF邻居关系,执行display ospf peer verbose命令可以看到邻居达到FULL状态。以PE 1为例:

[PE1] display ospf peer verbose

          OSPF Process 1 with Router ID 1.1.1.1

                  Neighbors

 

 Area 0.0.0.0 interface 14.14.14.1(Vlan-interface14)'s neighbors

 Router ID: 4.4.4.4          Address: 14.14.14.4       GR state: Normal

   State: Full  Mode: Nbr is master  Priority: 1

   DR: 14.14.14.4  BDR: 14.14.14.1  MTU: 0

   Options is 0x42 (-|O|-|-|-|-|E|-)

   Dead timer due in 40  sec

   Neighbor is up for 00:03:30

   Authentication Sequence: [ 0 ]

   Neighbor state change count: 6

   BFD status: Disabled

 

                  Neighbors

 

 Area 0.0.0.0 interface 12.12.12.1(Vlan-interface12)'s neighbors

 Router ID: 2.2.2.2          Address: 12.12.12.2       GR state: Normal

   State: Full  Mode: Nbr is master  Priority: 1

   DR: 12.12.12.2  BDR: 12.12.12.1  MTU: 0

   Options is 0x42 (-|O|-|-|-|-|E|-)

   Dead timer due in 36  sec

   Neighbor is up for 00:03:24

   Authentication Sequence: [ 0 ]

   Neighbor state change count: 6

   BFD status: Disabled

 

 Last Neighbor Down Event:

 Router ID: 4.4.4.4

 Local Address: 14.14.14.1

 Remote Address: 14.14.14.4

 Time: May 14 09:07:19 2014

 Reason: Reset ospf command was performed

(3)       配置MPLS基本能力,并使能LDP

# 配置PE 1。

[PE1] mpls lsr-id 1.1.1.1

[PE1] mpls ldp

[PE1-ldp] quit

[PE1] interface vlan-interface 12

[PE1-Vlan-interface12] mpls enable

[PE1-Vlan-interface12] mpls ldp enable

[PE1-Vlan-interface12] quit

[PE1] interface vlan-interface 14

[PE1-Vlan-interface14] mpls enable

[PE1-Vlan-interface14] mpls ldp enable

[PE1-Vlan-interface14] quit

# 配置P 1。

[P1] mpls lsr-id 2.2.2.2

[P1] mpls ldp

[P1-ldp] quit

[P1] interface vlan-interface 12

[P1-Vlan-interface12] mpls enable

[P1-Vlan-interface12] mpls ldp enable

[P1-Vlan-interface12] quit

[P1] interface vlan-interface 23

[P1-Vlan-interface23] mpls enable

[P1-Vlan-interface23] mpls ldp enable

[P1-Vlan-interface23] quit

# 配置P 2。

[P2] mpls lsr-id 4.4.4.4

[P2] mpls ldp

[P2-ldp] quit

[P2] interface vlan-interface 14

[P2-Vlan-interface14] mpls enable

[P2-Vlan-interface14] mpls ldp enable

[P2-Vlan-interface14] quit

[P2] interface vlan-interface 45

[P2-Vlan-interface45] mpls enable

[P2-Vlan-interface45] mpls ldp enable

[P2-Vlan-interface45] quit

# 配置P 3。

[P3] mpls lsr-id 5.5.5.5

[P3] mpls ldp

[P3-ldp] quit

[P3] interface vlan-interface 45

[P3-Vlan-interface45] mpls enable

[P3-Vlan-interface45] mpls ldp enable

[P3-Vlan-interface45] quit

[P3] interface vlan-interface 35

[P3-Vlan-interface35] mpls enable

[P3-Vlan-interface35] mpls ldp enable

[P3-Vlan-interface35] quit

# 配置PE 2。

[PE2] mpls lsr-id 3.3.3.3

[PE2] mpls ldp

[PE2-ldp] quit

[PE2] interface vlan-interface 23

[PE2-Vlan-interface23] mpls enable

[PE2-Vlan-interface23] mpls ldp enable

[PE2-Vlan-interface23] quit

[PE2] interface vlan-interface 35

[PE2-Vlan-interface35] mpls enable

[PE2-Vlan-interface35] mpls ldp enable

[PE2-Vlan-interface35] quit

完成上述配置后,PE 1和P 1、P 2,P 2、P 3和PE 2之间的本地LDP会话建立成功。

在各设备上执行display mpls ldp peer命令,可以看到LDP的对等体情况,Operational表示成功建立会话。以PE 1为例:

[PE1 display mpls ldp peer

Total number of peers: 2

Peer LDP ID             State         Role     GR   MD5  KA Sent/Rcvd

2.2.2.2:0               Operational   Passive  Off  Off  55/55

4.4.4.4:0               Operational   Passive  Off  Off  6/6

(4)       配置LSP的触发策略,为目的地址为1.1.1.1/32、2.2.2.2/32、3.3.3.3/32、4.4.4.4/32、5.5.5.5/32、192.168.10.0/24和192.168.20.0/24的路由表项建立LSP。

# 在PE 1上创建IP地址前缀列表PE1,并配置只有通过该列表过滤的路由表项能够触发LDP建立LSP。

[PE1] ip prefix-list PE1 index 10 permit 1.1.1.1 32

[PE1] ip prefix-list PE1 index 20 permit 2.2.2.2 32

[PE1] ip prefix-list PE1 index 30 permit 3.3.3.3 32

[PE1] ip prefix-list PE1 index 40 permit 4.4.4.4 32

[PE1] ip prefix-list PE1 index 50 permit 5.5.5.5 32

[PE1] ip prefix-list PE1 index 60 permit 192.168.10.0 24

[PE1] ip prefix-list PE1 index 70 permit 192.168.20.0 24

[PE1] mpls ldp

[PE1-ldp] lsp-trigger prefix-list PE1

[PE1-ldp] quit

# 在P 1上创建IP地址前缀列表P1,并配置只有通过该列表过滤的路由表项能够触发LDP建立LSP。

[P1] ip prefix-list P1 index 10 permit 1.1.1.1 32

[P1] ip prefix-list P1 index 20 permit 2.2.2.2 32

[P1] ip prefix-list P1 index 30 permit 3.3.3.3 32

[P1] ip prefix-list P1 index 40 permit 4.4.4.4 32

[P1] ip prefix-list P1 index 50 permit 5.5.5.5 32

[P1] ip prefix-list P1 index 60 permit 192.168.10.0 24

[P1] ip prefix-list P1 index 70 permit 192.168.20.0 24

[P1] mpls ldp

[P1-ldp] lsp-trigger prefix-list P1

[P1-ldp] quit

# 在P 2上创建IP地址前缀列表P2,并配置只有通过该列表过滤的路由表项能够触发LDP建立LSP。

[P2] ip prefix-list P2 index 10 permit 1.1.1.1 32

[P2] ip prefix-list P2 index 20 permit 2.2.2.2 32

[P2] ip prefix-list P2 index 30 permit 3.3.3.3 32

[P2] ip prefix-list P2 index 40 permit 4.4.4.4 32

[P2] ip prefix-list P2 index 50 permit 5.5.5.5 32

[P2] ip prefix-list P2 index 60 permit 192.168.10.0 24

[P2] ip prefix-list P2 index 70 permit 192.168.20.0 24

[P2] mpls ldp

[P2-ldp] lsp-trigger prefix-list P2

[P2-ldp] quit

# 在P 3上创建IP地址前缀列表P3,并配置只有通过该列表过滤的路由表项能够触发LDP建立LSP。

[P3] ip prefix-list P3 index 10 permit 1.1.1.1 32

[P3] ip prefix-list P3 index 20 permit 2.2.2.2 32

[P3] ip prefix-list P3 index 30 permit 3.3.3.3 32

[P3] ip prefix-list P3 index 40 permit 4.4.4.4 32

[P3] ip prefix-list P3 index 50 permit 5.5.5.5 32

[P3] ip prefix-list P3 index 60 permit 192.168.10.0 24

[P3] ip prefix-list P3 index 70 permit 192.168.20.0 24

[P3] mpls ldp

[P3-ldp] lsp-trigger prefix-list P3

[P3-ldp] quit

# 在PE 2上创建IP地址前缀列表PE 2,并配置只有通过该列表过滤的路由表项能够触发LDP建立LSP。

[PE2] ip prefix-list PE2 index 10 permit 1.1.1.1 32

[PE2] ip prefix-list PE2 index 20 permit 2.2.2.2 32

[PE2] ip prefix-list PE2 index 30 permit 3.3.3.3 32

[PE2] ip prefix-list PE2 index 40 permit 4.4.4.4 32

[PE2] ip prefix-list PE2 index 50 permit 5.5.5.5 32

[PE2] ip prefix-list PE2 index 60 permit 192.168.10.0 24

[PE2] ip prefix-list PE2 index 70 permit 192.168.20.0 24

[PE2] mpls ldp

[PE2-ldp] lsp-trigger prefix-list PE2

[PE2-ldp] quit

4.5  验证配置

配置完成后,在PE 1上执行display mpls ldp lsp命令,查看LDP LSP的建立情况,可以看到去往192.168.20.0/24网段的LSP缺省下一跳指向P 1。

[PE1] display mpls ldp lsp

Status Flags: * - stale, L - liberal

Statistics:

  FECs: 7      Ingress LSPs: 5     Transit LSPs: 5     Egress LSPs: 2

 

FEC                In/Out Label    Nexthop         OutInterface

1.1.1.1/32         3/-

                   -/1151(L)

                   -/1151(L)

2.2.2.2/32         -/3             12.12.12.2      Vlan12

                   1151/3          12.12.12.2      Vlan12

                   -/1150(L)

3.3.3.3/32         -/1150          12.12.12.2      Vlan12

                   1150/1150       12.12.12.2      Vlan12

                   -/1148(L)

4.4.4.4/32         -/1149(L)

                   -/3             14.14.14.4      Vlan14

                   1149/3          14.14.14.4      Vlan14

5.5.5.5/32         -/1148(L)

                   -/1149          14.14.14.4      Vlan14

                   1148/1149       14.14.14.4      Vlan14

192.168.10.0/24    1147/-

192.168.20.0/24    -/1147          12.12.12.2      Vlan12

                   1146/1147       12.12.12.2      Vlan12

                   -/1147(L)

# 当P1故障时,在PE1上执行display mpls ldp lsp命令,查看LDP LSP的变化,可以看到去往192.168.20.0/24网段的LSP下一跳指向P2。

[PE1] display mpls ldp lsp

Status Flags: * - stale, L - liberal

Statistics:

  FECs: 7      Ingress LSPs: 5     Transit LSPs: 5     Egress LSPs: 2

 

FEC                In/Out Label    Nexthop         OutInterface

1.1.1.1/32         3/-

                   -/1150(L)

2.2.2.2/32         -/1149          14.14.14.4      Vlan14

                   1150/1149       14.14.14.4      Vlan14

3.3.3.3/32         -/1148          14.14.14.4      Vlan14

                   1147/1148       14.14.14.4      Vlan14

4.4.4.4/32         -/3             14.14.14.4      Vlan14

                   1149/3          14.14.14.4      Vlan14

5.5.5.5/32         -/1151          14.14.14.4      Vlan14

                   1148/1151       14.14.14.4      Vlan14

192.168.10.0/24    1151/-

                   -/1146(L)

192.168.20.0/24    -/1147          14.14.14.4      Vlan14

                   1146/1147       14.14.14.4      Vlan14

# 使用MPLS ping检测MPLS LSP的有效性和可达性。

[PE1] ping mpls -a 192.168.10.1 ipv4 192.168.20.0 24

MPLS ping FEC 192.168.20.0/24 with 100 bytes of data:

100 bytes from 23.23.23.3: Sequence=1 time=2 ms

100 bytes from 23.23.23.3: Sequence=2 time=2 ms

100 bytes from 23.23.23.3: Sequence=3 time=2 ms

100 bytes from 23.23.23.3: Sequence=4 time=2 ms

100 bytes from 23.23.23.3: Sequence=5 time=2 ms

 

--- Ping statistics for FEC 192.168.20.0/24 ---

5 packets transmitted, 5 packets received, 0.0% packet loss

Round-trip min/avg/max = 2/2/2 ms

4.6  配置文件

·            PE1

#

ospf 1

 area 0.0.0.0

  network 1.1.1.1 0.0.0.0

  network 12.12.12.0 0.0.0.255

  network 14.14.14.0 0.0.0.255

  network 192.168.10.0 0.0.0.255

#

 mpls lsr-id 1.1.1.1

#

vlan 10

#

vlan 12

#

vlan 14

#

mpls ldp

 lsp-trigger prefix-list PE1

#

interface LoopBack0

 ip address 1.1.1.1 255.255.255.255

#

interface Vlan-interface10

 ip address 192.168.10.1 255.255.255.0

#

interface Vlan-interface12

 ip address 12.12.12.1 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface14

 ip address 14.14.14.1 255.255.255.0

 mpls enable

 mpls ldp enable

#

 ip prefix-list PE1 index 10 permit 1.1.1.1 32

 ip prefix-list PE1 index 20 permit 2.2.2.2 32

 ip prefix-list PE1 index 30 permit 3.3.3.3 32

 ip prefix-list PE1 index 40 permit 4.4.4.4 32

 ip prefix-list PE1 index 50 permit 5.5.5.5 32

 ip prefix-list PE1 index 60 permit 192.168.10.0 24

 ip prefix-list PE1 index 70 permit 192.168.20.0 24

#

·            P 1

#

ospf 1

 area 0.0.0.0

  network 2.2.2.2 0.0.0.0

  network 12.12.12.0 0.0.0.255

  network 23.23.23.0 0.0.0.255

#

 mpls lsr-id 2.2.2.2

#

vlan 12

#

vlan 23

#

mpls ldp

 lsp-trigger prefix-list P1

#

interface LoopBack0

 ip address 2.2.2.2 255.255.255.255

#

interface Vlan-interface12

 ip address 12.12.12.2 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface23

 ip address 23.23.23.2 255.255.255.0

 mpls enable

 mpls ldp enable

#

#

 ip prefix-list P1 index 10 permit 1.1.1.1 32

 ip prefix-list P1 index 20 permit 2.2.2.2 32

 ip prefix-list P1 index 30 permit 3.3.3.3 32

 ip prefix-list P1 index 40 permit 4.4.4.4 32

 ip prefix-list P1 index 50 permit 5.5.5.5 32

 ip prefix-list P1 index 60 permit 192.168.10.0 24

 ip prefix-list P1 index 70 permit 192.168.20.0 24

#

·            P 2

#

ospf 1

 area 0.0.0.0

  network 4.4.4.4 0.0.0.0

  network 14.14.14.0 0.0.0.255

  network 45.45.45.0 0.0.0.255

#

 mpls lsr-id 4.4.4.4

#

vlan 14

#

vlan 45

#

mpls ldp

 lsp-trigger prefix-list P2

#

interface LoopBack0

 ip address 4.4.4.4 255.255.255.255

#

interface Vlan-interface14

 ip address 14.14.14.4 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface45

 ip address 45.45.45.4 255.255.255.0

 mpls enable

 mpls ldp enable

#

 ip prefix-list P1 index 10 permit 1.1.1.1 32

 ip prefix-list P1 index 20 permit 2.2.2.2 32

 ip prefix-list P1 index 30 permit 3.3.3.3 32

 ip prefix-list P1 index 40 permit 4.4.4.4 32

 ip prefix-list P1 index 50 permit 5.5.5.5 32

 ip prefix-list P1 index 60 permit 192.168.10.0 24

 ip prefix-list P1 index 70 permit 192.168.20.0 24

#

·            P 3

#

ospf 1

 area 0.0.0.0

  network 5.5.5.5 0.0.0.0

  network 35.35.35.0 0.0.0.255

  network 45.45.45.0 0.0.0.255

#

 mpls lsr-id 5.5.5.5

#

vlan 35

#

vlan 45

#

mpls ldp

 lsp-trigger prefix-list P1

#

interface LoopBack0

 ip address 2.2.2.2 255.255.255.255

#

interface Vlan-interface35

 ip address 35.35.35.5 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface45

 ip address 45.45.45.5 255.255.255.0

 mpls enable

 mpls ldp enable

#

 ip prefix-list P1 index 10 permit 1.1.1.1 32

 ip prefix-list P1 index 20 permit 2.2.2.2 32

 ip prefix-list P1 index 30 permit 3.3.3.3 32

 ip prefix-list P1 index 40 permit 4.4.4.4 32

 ip prefix-list P1 index 50 permit 5.5.5.5 32

 ip prefix-list P1 index 60 permit 192.168.10.0 24

 ip prefix-list P1 index 70 permit 192.168.20.0 24

#

·            PE 2

#

ospf 1

 area 0.0.0.0

  network 3.3.3.3 0.0.0.0

  network 23.23.23.0 0.0.0.255

  network 35.35.35.0 0.0.0.255

  network 192.168.20.0 0.0.0.255

#

 mpls lsr-id 3.3.3.3

#

vlan 20

#

vlan 23

#

vlan 35

#

mpls ldp

 lsp-trigger prefix-list PE2

#

interface LoopBack0

 ip address 3.3.3.3 255.255.255.255

#

interface Vlan-interface20

 ip address 192.168.20.1 255.255.255.0

#

interface Vlan-interface23

 ip address 23.23.23.3 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface35

 ip address 35.35.35.3 255.255.255.0

mpls enable

 mpls ldp enable

#

 ip prefix-list P1 index 10 permit 1.1.1.1 32

 ip prefix-list P1 index 20 permit 2.2.2.2 32

 ip prefix-list P1 index 30 permit 3.3.3.3 32

 ip prefix-list P1 index 40 permit 4.4.4.4 32

 ip prefix-list P1 index 50 permit 5.5.5.5 32

 ip prefix-list P1 index 60 permit 192.168.10.0 24

 ip prefix-list P1 index 70 permit 192.168.20.0 24

#

5  相关资料

·            H3C S6800[60][61](R27xx) & S6820(R630x)系列以太网交换机 MPLS配置指导

·            H3C S6800[60][61](R27xx) & S6820(R630x)系列以太网交换机 MPLS命令参考

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们