H3C S12500X-AF系列交换机 典型配置举例(R26xx系列)-6W100

目录

59-MPLS OAM典型配置举例

本章节下载 59-MPLS OAM典型配置举例  (270.81 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500X-AF/Configure/Typical_Configuration_Example/H3C_S12500X-AF_CE(R26xx)-6W100/201703/976313_30005_0.htm

59-MPLS OAM典型配置举例

H3C S12500X-AF产品MPLS OAM典型配置举例

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2017 杭州华三通信技术有限公司 版权所有,保留一切权利。

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

并不得以任何形式传播。本文档中的信息可能变动,恕不另行通知。

H3C_彩色.emf

 



1  简介

本文档介绍MPLS OAM配置举例。

MPLS OAM(Operations, Administration and Maintenance,操作、管理和维护)功能为MPLS网络提供了数据平面连通性检测、数据平面与控制平面一致性校验、故障点定位等多种错误管理(Fault Management)工具。MPLS OAM利用这些错误管理工具对LSP、MPLS TE隧道和MPLS PW进行检测和故障定位,降低了MPLS网络的管理和维护的复杂度,提高了MPLS网络的可用性。

2  配置前提

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

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

3  BFD检测LSP典型配置举例

3.1  组网需求

图1所示,某公司有两个位于不同的地理位置的分支机构通过运营商的MPLS骨干网互联,两个分支机构之间需要进行实时业务的同步传输。该公司要求运营商提供高可靠性的服务,以保证实时业务的不间断性。

为满足该用户需求,可通过在MPLS骨干网中部署LDP FRR服务来提供主备两条LSP链路,并配置LDP与BFD联动技术提高主备链路的切换速度,具体实现如下:

·     正常情况下,使用主LSP链路转发PE 1和PE 2之间的流量。

·     使用BFD对主链路进行监测,当主链路发生故障时,BFD能够快速感知并通告LDP协议,使得PE 1和PE 2之间的流量迅速切换到备LSP链路进行转发。

图1 BFD检测LSP配置组网图

3.2  使用版本

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

3.3  配置注意事项

进行本案例配置之前,需要先全局关闭STP功能,或为每个VLAN映射一个MSTP实例,否则可能会阻断环路中的一条链路。

3.4  配置步骤

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

# 按照图1配置各接口的IP地址和掩码,包括LoopBack接口,下面以PE 1为例,其它设备配置方法类似,具体配置过程略。

<PE1> system-view

[PE1] interface hundredgige 1/0/3

[PE1-HundredGigE1/0/3] undo shutdown

[PE1-HundredGigE1/0/3] quit

[PE1] vlan 10

[PE1-vlan10] port hundredgige 1/0/3

[PE1-vlan10] quit

[PE1] interface vlan-interface 10

[PE1-Vlan-interface10] ip address 192.168.10.1 24

[PE1-Vlan-interface10] undo shutdown

[PE1-Vlan-interface10] quit

[PE1] interface hundredgige 1/0/1

[PE1-HundredGigE1/0/1] undo shutdown

[PE1-HundredGigE1/0/1] quit

[PE1] vlan 12

[PE1-vlan12] port hundredgige 1/0/1

[PE1-vlan12] quit

[PE1] interface vlan-interface 12

[PE1-Vlan-interface12] ip address 12.12.12.1 24

[PE1-Vlan-interface12] undo shutdown

[PE1-Vlan-interface12] quit

[PE1] interface hundredgige 1/0/2

[PE1-HundredGigE1/0/2] undo shutdown

[PE1-HundredGigE1/0/2] quit

[PE1] vlan 14

[PE1-vlan14] port hundredgige 1/0/2

[PE1-vlan14] quit

[PE1] interface vlan-interface 14

[PE1-Vlan-interface14] ip address 14.14.14.1 24

[PE1-Vlan-interface14] undo shutdown

[PE1-Vlan-interface14] quit

[PE1] interface loopback 0

[PE1-LoopBack0] ip address 1.1.1.1 32

[PE1-LoopBack0] quit

(2)     在MPLS骨干网内配置OSPF,以保证各路由器之间路由可达,并使能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] fast-reroute lfa

