设为首页收藏本站language 语言切换
查看: 9996|回复: 15
收起左侧

[分享] 华为 MPLS VPN 配置静态 LSP

[复制链接]
发表于 2011-8-11 11:28:24 | 显示全部楼层 |阅读模式
应用环境
标签交换路径LSP分为静态LSP和动态LSP两种。静态LSP需要管理员对沿途的LSR均进行相应配置后,才能正常工作。

静态LSP可以用于MPLS L2VPN。

配置思路
采用如下的思路配置静态LSP:

1.         配置各路由器接口的IP地址及作为LSR ID的Loopback地址,并用OSPF协议通告各接口所连网段和LSR ID主机路由。

2.         全局使能各路由器的MPLS。

3.         使能各接口的MPLS。

4.         在入节点配置此LSP的目的地址、出接口/下一跳、出标签的值。

5.         在中间节点配置此LSP的入接口、与上一节点入标签相对应的出标签的值、对应的出接口/下一跳。

6.         在出节点配置此LSP的入接口及相应入标签的值。

配置注意事项


配置实例
组网需求
如下图所示,各路由器均支持MPLS,运行OSPF作为MPLS骨干网上的IGP。

在RouterA和RouterC之间建立双向静态LSP。

配置静态LSP组网图

未命名.jpgv成本.jpg
适用产品和版本
路由器可以使用任意一款NE产品。版本为(VRP5.10)及后续版本

配置步骤
步骤 1     配置各接口的IP地址

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

步骤 2     配置OSPF协议发布各路由器接口所连网段和LSR ID的主机路由

# 配置RouterA。

<RouterA> system-view

[RouterA] ospf

[RouterA-ospf-1] area 0

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

