组网需求


CE-A和CE-B都属于***a,分别通过PE-A和PE-B接入MPLS骨干网。MPLS骨干网使用OSPF作为IGP协议。

配置MPLS TE隧道转发PE-A到PE-B的×××流量。

为了使TE隧道能够转发BGP/MPLS IP ×××的流量,需要在建立×××时配置隧道策略,使用CR-LSP作为×××隧道。

在×××中配置MPLS TE组网图

配置思路

采用如下的思路配置BGP/MPLS IP ×××中的MPLS TE:

配置各路由器接口的IP地址及作为LSR ID的Loopback地址,在PE路由器上用OSPF协议通告的公网路由和LSR ID主机路由。

在PE路由器上全局使能MPLS、MPLS TE、OSPF TE、MPLS LDP、MPLS CSPF。

使能PE上各接口的MPLS、MPLS TE和MPLS LDP。

在PE路由器上配置×××实例,并绑定到连接CE的接口上。

配置BGP。

数据准备

为完成此配置例,需准备如下的数据:

各路由器接口的IP地址如图3-14,OSPF进程号为1,所在的区域为Area 0。

隧道接口为Tunnel2/0/1,借用Loopback1的IP地址,隧道封装协议为MPLS TE,目的地址为3.3.3.3,隧道ID为201,隧道信令为CR-LDP。

×××的实例名称为***a,PE-A上***a的路由标识route-distinguisher为100:1,PE-B上***a的路由标识route-distinguisher为100:2,使用的×××-target属性为100:1。

CE-A的AS号为65001,CE-B的AS号为65002。

PE-A和PE-B的AS号都为100。

配置文件

 CE-A的配置文件

#

sysname CE-A

#

interface GigabitEthernet1/0/0

ip address 192.168.1.2 255.255.255.0

#

bgp 65001

peer 192.168.1.1 as-number 100

import-route direct

#

return

 PE-A的配置文件

#

sysname PE-A

#

ip ***-instance ***a

route-distinguisher 100:1

tnl-policy policy1

***-target 100:1 export-extcommunity

***-target 100:1 import-extcommunity

#

mpls lsr-id 2.2.2.2

mpls

mpls te

mpls te cspf

lsp-trigger all

#

mpls ldp

#

interface GigabitEthernet1/0/0

ip binding ***-instance ***a

ip address 192.168.1.1 255.255.255.0

#

interface Pos2/0/0

link-protocol ppp

ip address 10.0.0.1 255.255.255.0

mpls

mpls te

mpls ldp

#

interface LoopBack1

ip address 2.2.2.2 255.255.255.255

#

interface Tunnel2/0/1

ip address unnumbered interface LoopBack1

tunnel-protocol mpls te

destination 3.3.3.3

mpls te tunnel-id 201

mpls te signal-protocol crldp

mpls te commit

#

tunnel-policy policy1

tunnel select-seq cr-lsp load-balance-number 1

#

bgp 100

peer 3.3.3.3 as-number 100

peer 3.3.3.3 connect-interface LoopBack1

#

ipv4-family ***v4

import ***-target-enable

peer 3.3.3.3 enable

quit

#

ipv4-family ***-instance ***a

import-route direct

peer 192.168.1.2 as-number 65001

quit

#

ospf 1

opaque-capability enable

area 0.0.0.0

network 10.0.0.0 0.0.0.255

network 2.2.2.2 0.0.0.0

mpls-te enable

#

return

 PE-B的配置文件

#

sysname PE-B

#

ip ***-instance ***a

route-distinguisher 100:2

***-target 100:1 export-extcommunity

***-target 100:1 import-extcommunity

#

mpls lsr-id 3.3.3.3

mpls

mpls te

lsp-trigger all

#

mpls ldp

#

interface GigabitEthernet1/0/0

ip binding ***-instance ***a

ip address 192.168.2.1 255.255.255.0

#

interface Pos2/0/0

link-protocol ppp

clock master

ip address 10.0.0.2 255.255.255.0

mpls

mpls te

mpls ldp

#

interface LoopBack1

ip address 3.3.3.3 255.255.255.255

#

bgp 100

peer 2.2.2.2 as-number 100

peer 2.2.2.2 connect-interface LoopBack1

#

ipv4-family ***v4

import ***-target-enable

peer 2.2.2.2 enable

quit

#

ipv4-family ***-instance ***a

import-route direct

peer 192.168.2.2 as-number 65002

quit

#

ospf 1

opaque-capability enable

area 0.0.0.0

network 10.0.0.0 0.0.0.255

network 3.3.3.3 0.0.0.0

mpls-te enable

#

return

 CE-B的配置文件

#

sysname CE-B

#

interface GigabitEthernet1/0/0

ip address 192.168.2.2 255.255.255.0

#

bgp 65002

peer 192.168.2.1 as-number 100

import-route direct

#

return