[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

# 配置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 34.34.34..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] fast-reroute lfa

[PE2-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 34.34.34.0 0.0.0.255

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

[P2-ospf-1] quit

# 调整P 2上Vlan-interface14和Vlan-interface34的OSPF cost值,使备份LSP路径上的OSPF开销值大于主LSP路径。

[P2] interface vlan-interface 14

[P2-Vlan-interface14] ospf cost 10

[P2-Vlan-interface14] quit

[P2] interface vlan-interface 34

[P2-Vlan-interface34] ospf cost 10

[P2-Vlan-interface34] quit

(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

# 配置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 34

[PE2-Vlan-interface34] mpls enable

[PE2-Vlan-interface34] mpls ldp enable

[PE2-Vlan-interface34] 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 34

[P2-Vlan-interface34] mpls enable

[P2-Vlan-interface34] mpls ldp enable

[P2-Vlan-interface34] quit

完成上述配置后,在各设备上可以看到LDP会话的状态为operational,会话建立成功。以PE1为例:

[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的触发策略,为目的地址为192.168.10.0/24、192.168.20.0/24、1.1.1.1/32和3.3.3.3/32的路由表项建立LSP

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

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

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

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

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

[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 192.168.10.0 24

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

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

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

[P1] mpls ldp

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

[P1-ldp] quit

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

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

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

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

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

[PE2] mpls ldp

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

[PE2-ldp] quit

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

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

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

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

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

[P2] mpls ldp

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

[P2-ldp] quit

# 配置完成后,在PE 1上执行display mpls ldp lsp命令,查看LDP LSP的建立情况,可以看到去往192.168.20.0/24网段的两条LSP已经建立完成,出接口为Vlan-interface12的LSP为主LSP,出接口为Vlan-interface14的LSP为备用LSP。

[PE1]display mpls ldp lsp

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

Statistics:

  FECs: 4      Ingress LSPs: 4     Transit LSPs: 4     Egress LSPs: 2

 

FEC                In/Out Label        Nexthop         OutInterface

1.1.1.1/32         3/-

                   -/1151(L)

                   -/1279(L)

3.3.3.3/32         -/1150              12.12.12.2      Vlan12

                   1150/1150           12.12.12.2      Vlan12

                   -/1150(B)           12.12.12.2      Vlan14

                   1150/1150(B)        12.12.12.2      Vlan14

192.168.10.0/24    1141/-

                   -/1141(L)

                   -/1141(L)

192.168.20.0/24    -/1133              12.12.12.2      Vlan12

                   1133/1133           12.12.12.2      Vlan12

                   -/1133(B)           14.14.14.4      Vlan14

                   1133/1133(B)        14.14.14.4      Vlan14

(5)     使能MPLS与BFD联动功能,并配置通过BFD检测LSP的连通性

# 配置PE 1。

[PE1] mpls bfd enable

[PE1] mpls bfd 3.3.3.3 32

# 配置PE 2。

[PE2] mpls bfd enable

[PE2] mpls bfd 1.1.1.1 32

3.5  验证配置

(1)     配置完成后,在设备PE 1和PE 2上执行display mpls bfd命令,可以看到检测LSP的BFD会话的建立情况。以PE 1为例。

[PE1]display mpls bfd

 Total number of sessions: 2, 2 up, 0 down, 0 init

 

 FEC Type: LSP

 FEC Info:

   Destination: 1.1.1.1

   Mask Length: 32

 NHLFE ID: -

 Local Discr: 1026                   Remote Discr: 514

 Source IP: 1.1.1.1                  Destination IP: 3.3.3.3

 Session State: Up                   Session Role: Active

 Template Name: -

 

 FEC Type: LSP

 FEC Info:

   Destination: 3.3.3.3

   Mask Length: 32

 NHLFE ID: 1028

 Local Discr: 1025                   Remote Discr: -

 Source IP: 1.1.1.1                  Destination IP: 127.0.0.1

 Session State: Up                   Session Role: Passive

 Template Name: -

(2)     在PE 1上使用tracert mpls ipv4命令查看到当前所使用的路径是主LSP。(使用Tracert功能需要在中间设备上开启ICMP超时报文发送功能,在目的端开启ICMP目的不可达报文发送功能)

<PE1>tracert mpls -a 192.168.10.1 ipv4 192.168.20.0 24

MPLS trace route FEC 192.168.20.0/24

  TTL   Replier            Time    Type      Downstream

  0                                Ingress   12.12.12.2/[1148]

  1     12.12.12.2         2 ms    Transit   23.23.23.3/[1148]

  2     23.23.23.3         2 ms    Egress

(3)     在PE 1上持续ping PE 2,期间将P 1的Vlan-interface23接口shutdown,查看通信是否中断。

#在PE 1上持续ping PE 2,

<PE1> ping -c 100000 -a 192.168.10.1 192.168.20.1

Ping 192.168.20.1 (192.168.20.1) from 192.168.10.1: 56 data bytes, press CTRL_C

to break

56 bytes from 192.168.20.1: icmp_seq=0 ttl=254 time=2.576 ms

56 bytes from 192.168.20.1: icmp_seq=1 ttl=254 time=1.996 ms

...

# 关闭P 1的Vlan-interface23接口。

[P1] interface vlan-interface 23

[P1-Vlan-interface23] shutdown

#在PE1上查看到通讯断开后迅速恢复。

<PE1> ping -c 100000 -a 192.168.10.1 192.168.20.1

Ping 192.168.20.1 (192.168.20.1) from 192.168.10.1: 56 data bytes, press CTRL_C

to break

56 bytes from 192.168.20.1: icmp_seq=0 ttl=254 time=2.576 ms

56 bytes from 192.168.20.1: icmp_seq=1 ttl=254 time=1.996 ms

...

56 bytes from 192.168.20.1: icmp_seq=7 ttl=254 time=2.214 ms

Request time out

56 bytes from 192.168.20.1: icmp_seq=9 ttl=254 time=2.659 ms

56 bytes from 192.168.20.1: icmp_seq=10 ttl=254 time=5.049 ms

56 bytes from 192.168.20.1: icmp_seq=11 ttl=254 time=2.098 ms

56 bytes from 192.168.20.1: icmp_seq=12 ttl=254 time=2.225 ms

56 bytes from 192.168.20.1: icmp_seq=13 ttl=254 time=2.187 ms

 

--- Ping statistics for 192.168.20.1 ---

14 packet(s) transmitted, 13 packet(s) received, 7.1% packet loss

round-trip min/avg/max/std-dev = 1.990/2.455/5.049/0.772 ms

(4)     查看链路是否发生切换。

# PE 1上使用tracert mpls ipv4命令查看到当前所使用的路径是备份LSP

<PE1> tracert mpls -a 192.168.10.1 ipv4 192.168.20.0 24

MPLS trace route FEC 192.168.20.0/24

  TTL   Replier            Time    Type      Downstream

  0                                Ingress   14.14.14.4/[1276]

  1     14.14.14.4         2 ms    Transit   34.34.34.3/[1148]

  2     34.34.34.3         2 ms    Egress

3.6  配置文件

·     PE 1

#

ospf 1

 fast-reroute lfa

 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

#

 mpls bfd enable

#

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

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 12

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 14

#

interface HundredGigE1/0/3

 port link-mode bridge

 port access vlan 10

#

 ip prefix-list PE1 index 10 permit 192.168.10.0 24

 ip prefix-list PE1 index 20 permit 192.168.20.0 24

 ip prefix-list PE1 index 30 permit 1.1.1.1 32

 ip prefix-list PE1 index 40 permit 3.3.3.3 32

#

 mpls bfd 3.3.3.3 32

#

·     PE 2

#

ospf 1

 fast-reroute lfa

 area 0.0.0.0

  network 3.3.3.3 0.0.0.0

  network 23.23.23.0 0.0.0.255

  network 34.34.34.0 0.0.0.255

  network 192.168.20.0 0.0.0.255

#

vlan 23

#

vlan 30

#

vlan 34

#

 mpls lsr-id 3.3.3.3

#

mpls ldp

 lsp-trigger prefix-list PE2

#

 mpls bfd enable

#

interface LoopBack0

 ip address 3.3.3.3 255.255.255.255

#

interface Vlan-interface23

 ip address 23.23.23.3 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface Vlan-interface30

 ip address 192.168.20.1 255.255.255.0

#

interface Vlan-interface34

 ip address 34.34.34.3 255.255.255.0

 mpls enable

 mpls ldp enable

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 34

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 23

#

interface HundredGigE1/0/3

 port link-mode bridge

 port access vlan 30

#

 ip prefix-list PE2 index 10 permit 192.168.10.0 24

 ip prefix-list PE2 index 20 permit 192.168.20.0 24

 ip prefix-list PE2 index 30 permit 1.1.1.1 32

 ip prefix-list PE2 index 40 permit 3.3.3.3 32

#

 mpls bfd 1.1.1.1 32

#

·     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

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 12

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 23

#

 ip prefix-list P1 index 10 permit 192.168.10.0 24

 ip prefix-list P1 index 20 permit 192.168.20.0 24

 ip prefix-list P1 index 30 permit 1.1.1.1 32

 ip prefix-list P1 index 40 permit 3.3.3.3 32

#

·     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 34.34.34.0 0.0.0.255

#

 mpls lsr-id 4.4.4.4

#

vlan 14

#

vlan 34

#

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

 ospf cost 10

 mpls enable

 mpls ldp enable

#

interface Vlan-interface34

 ip address 34.34.34.4 255.255.255.0

 ospf cost 10

 mpls enable

 mpls ldp enable

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 34

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 14

#

 ip prefix-list P2 index 10 permit 192.168.10.0 24

 ip prefix-list P2 index 20 permit 192.168.20.0 24

 ip prefix-list P2 index 30 permit 1.1.1.1 32

 ip prefix-list P2 index 40 permit 3.3.3.3 32

#

4  BFD检测MPLS TE典型配置举例

4.1  组网需求

图2所示,某公司有两个位于不同的地理位置的分支机构通过MPLS TE隧道实现互联,两个分支机构之间需要进行实时业务的同步传输。该公司要求运营商提供高可靠性的服务,以保证实时业务的不间断性。

为满足该用户需求,可通过部署CRLSP备份服务来提供主备两条CRLSP链路,并使用BFD检测MPLS TE技术提高主备CR-LSP的切换速度,具体实现如下:

·     正常情况下,使用CR-LSP 1作为主CR-LSP,负责转发Router A和Router C之间的流量。

·     使用BFD对主CR-LSP进行监测,当主CR-LSP发生故障时,BFD能够快速感知并通告RSVP协议,使得Router A和Router C之间的流量迅速切换到CR-LSP 2进行转发。

图2 BFD检测MPLS TE配置组网图

 

4.2  使用版本

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

4.3  配置注意事项

·     进行本案例配置之前,需要先全局关闭STP功能,或为每个VLAN映射一个MSTP实例,否则可能会阻断环路中的一条链路。

·     OSPF TE使用Opaque Type 10 LSA携带链路的TE属性信息,因此,配置OSPF TE时必须先使能OSPF的Opaque能力。有关OSPF Opaque能力的介绍请参见“三层技术-IP路由配置指导”中的“OSPF”。

·     由于MPLS TE无法在OSPF虚连接上预留资源和分配标签,即MPLS TE无法通过OSPF虚连接建立CRLSP隧道。因此,配置OSPF TE时,OSPF路由域内不能存在虚连接。

4.4  配置步骤

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

# 按照图2配置各接口的IP地址和掩码,包括LoopBack接口,下面以Switch A为例,其它设备配置方法类似,具体配置过程略。

<SwitchA> system-view

[SwitchA] interface hundredgige 1/0/3

[SwitchA-HundredGigE1/0/3] undo shutdown

[SwitchA-HundredGigE1/0/3] quit

[SwitchA] vlan 10

[SwitchA-vlan10] port hundredgige 1/0/3

[SwitchA-vlan10] quit

[SwitchA] interface vlan-interface 10

[SwitchA-Vlan-interface10] ip address 192.168.10.1 24

[SwitchA-Vlan-interface10] undo shutdown

[SwitchA-Vlan-interface10] quit

[SwitchA] interface hundredgige 1/0/1

[SwitchA-HundredGigE1/0/1] undo shutdown

[SwitchA-HundredGigE1/0/1] quit

[SwitchA] vlan 12

[SwitchA-vlan12] port hundredgige 1/0/1

[SwitchA-vlan12] quit

[SwitchA] interface vlan-interface 12

[SwitchA-Vlan-interface12] ip address 12.12.12.1 24

[SwitchA-Vlan-interface12] undo shutdown

[SwitchA-Vlan-interface12] quit

[SwitchA] interface hundredgige 1/0/2

[SwitchA-HundredGigE1/0/2] undo shutdown

[SwitchA-HundredGigE1/0/2] quit

[SwitchA] vlan 14

[SwitchA-vlan14] port hundredgige 1/0/2

[SwitchA-vlan14] quit

[SwitchA] interface vlan-interface 14

[SwitchA-Vlan-interface14] ip address 14.14.14.1 24

[SwitchA-Vlan-interface14] undo shutdown

[SwitchA-Vlan-interface14] quit

[SwitchA] interface loopback 0

[SwitchA-LoopBack0] ip address 1.1.1.1 32

[SwitchA-LoopBack0] quit

(2)     配置LSR ID,开启MPLS、MPLS TE和RSVP-TE能力

# 配置Switch A。

[SwitchA] mpls lsr-id 1.1.1.1

[SwitchA] mpls te

[SwitchA-te] quit

[SwitchA] rsvp

[SwitchA-rsvp] quit

[SwitchA] interface vlan-interface 12

[SwitchA-Vlan-interface12] mpls enable

[SwitchA-Vlan-interface12] mpls te enable

[SwitchA-Vlan-interface12] rsvp enable

[SwitchA-Vlan-interface12] quit

[SwitchA] interface vlan-interface 14

[SwitchA-Vlan-interface14] mpls enable

[SwitchA-Vlan-interface14] mpls te enable

[SwitchA-Vlan-interface14] rsvp enable

[SwitchA-Vlan-interface14] quit

# Switch BSwitch CSwitch D的配置与Switch A相似,此处不再赘述,具体请参见配置文件。

(3)     在MPLS骨干网内配置OSPF,以保证各路由器之间路由可达,并使能OSPF的Opaque LSA发布接收能力,在OSPF区域0使能MPLS TE能力

# 配置Switch A。

[SwitchA] ospf

[SwitchA-ospf-1] opaque-capability enable

[SwitchA-ospf-1] area 0

[SwitchA-ospf-1-area-0.0.0.0] mpls te enable

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

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

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

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

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

[SwitchA-ospf-1] quit

# 配置Switch B。

[SwitchB] ospf

[SwitchB-ospf-1] opaque-capability enable

[SwitchB-ospf-1] area 0

[SwitchB-ospf-1-area-0.0.0.0] mpls te enable

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

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

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

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

[SwitchB-ospf-1] quit

# 配置Switch C。

[SwitchC] ospf

[SwitchC-ospf-1] opaque-capability enable

[SwitchC ospf-1] area 0

[SwitchC-ospf-1-area-0.0.0.0] mpls te enable

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

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

[SwitchC ospf-1-area-0.0.0.0] network 34.34.34..0 0.0.0.255

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

[SwitchC ospf-1-area-0.0.0.0] quit

[SwitchC ospf-1] quit

# 配置Switch D。

[SwitchD] ospf

[SwitchD-ospf-1] opaque-capability enable

[SwitchD-ospf-1] area 0

[SwitchD-ospf-1-area-0.0.0.0] mpls te enable

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

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

[SwitchD-ospf-1-area-0.0.0.0] network 34.34.34.0 0.0.0.255

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

[SwitchD-ospf-1] quit

(4)     配置MPLS TE隧道

# Switch A上配置MPLS TE隧道Tunnel3:目的地址为Switch CLSR ID3.3.3.3);采用RSVP-TE信令协议建立MPLS TE隧道;隧道支持CRLSP热备份功能。

[SwitchA] interface tunnel 3 mode mpls-te

[SwitchA-Tunnel3] ip address 9.1.1.1 255.255.255.0

[SwitchA-Tunnel3] destination 3.3.3.3

[SwitchA-Tunnel3] mpls te signaling rsvp-te

[SwitchA-Tunnel3] mpls te backup hot-standby

[SwitchA-Tunnel3] quit

#创建隧道的显式路径,设置CR-LSP 1优先级为1,作为主CR-LSP,CR-LSP 2优先级为2,作为备份CR-LSP。

[SwitchA] explicit-path cr-lsp1

[SwitchA-explicit-path-cr-lsp1] nexthop 12.12.12.2

[SwitchA-explicit-path-cr-lsp1] quit

[SwitchA]explicit-path cr-lsp2

[SwitchA-explicit-path-cr-lsp2] nexthop 14.14.14.4

[SwitchA-explicit-path-cr-lsp2]quit

[SwitchA] interface tunnel 3

[SwitchA-Tunnel3] mpls te path preference 1 explicit-path cr-lsp1

[SwitchA-Tunnel3] mpls te path preference 2 explicit-path cr-lsp2

[SwitchA-Tunnel3] quit

# Switch C上配置MPLS TE隧道Tunnel3:目的地址为Switch ALSR ID1.1.1.1);采用RSVP-TE信令协议建立MPLS TE隧道;隧道支持CRLSP热备份功能。

[SwitchC] interface tunnel 3 mode mpls-te

[SwitchC-Tunnel3] ip address 9.3.3.3 255.255.255.0

[SwitchC-Tunnel3] destination 1.1.1.1

[SwitchC-Tunnel3] mpls te signaling rsvp-te

[SwitchC-Tunnel3] mpls te backup hot-standby

[SwitchC-Tunnel3] quit

#创建隧道的显式路径,设置CR-LSP 1优先级为1,作为主CR-LSP,CR-LSP 2优先级为2,作为备份CR-LSP。

[SwitchC] explicit-path cr-lsp1

[SwitchC-explicit-path-cr-lsp1] nexthop 23.23.23.2

[SwitchC-explicit-path-cr-lsp1] quit

[SwitchC]explicit-path cr-lsp2

[SwitchC-explicit-path-cr-lsp2] nexthop 34.34.34.4

[SwitchC-explicit-path-cr-lsp2]quit

[SwitchC] interface tunnel 3

[SwitchC-Tunnel3] mpls te path preference 1 explicit-path cr-lsp1

[SwitchC-Tunnel3] mpls te path preference 2 explicit-path cr-lsp2

[SwitchC-Tunnel3] quit

(5)     配置静态路由使流量沿MPLS TE隧道转发

# 在Switch A上配置静态路由,使得到达网络192.168.20.0/24的流量通过MPLS TE隧道接口Tunnel3转发。

[SwitchA] ip route-static 192.168.20.0 24 tunnel 3 preference 1

# 在Switch C上配置静态路由,使得到达网络192.168.10.0/24的流量通过MPLS TE隧道接口Tunnel3转发。

[SwitchC] ip route-static 192.168.10.0 24 tunnel 3 preference 1

(6)     使能MPLS与BFD联动功能,并配置通过BFD检测TE隧道的连通性

# 配置Switch A。

[SwitchA] mpls bfd enable

[SwitchA] interface tunnel 3

[SwitchA-Tunnel3] mpls bfd

[SwitchA-Tunnel3] quit

# 配置Switch C。

[SwitchC] mpls bfd enable

[SwitchC] interface tunnel 3

[SwitchC-Tunnel3] mpls bfd

[SwitchC-Tunnel3] quit

4.5  验证配置

(1)     配置完成后,查看MPLS TE隧道是否成功建立。

# 在Switch A上执行display mpls te tunnel-interface命令,可以看到Tunnel3的状态为up,且主备两条CR-LSP已经成功建立,备份方式为热备份。

<SwitchA> display mpls te tunnel-interface

Tunnel Name            : Tunnel 3

Tunnel State           : Up (Main CRLSP up, Backup CRLSP up)

Tunnel Attributes      :

  LSP ID               : 37161           Tunnel ID            : 3

  Admin State          : Normal

  Ingress LSR ID       : 1.1.1.1         Egress LSR ID        : 3.3.3.3

  Signaling            : RSVP-TE         Static CRLSP Name    : -

  Resv Style           : SE

  Tunnel mode          : -

  Reverse-LSP name     : -

  Reverse-LSP LSR ID   : -               Reverse-LSP Tunnel ID: -

  Class Type           : CT0             Tunnel Bandwidth     : 0 kbps

  Reserved Bandwidth   : 0 kbps

  Setup Priority       : 7               Holding Priority     : 7

  Affinity Attr/Mask   : 0/0

  Explicit Path        : cr-lsp1

  Backup Explicit Path : -

  Metric Type          : TE

  Record Route         : Enabled         Record Label         : Disabled

  FRR Flag             : Disabled        Bandwidth Protection : Disabled

  Backup Bandwidth Flag: Disabled        Backup Bandwidth Type: -

  Backup Bandwidth     : -

  Bypass Tunnel        : No              Auto Created         : No

  Route Pinning        : Disabled

  Retry Limit          : 3               Retry Interval       : 2 sec

  Reoptimization       : Disabled        Reoptimization Freq  : -

  Backup Type          : Hot Standby     Backup LSP ID        : 37162

  Auto Bandwidth       : Disabled        Auto Bandwidth Freq  : -

  Min Bandwidth        : -               Max Bandwidth        : -

  Collected Bandwidth  : -

# 在Switch A上执行display rsvp lsp verbose命令,可以看到主备两条CR-LSP的详细信息。主用CR-LSP使用的出接口为Vlan-interface12,下一跳为12.12.12.2;备用CR-LSP使用的出接口为Vlan-interface14,下一跳为14.14.14.4。

<SwitchA> display rsvp lsp destination 3.3.3.3 verbose

Tunnel name: Tunnel3

Destination: 3.3.3.3                      Source: 1.1.1.1

Tunnel ID: 3                              LSP ID: 37161

LSR type: Ingress                         Direction: Unidirectional

Setup priority: 7                         Holding priority: 7

In-Label: -                               Out-Label: 1149

In-Interface: -                           Out-Interface: Vlan12

Nexthop: 12.12.12.2                       Exclude-any: 0

Include-Any: 0                            Include-all: 0

Mean rate (CIR): 0 kbps                   Mean burst size (CBS): 1000.00 bytes

Path MTU: 1500                            Class type: CT0

RRO number: 6

  12.12.12.1/32      Flag: 0x00 (No FRR)

  12.12.12.2/32      Flag: 0x00 (No FRR)

  2.2.2.2/32         Flag: 0x20 (No FRR/Node-ID)

  23.23.23.2/32      Flag: 0x00 (No FRR)

  23.23.23.3/32      Flag: 0x00 (No FRR)

  3.3.3.3/32         Flag: 0x20 (No FRR/Node-ID)

Fast Reroute protection: None

 

Tunnel name: Tunnel3

Destination: 3.3.3.3                      Source: 1.1.1.1

Tunnel ID: 3                              LSP ID: 37162

LSR type: Ingress                         Direction: Unidirectional

Setup priority: 7                         Holding priority: 7

In-Label: -                               Out-Label: 1149

In-Interface: -                           Out-Interface: Vlan14

Nexthop: 14.14.14.4                       Exclude-any: 0

Include-Any: 0                            Include-all: 0

Mean rate (CIR): 0 kbps                   Mean burst size (CBS): 1000.00 bytes

Path MTU: 1500                            Class type: CT0

RRO number: 6

  14.14.14.1/32      Flag: 0x00 (No FRR)

  14.14.14.4/32      Flag: 0x00 (No FRR)

  4.4.4.4/32         Flag: 0x20 (No FRR/Node-ID)

  34.34.34.4/32      Flag: 0x00 (No FRR)

  34.34.34.3/32      Flag: 0x00 (No FRR)

  3.3.3.3/32         Flag: 0x20 (No FRR/Node-ID)

Fast Reroute protection: None

(2)     查看MPLS TE隧道的BFD检测信息

# 使用display mpls bfd命令查看到2MPLS TE隧道的BFD检测信息,均为UP,以Switch A为例。

<SwitchA> display mpls bfd te tunnel 3

 Total number of sessions: 2, 2 up, 0 down, 0 init

 

 FEC Type: TE Tunnel

 FEC Info:

   Send Addr: 1.1.1.1

   End  Addr: 3.3.3.3

   Tunnel ID: 3

   LSP ID   : 37161

 NHLFE ID: 1029

 Local Discr: 34                     Remote Discr: 33

 Source IP: 1.1.1.1                  Destination IP: 127.0.0.1

 Session State: Up                   Session Role: Passive

 Template Name: -

 

 FEC Type: TE Tunnel

 FEC Info:

   Send Addr: 1.1.1.1

   End  Addr: 3.3.3.3

   Tunnel ID: 3

   LSP ID   : 37162

 NHLFE ID: 1031

 Local Discr: 33                     Remote Discr: 36

 Source IP: 1.1.1.1                  Destination IP: 127.0.0.4

 Session State: Up                   Session Role: Passive

 Template Name: -

(3)     将Switch B的Vlan-interface23接口shutdown,再次查看MPLS TE隧道建立情况及BFD检测信息。

# 关闭Switch B的Vlan-interface23接口。

[SwitchB] interface vlan-interface 23

[SwitchB-Vlan-interface23] shutdown

# 在Switch A上执行display mpls te tunnel-interface命令,可以看到主用CR-LSP down,备用CR-LSP up。

<SwitchA> display mpls te tunnel-interface

Tunnel Name            : Tunnel 3

Tunnel State           : Up (Main CRLSP down, Backup CRLSP up)

Tunnel Attributes      :

  LSP ID               : 0               Tunnel ID            : 3

  Admin State          : Normal

  Ingress LSR ID       : -               Egress LSR ID        : 3.3.3.3

  Signaling            : RSVP-TE         Static CRLSP Name    : -

  Resv Style           : SE

  Tunnel mode          : -

  Reverse-LSP name     : -

  Reverse-LSP LSR ID   : -               Reverse-LSP Tunnel ID: -

  Class Type           : CT0             Tunnel Bandwidth     : 0 kbps

  Reserved Bandwidth   : 0 kbps

  Setup Priority       : 7               Holding Priority     : 7

  Affinity Attr/Mask   : 0/0

  Explicit Path        : -

  Backup Explicit Path : -

  Metric Type          : TE

  Record Route         : Enabled         Record Label         : Disabled

  FRR Flag             : Disabled        Bandwidth Protection : Disabled

  Backup Bandwidth Flag: Disabled        Backup Bandwidth Type: -

  Backup Bandwidth     : -

  Bypass Tunnel        : No              Auto Created         : No

  Route Pinning        : Disabled

  Retry Limit          : 3               Retry Interval       : 2 sec

  Reoptimization       : Disabled        Reoptimization Freq  : -

  Backup Type          : Hot Standby     Backup LSP ID        : 37162

  Auto Bandwidth       : Disabled        Auto Bandwidth Freq  : -

  Min Bandwidth        : -               Max Bandwidth        : -

  Collected Bandwidth  : -

# 使用display mpls bfd查看到MPLS TE隧道CR-LSP2BFD检测信息,以Switch A为例。

<SwitchA> display mpls bfd te tunnel 3

 Total number of sessions: 1, 1 up, 0 down, 0 init

 

 FEC Type: TE Tunnel

 FEC Info:

   Send Addr: 1.1.1.1

   End  Addr: 3.3.3.3

   Tunnel ID: 3

   LSP ID   : 37162

 NHLFE ID: 1031

 Local Discr: 33                     Remote Discr: 36

 Source IP: 1.1.1.1                  Destination IP: 127.0.0.4

 Session State: Up                   Session Role: Passive

 Template Name: -

(4)     将Switch B的Vlan-interface23接口undo shutdown,再次查看MPLS TE隧道建立情况。

# 开启Switch B的Vlan-interface23接口。

[SwitchB] interface vlan-interface 23

[SwitchB-Vlan-interface23] undo shutdown

# Switch A上使用display mpls te tunnel-interface命令,可以看到主用CR-LSP已经自动恢复。

<SwitchA> display mpls te tunnel-interface

Tunnel Name            : Tunnel 3

Tunnel State           : Up (Main CRLSP up, Backup CRLSP up)

Tunnel Attributes      :

  LSP ID               : 37177           Tunnel ID            : 3

  Admin State          : Normal

  Ingress LSR ID       : 1.1.1.1         Egress LSR ID        : 3.3.3.3

  Signaling            : RSVP-TE         Static CRLSP Name    : -

  Resv Style           : SE

  Tunnel mode          : -

  Reverse-LSP name     : -

  Reverse-LSP LSR ID   : -               Reverse-LSP Tunnel ID: -

  Class Type           : CT0             Tunnel Bandwidth     : 0 kbps

  Reserved Bandwidth   : 0 kbps

  Setup Priority       : 7               Holding Priority     : 7

  Affinity Attr/Mask   : 0/0

  Explicit Path        : cr-lsp1

  Backup Explicit Path : -

  Metric Type          : TE

  Record Route         : Enabled         Record Label         : Disabled

  FRR Flag             : Disabled        Bandwidth Protection : Disabled

  Backup Bandwidth Flag: Disabled        Backup Bandwidth Type: -

  Backup Bandwidth     : -

  Bypass Tunnel        : No              Auto Created         : No

  Route Pinning        : Disabled

  Retry Limit          : 3               Retry Interval       : 2 sec

  Reoptimization       : Disabled        Reoptimization Freq  : -

  Backup Type          : Hot Standby     Backup LSP ID        : 37178

  Auto Bandwidth       : Disabled        Auto Bandwidth Freq  : -

  Min Bandwidth        : -               Max Bandwidth        : -

  Collected Bandwidth  : -

4.6  配置文件

·     Switch A

#

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 te enable

#

 mpls lsr-id 1.1.1.1

#

vlan 10

#

vlan 12

#

vlan 14

#

mpls te

#

explicit-path cr-lsp1

 nexthop index 1 12.12.12.2 include strict

#

explicit-path cr-lsp2

 nexthop index 1 14.14.14.4 include strict

#

rsvp

#

 mpls bfd enable

#

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 te enable

 rsvp enable

#

interface Vlan-interface14

 ip address 14.14.14.1 255.255.255.0

 mpls enable

 mpls te enable

 rsvp enable

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 12

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 14

#

interface HundredGigE1/0/3

 port link-mode bridge

 port access vlan 10

#

interface Tunnel3 mode mpls-te

 ip address 9.1.1.1 255.255.255.0

 mpls te path preference 1 explicit-path cr-lsp1

 mpls te path preference 2 explicit-path cr-lsp2

 mpls te backup hot-standby

 mpls bfd

 destination 3.3.3.3

#

 ip route-static 192.168.20.0 24 Tunnel3 preference 1

#

·     Switch B

#

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 te enable

#

 mpls lsr-id 2.2.2.2

#

vlan 12

#

vlan 23

#

mpls te

#

rsvp

#

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 te enable

 rsvp enable

#

interface Vlan-interface23

 ip address 23.23.23.2 255.255.255.0

 mpls enable

 mpls te enable

 rsvp enable

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 12

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 23

#

·     Switch C

#

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

  network 192.168.20.0 0.0.0.255

  mpls te enable

#

 mpls lsr-id 3.3.3.3

#

vlan 23

#

vlan 30

#

vlan 34

#

mpls te

#

explicit-path cr-lsp1

 nexthop index 1 23.23.23.2 include strict

#

explicit-path cr-lsp2

 nexthop index 1 34.34.34.4 include strict

#

rsvp

#

 mpls bfd enable

#

interface LoopBack0

 ip address 3.3.3.3 255.255.255.255

#

interface Vlan-interface23

 ip address 23.23.23.3 255.255.255.0

 mpls enable

 mpls te enable

 rsvp enable

#

interface Vlan-interface30

 ip address 192.168.20.1 255.255.255.0

#

interface Vlan-interface34

 ip address 34.34.34.3 255.255.255.0

 mpls enable

 mpls te enable

 rsvp enable

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 34

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 23

#

interface HundredGigE1/0/3

 port link-mode bridge

 port access vlan 30

#

interface Tunnel3 mode mpls-te

 ip address 9.3.3.3 255.255.255.0

 mpls te path preference 1 explicit-path cr-lsp1

 mpls te path preference 2 explicit-path cr-lsp2

 mpls te backup hot-standby

 mpls bfd

 destination 1.1.1.1

#

 ip route-static 192.168.10.0 24 Tunnel3 preference 1

#

·     Switch D

#

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

  mpls te enable

#

 mpls lsr-id 4.4.4.4

#

vlan 14

#

vlan 34

#

mpls te

#

rsvp

#

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 te enable

 rsvp enable

#

interface Vlan-interface34

 ip address 34.34.34.4 255.255.255.0

 mpls enable

 mpls te enable

 rsvp enable

#

interface HundredGigE1/0/1

 port link-mode bridge

 port access vlan 34

#

interface HundredGigE1/0/2

 port link-mode bridge

 port access vlan 14

#

5  相关资料

·     H3C S12500X-AF系列交换机 MPLS配置指导-R26xx

·     H3C S12500X-AF系列交换机 MPLS命令参考-R26xx

 

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

联系我们