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

H3C VSR1000虚拟路由器典型配置举例-6W100

目录

17-H3C VSR1000虚拟路由器MPLS基础典型配置举例

本章节下载 17-H3C VSR1000虚拟路由器MPLS基础典型配置举例  (220.25 KB)

docurl=/cn/Service/Document_Software/Document_Center/Routers/Catalog/NFV/H3C_VSR/Configure/Typical_Configuration_Example/H3C_VSR1000_CE-6W100/201411/845104_30005_0.htm

17-H3C VSR1000虚拟路由器MPLS基础典型配置举例

H3C VSR1000虚拟路由器MPLS基础配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

H3C_彩色.emf

 



1  简介

本文档介绍通过静态方式和LDP(Label Distribution Protocol,标签分发协议)方式建立LSP的典型配置举例。

2  配置前提

本文档不严格与具体软件版本对应,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。

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

本文档假设您已了解静态MPLS和LDP特性。

3  静态LSP配置举例

3.1  组网需求

图1所示,运营商网络运行MPLS,Router A和Router 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  使用版本

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

3.4  配置注意事项

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

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

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

3.5  配置步骤

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

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

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

# 配置Router A。

<RouterA> system-view

[RouterA] ip route-static 172.16.2.0 24 10.1.1.2

# 配置Router C。

<RouterC> system-view

[RouterC] ip route-static 172.20.2.0 24 20.1.1.1

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

[RouterA] display ip routing-table

 

Destinations : 18        Routes : 18

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

1.1.1.9/32         Direct  0   0           127.0.0.1       InLoop0

10.1.1.0/24        Direct  0   0           10.1.1.1        GE2/0

10.1.1.0/32        Direct  0   0           10.1.1.1        GE2/0

10.1.1.1/32        Direct  0   0           127.0.0.1       InLoop0

10.1.1.255/32      Direct  0   0           10.1.1.1        GE2/0

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

172.16.2.0/24      Static  60  0           10.1.1.2        GE2/0

172.20.2.0/24      Direct  0   0           172.20.2.1      GE1/0

172.20.2.0/32      Direct  0   0           172.20.2.1      GE1/0

172.20.2.1/32      Direct  0   0           127.0.0.1       InLoop0

172.20.2.255/32    Direct  0   0           172.20.2.1      GE1/0

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功能

# 配置Router A。

[RouterA] mpls lsr-id 1.1.1.9

[RouterA] interface gigabitethernet 2/0

[RouterA-GigabitEthernet2/0] mpls enable

[RouterA-GigabitEthernet2/0] quit

# 配置Router B。

[RouterB] mpls lsr-id 2.2.2.9

[RouterB] interface gigabitethernet 1/0

[RouterB-GigabitEthernet1/0] mpls enable

[RouterB-GigabitEthernet1/0] quit

[RouterB] interface gigabitethernet 2/0

[RouterB-GigabitEthernet2/0] mpls enable

[RouterB-GigabitEthernet2/0] quit

# 配置Router C。

[RouterC] mpls lsr-id 3.3.3.9

[RouterC] interface gigabitethernet 1/0

[RouterC-GigabitEthernet1/0] mpls enable

[RouterC-GigabitEthernet1/0] quit

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

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

[RouterA] static-lsp ingress AtoC destination 172.16.2.1 24 nexthop 10.1.1.2 out-label 30

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

[RouterB] static-lsp transit AtoC in-label 30 nexthop 20.1.1.2 out-label 50

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

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

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

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

[RouterC] static-lsp ingress CtoA destination 172.20.2.1 24 nexthop 20.1.1.1 out-label 40

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

[RouterB] static-lsp transit CtoA in-label 40 nexthop 10.1.1.1 out-label 70

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

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

3.6  验证配置

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

[RouterA] display mpls static-lsp

Total: 2

Name            FEC                In/Out Label Nexthop/Out Interface    State

AtoC            172.16.2.0/24      NULL/30      10.1.1.2                 Up

CtoA            -/-                70/NULL      -                        Up

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

[RouterA] 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 20.1.1.2: Sequence=1 time=3 ms

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

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

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

100 bytes from 20.1.1.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

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

[RouterC] 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.1.1.1: Sequence=1 time=3 ms

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

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

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

100 bytes from 10.1.1.1: 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  配置文件

·     Router A:

#

 mpls lsr-id 1.1.1.9

#

interface LoopBack0

 ip address 1.1.1.9 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 172.20.2.1 255.255.255.0

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 10.1.1.1 255.255.255.0

 mpls enable

#

 ip route-static 172.16.2.0 24 10.1.1.2