[RouterA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

[RouterA-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255

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

[RouterA-ospf-1] quit

# 配置RouterB。

<RouterB> system-view

[RouterB] ospf

[RouterB-ospf-1] area 0

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

[RouterB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

[RouterB-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255

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

[RouterB-ospf-1] quit

# 配置RouterC。

<RouterC> system-view

[RouterC] ospf

[RouterC-ospf-1] area 0

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

[RouterC-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255

[RouterC-ospf-1-area-0.0.0.0] network 192.168.4.0 0.0.0.255

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

[RouterC-ospf-1] quit

# 配置RouterD。

<RouterD> system-view

[RouterD] ospf

[RouterD-ospf-1] area 0

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

[RouterD-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255

[RouterD-ospf-1-area-0.0.0.0] network 192.168.4.0 0.0.0.255

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

[RouterD-ospf-1] quit

配置完成后,在各路由器上执行display ip routing-table命令,可以看到相互之间都学到了到对方的路由。

RouterA上的显示为:

[RouterA] display ip routing-table

Routing Tables: Public

         Destinations : 12       Routes : 13

Destination/Mask    Proto  Pre  Cost       NextHop         Interface

        1.1.1.1/32  Direct 0    0          127.0.0.1       InLoopBack0

        2.2.2.2/32  OSPF   10   2          192.168.1.2       Pos1/0/0

        3.3.3.3/32  OSPF   10   3          192.168.1.2       Pos1/0/0

                    OSPF   10   3          192.168.3.2       Pos2/0/0

        4.4.4.4/32  OSPF   10   2          192.168.3.2       Pos2/0/0

      127.0.0.0/8   Direct 0    0          127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.1.0/24  Direct 0    0          192.168.1.1       Pos1/0/0

    192.168.1.1/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.2.0/24  OSPF   10   2          172.1.2.1         Pos1/0/0

    192.168.3.0/24  Direct 0    0          192.168.3.1       Pos2/0/0

    192.168.3.1/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.4.0/24  OSPF   10   2          192.168.3.2       Pos2/0/0

由RouterA到RouterC上3.3.3.3/32的静态LSP的下一跳/出接口由路由表决定,已用粗体表示。

RouterB上的显示为:

[RouterB] display ip routing-table

Routing Tables: Public

         Destinations : 12       Routes : 13

Destination/Mask    Proto  Pre  Cost       NextHop         Interface

        1.1.1.1/32  OSPF   10   2          192.168.1.1       Pos1/0/0

        2.2.2.2/32  Direct 0    0          127.0.0.1       InLoopBack0

        3.3.3.3/32  OSPF   10   2          192.168.2.2       Pos2/0/0

        4.4.4.4/32  OSPF   10   3          192.168.1.1       Pos1/0/0

                    OSPF   10   3          192.168.2.2       Pos2/0/0

      127.0.0.0/8   Direct 0    0          127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.1.0/24  Direct 0    0          192.168.1.2       Pos1/0/0

    192.168.1.2/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.2.0/24  Direct 0    0          192.168.2.1       Pos2/0/0

      192.168.2.1/32  Direct 0    0          127.0.0.1       InLoopBack0

      192.168.3.0/24  OSPF   10   2          192.168.1.1       Pos1/0/0

      192.168.4.0/24  OSPF   10   2          192.168.2.2       Pos2/0/0

由RouterA到RouterC上3.3.3.3/32的静态LSP在此节点的下一跳/出接口由路由表决定,已用粗体表示。

RouterC上的显示为:

[RouterC] display ip routing-table

Routing Tables: Public

         Destinations : 12       Routes : 13

Destination/Mask    Proto  Pre  Cost       NextHop         Interface

        1.1.1.1/32  OSPF   10   3          192.168.2.1       Pos1/0/0

                    OSPF   10   3          192.168.4.1       Pos2/0/0

        2.2.2.2/32  OSPF   10   2          192.168.2.1       Pos1/0/0

        3.3.3.3/32  Direct 0    0          127.0.0.1       InLoopBack0

        4.4.4.4/32  OSPF   10   2          192.168.4.1       Pos2/0/0

      127.0.0.0/8   Direct 0    0          127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.1.0/24  OSPF   10   2          192.168.2.1       Pos1/0/0

    192.168.2.0/24  Direct 0    0          192.168.2.2       Pos1/0/0

    192.168.2.2/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.3.0/24  OSPF   10   2          192.168.4.1       Pos2/0/0

    192.168.4.0/24  Direct 0    0          192.168.4.2       Pos2/0/0

    192.168.4.2/32  Direct 0    0          127.0.0.1       InLoopBack0

LSP是单向的,需要再配置RouterC到RouterA的静态LSP。

这条LSP也可使用静态路由来创建,在RouterC上引入一个静态路由。

[RouterC] ip route-static 1.1.1.1 32 pos 2/0/0 preference 5

查看RouterC上的路由:

[RouterC] display ip routing-table

Routing Tables: Public

         Destinations : 12       Routes : 12

Destination/Mask    Proto  Pre  Cost       NextHop         Interface

        1.1.1.1/32  Static 5    0          192.168.4.1       Pos2/0/0

        2.2.2.2/32  OSPF   10   2          192.168.2.1       Pos1/0/0

        3.3.3.3/32  Direct 0    0          127.0.0.1       InLoopBack0

        4.4.4.4/32  OSPF   10   2          192.168.4.1       Pos2/0/0

      127.0.0.0/8   Direct 0    0          127.0.0.1       InLoopBack0

      127.0.0.1/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.1.0/24  OSPF   10   2          192.168.2.1       Pos1/0/0

    192.168.2.0/24  Direct 0    0          192.168.2.2       Pos1/0/0

    192.168.2.2/32  Direct 0    0          127.0.0.1       InLoopBack0

    192.168.3.0/24  OSPF   10   2          192.168.4.1       Pos2/0/0

    192.168.4.0/24  Direct 0    0          192.168.4.2       Pos2/0/0

    192.168.4.2/32  Direct 0    0          127.0.0.1       InLoopBack0

由RouterC到RouterA上1.1.1.1/32的静态LSP的下一跳/出接口由路由表决定,已用粗体表示。

步骤 3     配置路由器和接口的MPLS基本能力

# 配置RouterA。

[RouterA] mpls lsr-id 1.1.1.1

[RouterA] mpls

[RouterA-mpls] quit

[RouterA] interface pos 1/0/0

[RouterA-Pos1/0/0] mpls

[RouterA-Pos1/0/0] quit

[RouterA] interface pos 2/0/0

[RouterA-Pos2/0/0] mpls

[RouterA-Pos2/0/0] quit

# 配置RouterB。

[RouterB] mpls lsr-id 2.2.2.2

[RouterB] mpls

[RouterB-mpls] quit

[RouterB] interface pos 1/0/0

[RouterB-Pos1/0/0] mpls

[RouterB-Pos1/0/0] quit

[RouterB] interface pos 2/0/0

[RouterB-Pos2/0/0] mpls

[RouterB-Pos2/0/0] quit

# 配置RouterC。

[RouterC] mpls lsr-id 3.3.3.3

[RouterC] mpls

[RouterC-mpls] quit

[RouterC] interface pos 1/0/0

[RouterC-Pos1/0/0] mpls

[RouterC-Pos1/0/0] quit

[RouterC] interface pos 2/0/0

[RouterC-Pos1/0/0] mpls

[RouterC-Pos1/0/0] quit

# 配置RouterD。

[RouterC] mpls lsr-id 4.4.4.4

[RouterC] mpls

[RouterC-mpls] quit

[RouterC] interface pos 1/0/0

[RouterC-Pos1/0/0] mpls

[RouterC-Pos1/0/0] quit

[RouterC] interface pos 2/0/0

[RouterC-Pos1/0/0] mpls

[RouterC-Pos1/0/0] quit

步骤 4     创建从RouterA到RouterC的静态LSP。

# 配置入节点RouterA。

[RouterA] static-lsp ingress RAtoRC destination 3.3.3.3 32 nexthop 192.168.1.2 out-label 20

# 配置中间节点RouterB。

[RouterB] static-lsp transit RAtoRC incoming-interface pos 1/0/0 in-label 20 nexthop 192.168.2.1 out-label 40

# 配置出节点RouterC。

[RouterC] static-lsp egress RAtoRC incoming-interface pos 1/0/0 in-label 40

配置完成后,可在各路由器上用display mpls static-lsp verbose或display mpls lsp命令查看LSP的状态。以RouterA的显示为例:

[RouterA] display mpls static-lsp verbose

No             : 1

LSP-Name       : RAtoRC

LSR-Type       : Ingress

FEC            : 3.3.3.3/32

In-Label       : NULL

Out-Label      : 20

In-Interface   : -

Out-Interface  : Pos1/0/0

NextHop        : 192.168.1.2

Static-Lsp Type: Normal

Lsp Status     : Up

[RouterA] display mpls lsp

----------------------------------------------------------------------

                 LSP Information: STATIC LSP

----------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name

3.3.3.3/32         NULL/20       -/Pos1/0/0

步骤 5     创建从RouterC到RouterA的静态LSP。

用同样的方法可配置RouterC到RouterA的静态LSP。

# 配置入节点RouterC。

[RouterC] static-lsp ingress RCtoRA destination 1.1.1.1 32 nexthop 192.168.4.2 out-label 30

# 配置中间节点RouterD。

[RouterD] static-lsp transit RCtoRA incoming-interface pos 2/0/0 in-label 30 nexthop 192.168.3.1 out-label 60

# 配置出节点RouterA。

[RouterA] static-lsp egress RCtoRA incoming-interface pos 2/0/0 in-label 60

验证结果
配置完成后,可在各路由器上用display mpls static-lsp或display mpls lsp命令查看LSP的状态。以RouterA的显示为例:

[RouterA] display mpls static-lsp

Name            FEC                 I/O Label  I/O If                      Stat

RAtoRC         3.3.3.3/32         NULL/20    -/Pos1/0/0               Up

RCtoRA          -/-               60/NULL    Pos2/0/0/-               Up

[RouterA] display mpls lsp

----------------------------------------------------------------------

                 LSP Information: STATIC LSP

----------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name

3.3.3.3/32         NULL/20       -/Pos1/0/0

-/-                60/NULL       Pos2/0/0/-

配置文件
RouterA的配置文件
#

sysname RouterA

#

mpls lsr-id 1.1.1.1

mpls

#

interface Pos1/0/0

link-protocol ppp

ip address 192.168.1.1 255.255.255.0

mpls

interface Pos2/0/0

link-protocol ppp

ip address 192.168.3.1 255.255.255.0

mpls

#

interface LoopBack1

ip address 1.1.1.1 255.255.255.255

#

ospf 1

area 0.0.0.0

  network 192.168.1.0 0.0.0.255

  network 192.168.3.0 0.0.0.255

  network 1.1.1.1 0.0.0.0

#

static-lsp ingress RAtoRC destination 3.3.3.3 32 nexthop 192.168.1.2 out-label 20

static-lsp egress RCtoRA incoming-interface Pos2/0/0 in-label 60

#

return

RouterB的配置文件
#

sysname RouterB

#

mpls lsr-id 2.2.2.2

mpls

#

interface Pos1/0/0

link-protocol ppp

ip address 192.168.1.2 255.255.255.0

mpls

#

interface Pos2/0/0

link-protocol ppp

ip address 192.168.2.1 255.255.255.0

mpls

#

interface LoopBack1

ip address 2.2.2.2 255.255.255.255

#

ospf 1

area 0.0.0.0

  network 192.168.1.0 0.0.0.255

  network 192.168.2.0 0.0.0.255

  network 2.2.2.2 0.0.0.0

#

static-lsp transit RAtoRC incoming-interface Pos1/0/0 in-label 20 nexthop 192.168.2.1 out-label 40

#

return

RouterC的配置文件
#

sysname RouterC

#

mpls lsr-id 3.3.3.3

mpls

#

interface Pos1/0/0

link-protocol ppp

ip address 192.168.2.2 255.255.255.0

mpls

#

interface Pos2/0/0

link-protocol ppp

ip address 192.168.4.2 255.255.255.0

mpls

#

interface LoopBack1

ip address 3.3.3.3 255.255.255.255

#

ospf 1

area 0.0.0.0

  network 192.168.2.0 0.0.0.255

  network 192.168.4.0 0.0.0.255

  network 3.3.3.3 0.0.0.0

#

static-lsp egress RAtoRC incoming-interface Pos1/0/0 in-label 40

static-lsp ingress RCtoRA destination 1.1.1.1 32 nexthop 192.168.4.2 out-label 30

#

return

RouterD的配置文件
#

sysname RouterD

#

mpls lsr-id 4.4.4.4

mpls

#

interface Pos1/0/0

link-protocol ppp

ip address 192.168.3.2 255.255.255.0

mpls

#

interface Pos2/0/0

link-protocol ppp

ip address 192.168.4.1 255.255.255.0

mpls

#

interface LoopBack1

ip address 4.4.4.4 255.255.255.255

#

ospf 1

area 0.0.0.0

  network 192.168.3.0 0.0.0.255

  network 192.168.4.0 0.0.0.255

  network 4.4.4.4 0.0.0.0

#

static-lsp transit RCtoRA incoming-interface Pos2/0/0 in-label 30 nexthop 192.168.3.1 out-label 60

#

return





                               
登录/注册后可看大图
该贴已经同步到 COCO999的微博
 楼主| 发表于 2011-8-11 11:28:36 | 显示全部楼层
沙发 2011-8-11 11:28:36 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-3-5 16:38:20 | 显示全部楼层
用的是什么模拟器啊?
板凳 2012-3-5 16:38:20 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-5-16 12:05:30 | 显示全部楼层
不会弄个文档吗?
地板 2012-5-16 12:05:30 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-3-15 13:54:22 | 显示全部楼层
5# 2013-3-15 13:54:22 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2015-1-27 17:12:58 | 显示全部楼层
突然想学些学习MPLS VPN 还没有看希望有帮助。
6# 2015-1-27 17:12:58 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2015-8-12 23:05:51 | 显示全部楼层
说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit,
8# 2015-8-12 23:05:51 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2015-8-12 23:05:57 | 显示全部楼层
说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit,
9# 2015-8-12 23:05:57 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2015-8-12 23:06:04 | 显示全部楼层
说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit,
10# 2015-8-12 23:06:04 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2015-8-12 23:06:10 | 显示全部楼层
说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit,
11# 2015-8-12 23:06:10 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2015-8-12 23:06:16 | 显示全部楼层
说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit,
12# 2015-8-12 23:06:16 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2016-2-28 11:44:59 | 显示全部楼层
说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit,
13# 2016-2-28 11:44:59 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2016-7-5 17:12:14 | 显示全部楼层
说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit,
14# 2016-7-5 17:12:14 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-1 16:52 , Processed in 0.067911 second(s), 12 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表