#

 static-lsp ingress AtoC destination 172.16.2.0 24 nexthop 10.1.1.2 out-label 30

 static-lsp egress CtoA in-label 70

#

·     Router B:

#

 mpls lsr-id 2.2.2.9

#

interface LoopBack0

 ip address 2.2.2.9 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 10.1.1.2 255.255.255.0

 mpls enable

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 20.1.1.1 255.255.255.0

 mpls enable

#

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

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

#

·     Router C:

#

 mpls lsr-id 3.3.3.9

#

interface LoopBack0

 ip address 3.3.3.9 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 20.1.1.2 255.255.255.0

 mpls enable

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 172.16.2.1 255.255.255.0

#

 ip route-static 172.20.2.1 255.255.255.0 20.1.1.1

#

 static-lsp ingress CtoA destination 172.20.2.0 24 nexthop 20.1.1.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  使用版本

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

4.4  配置步骤

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

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

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

# 配置PE 1。

[PE1] ospf 1

[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 1

[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 1

[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 1

[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 1

[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

 

 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

 

 Total nets: 13

 Intra area: 13  Inter area: 0  ASE: 0  NSSA: 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(GigabitEthernet2/0)'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(GigabitEthernet1/0)'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

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

# 配置PE 1。

[PE1] mpls lsr-id 1.1.1.1

[PE1] mpls ldp

[PE1-ldp] quit

[PE1] interface gigabitethernet 1/0

[PE1-GigabitEthernet1/0] mpls enable

[PE1-GigabitEthernet1/0] mpls ldp enable

[PE1-GigabitEthernet1/0] quit

[PE1] interface gigabitethernet 2/0

[PE1-GigabitEthernet2/0] mpls enable

[PE1-GigabitEthernet2/0] mpls ldp enable

[PE1-GigabitEthernet2/0] quit

# 配置P 1。

[P1] mpls lsr-id 2.2.2.2

[P1] mpls ldp

[P1-ldp] quit

[P1] interface gigabitethernet 1/0

[P1-GigabitEthernet1/0] mpls enable

[P1-GigabitEthernet1/0] mpls ldp enable

[P1-GigabitEthernet1/0] quit

[P1] interface gigabitethernet 2/0

[P1-GigabitEthernet2/0] mpls enable

[P1-GigabitEthernet2/0] mpls ldp enable

[P1-GigabitEthernet2/0] quit

# 配置P 2。

[P2] mpls lsr-id 4.4.4.4

[P2] mpls ldp

[P2-ldp] quit

[P2] interface gigabitethernet 1/0

[P2-GigabitEthernet1/0] mpls enable

[P2-GigabitEthernet1/0] mpls ldp enable

[P2-GigabitEthernet1/0] quit

[P2] interface gigabitethernet 2/0

[P2-GigabitEthernet2/0] mpls enable

[P2-GigabitEthernet2/0] mpls ldp enable

[P2-GigabitEthernet2/0] quit

# 配置P 3。

[P3] mpls lsr-id 5.5.5.5

[P3] mpls ldp

[P3-ldp] quit

[P3] interface gigabitethernet 1/0

[P3-GigabitEthernet1/0] mpls enable

[P3-GigabitEthernet1/0] mpls ldp enable

[P3-GigabitEthernet1/0] quit

[P3] interface gigabitethernet 2/0

[P3-GigabitEthernet2/0] mpls enable

[P3-GigabitEthernet2/0] mpls ldp enable

[P3-GigabitEthernet2/0] quit

# 配置PE 2。

[PE2] mpls lsr-id 3.3.3.3

[PE2] mpls ldp

[PE2-ldp] quit

[PE2] interface gigabitethernet 1/0

[PE2-GigabitEthernet1/0] mpls enable

[PE2-GigabitEthernet1/0] mpls ldp enable

[PE2-GigabitEthernet1/0] quit

[PE2] interface gigabitethernet 2/0

[PE2-GigabitEthernet2/0] mpls enable

[PE2-GigabitEthernet2/0] mpls ldp enable

[PE2-GigabitEthernet2/0] quit

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

在各设备上执行display mpls ldp peer命令,可以看到LDP的对等体情况。以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, B - backup

  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      GE1/0

                   1151/3          12.12.12.2      GE1/0

                   -/1150(L)

3.3.3.3/32         -/1150          12.12.12.2      GE1/0

                   1150/1150       12.12.12.2      GE1/0

                   -/1148(L)

4.4.4.4/32         -/1149(L)

                   -/3             14.14.14.4      GE2/0

                   1149/3          14.14.14.4      GE2/0

5.5.5.5/32         -/1148(L)

                   -/1149          14.14.14.4      GE2/0

                   1148/1149       14.14.14.4      GE2/0

192.168.10.0/24    1145/-

                   -/1146(L)

                   -/1146(L)

192.168.20.0/24    -/1147          12.12.12.2      GE1/0

                   1146/1147       12.12.12.2      GE1/0

                   -/1147(L)

# 使用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

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

[PE1] display mpls ldp lsp

Status Flags: * - stale, L - liberal, B - backup

  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      GE2/0

                   1150/1149       14.14.14.4      GE2/0

3.3.3.3/32         -/1148          14.14.14.4      GE2/0

                   1147/1148       14.14.14.4      GE2/0

4.4.4.4/32         -/3             14.14.14.4      GE2/0

                   1149/3          14.14.14.4      GE2/0

5.5.5.5/32         -/1151          14.14.14.4      GE2/0

                   1148/1151       14.14.14.4      GE2/0

192.168.10.0/24    1151/-

                   -/1146(L)

                   -/1146(L)

192.168.20.0/24    -/1147          14.14.14.4      GE2/0

                   1146/1147       14.14.14.4      GE2/0

# 使用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 35.35.35.3: Sequence=1 time=1 ms

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

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

100 bytes from 35.35.35.3: Sequence=4 time=1 ms

100 bytes from 35.35.35.3: Sequence=5 time=1 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 = 1/1/1 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

#

mpls ldp

 lsp-trigger prefix-list PE1

#

interface LoopBack0

 ip address 1.1.1.1 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 12.12.12.1 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 14.14.14.1 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface GigabitEthernet3/0

 port link-mode route

 ip address 192.168.10.1 255.255.255.0

#

 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

#

mpls ldp

 lsp-trigger prefix-list P1

#

interface LoopBack0

 ip address 2.2.2.2 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 12.12.12.2 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface GigabitEthernet2/0

 port link-mode route

 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

#

mpls ldp

 lsp-trigger prefix-list P2

#

interface LoopBack0

 ip address 4.4.4.4 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 45.45.45.4 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 14.14.14.4 255.255.255.0

 mpls enable

 mpls ldp enable

#

 ip prefix-list P2 index 10 permit 1.1.1.1 32

 ip prefix-list P2 index 20 permit 2.2.2.2 32

 ip prefix-list P2 index 30 permit 3.3.3.3 32

 ip prefix-list P2 index 40 permit 4.4.4.4 32

 ip prefix-list P2 index 50 permit 5.5.5.5 32

 ip prefix-list P2 index 60 permit 192.168.10.0 24

 ip prefix-list P2 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

#

mpls ldp

 lsp-trigger prefix-list P3

#

interface LoopBack0

 ip address 2.2.2.2 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 35.35.35.5 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 45.45.45.5 255.255.255.0

 mpls enable

 mpls ldp enable

#

 ip prefix-list P3 index 10 permit 1.1.1.1 32

 ip prefix-list P3 index 20 permit 2.2.2.2 32

 ip prefix-list P3 index 30 permit 3.3.3.3 32

 ip prefix-list P3 index 40 permit 4.4.4.4 32

 ip prefix-list P3 index 50 permit 5.5.5.5 32

 ip prefix-list P3 index 60 permit 192.168.10.0 24

 ip prefix-list P3 index 70 permit 192.168.20.0 24

#

·     PE2:

#

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 33.0.0.0 0.0.0.255

  network 192.168.20.0 0.0.0.255

#

 mpls lsr-id 3.3.3.3

#

mpls ldp

 lsp-trigger prefix-list PE2

#

interface LoopBack0

 ip address 3.3.3.3 255.255.255.255

#

interface GigabitEthernet1/0

 port link-mode route

 ip address 35.35.35.3 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface GigabitEthernet2/0

 port link-mode route

 ip address 23.23.23.3 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface GigabitEthernet3/0

 port link-mode route

 ip address 192.168.20.1 255.255.255.0

#

 ip prefix-list PE2 index 10 permit 1.1.1.1 32

 ip prefix-list PE2 index 20 permit 2.2.2.2 32

 ip prefix-list PE2 index 30 permit 3.3.3.3 32

 ip prefix-list PE2 index 40 permit 4.4.4.4 32

 ip prefix-list PE2 index 50 permit 5.5.5.5 32

 ip prefix-list PE2 index 60 permit 192.168.10.0 24

 ip prefix-list PE2 index 70 permit 192.168.20.0 24

#

5  相关资料

·     《H3C VSR1000虚拟路由器配置指导》中的“MPLS配置指导”

·     《H3C VSR1000虚拟路由器命令参考》中的“MPLS命令参考”

 

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

新华三官网
联系我们