华为 MPLS VPN 配置静态 LSP
应用环境标签交换路径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组网图
适用产品和版本
路由器可以使用任意一款NE产品。版本为(VRP5.10)及后续版本
配置步骤
步骤 1 配置各接口的IP地址
按照上图配置各接口IP地址和掩码,包括Loopback接口,具体配置过程略。
步骤 2 配置OSPF协议发布各路由器接口所连网段和LSR ID的主机路由
# 配置RouterA。
<RouterA> system-view
ospf
area 0
network 1.1.1.1 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.3.0 0.0.0.255
quit
quit
# 配置RouterB。
<RouterB> system-view
ospf
area 0
network 2.2.2.2 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
quit
quit
# 配置RouterC。
<RouterC> system-view
ospf
area 0
network 3.3.3.3 0.0.0.0
network 192.168.2.0 0.0.0.255
network 192.168.4.0 0.0.0.255
quit
quit
# 配置RouterD。
<RouterD> system-view
ospf
area 0
network 4.4.4.4 0.0.0.0
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
quit
quit
配置完成后,在各路由器上执行display ip routing-table命令,可以看到相互之间都学到了到对方的路由。
RouterA上的显示为:
display ip routing-table
Routing Tables: Public
Destinations : 12 Routes : 13
Destination/Mask ProtoPreCost NextHop Interface
1.1.1.1/32Direct 0 0 127.0.0.1 InLoopBack0
2.2.2.2/32OSPF 10 2 192.168.1.2 Pos1/0/0
3.3.3.3/32OSPF 10 3 192.168.1.2 Pos1/0/0
OSPF 10 3 192.168.3.2 Pos2/0/0
4.4.4.4/32OSPF 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/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.1.0/24Direct 0 0 192.168.1.1 Pos1/0/0
192.168.1.1/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.2.0/24OSPF 10 2 172.1.2.1 Pos1/0/0
192.168.3.0/24Direct 0 0 192.168.3.1 Pos2/0/0
192.168.3.1/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.4.0/24OSPF 10 2 192.168.3.2 Pos2/0/0
由RouterA到RouterC上3.3.3.3/32的静态LSP的下一跳/出接口由路由表决定,已用粗体表示。
RouterB上的显示为:
display ip routing-table
Routing Tables: Public
Destinations : 12 Routes : 13
Destination/Mask ProtoPreCost NextHop Interface
1.1.1.1/32OSPF 10 2 192.168.1.1 Pos1/0/0
2.2.2.2/32Direct 0 0 127.0.0.1 InLoopBack0
3.3.3.3/32OSPF 10 2 192.168.2.2 Pos2/0/0
4.4.4.4/32OSPF 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/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.1.0/24Direct 0 0 192.168.1.2 Pos1/0/0
192.168.1.2/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.2.0/24Direct 0 0 192.168.2.1 Pos2/0/0
192.168.2.1/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.3.0/24OSPF 10 2 192.168.1.1 Pos1/0/0
192.168.4.0/24OSPF 10 2 192.168.2.2 Pos2/0/0
由RouterA到RouterC上3.3.3.3/32的静态LSP在此节点的下一跳/出接口由路由表决定,已用粗体表示。
RouterC上的显示为:
display ip routing-table
Routing Tables: Public
Destinations : 12 Routes : 13
Destination/Mask ProtoPreCost NextHop Interface
1.1.1.1/32OSPF 10 3 192.168.2.1 Pos1/0/0
OSPF 10 3 192.168.4.1 Pos2/0/0
2.2.2.2/32OSPF 10 2 192.168.2.1 Pos1/0/0
3.3.3.3/32Direct 0 0 127.0.0.1 InLoopBack0
4.4.4.4/32OSPF 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/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.1.0/24OSPF 10 2 192.168.2.1 Pos1/0/0
192.168.2.0/24Direct 0 0 192.168.2.2 Pos1/0/0
192.168.2.2/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.3.0/24OSPF 10 2 192.168.4.1 Pos2/0/0
192.168.4.0/24Direct 0 0 192.168.4.2 Pos2/0/0
192.168.4.2/32Direct 0 0 127.0.0.1 InLoopBack0
LSP是单向的,需要再配置RouterC到RouterA的静态LSP。
这条LSP也可使用静态路由来创建,在RouterC上引入一个静态路由。
ip route-static 1.1.1.1 32 pos 2/0/0 preference 5
查看RouterC上的路由:
display ip routing-table
Routing Tables: Public
Destinations : 12 Routes : 12
Destination/Mask ProtoPreCost NextHop Interface
1.1.1.1/32Static 5 0 192.168.4.1 Pos2/0/0
2.2.2.2/32OSPF 10 2 192.168.2.1 Pos1/0/0
3.3.3.3/32Direct 0 0 127.0.0.1 InLoopBack0
4.4.4.4/32OSPF 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/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.1.0/24OSPF 10 2 192.168.2.1 Pos1/0/0
192.168.2.0/24Direct 0 0 192.168.2.2 Pos1/0/0
192.168.2.2/32Direct 0 0 127.0.0.1 InLoopBack0
192.168.3.0/24OSPF 10 2 192.168.4.1 Pos2/0/0
192.168.4.0/24Direct 0 0 192.168.4.2 Pos2/0/0
192.168.4.2/32Direct 0 0 127.0.0.1 InLoopBack0
由RouterC到RouterA上1.1.1.1/32的静态LSP的下一跳/出接口由路由表决定,已用粗体表示。
步骤 3 配置路由器和接口的MPLS基本能力
# 配置RouterA。
mpls lsr-id 1.1.1.1
mpls
quit
interface pos 1/0/0
mpls
quit
interface pos 2/0/0
mpls
quit
# 配置RouterB。
mpls lsr-id 2.2.2.2
mpls
quit
interface pos 1/0/0
mpls
quit
interface pos 2/0/0
mpls
quit
# 配置RouterC。
mpls lsr-id 3.3.3.3
mpls
quit
interface pos 1/0/0
mpls
quit
interface pos 2/0/0
mpls
quit
# 配置RouterD。
mpls lsr-id 4.4.4.4
mpls
quit
interface pos 1/0/0
mpls
quit
interface pos 2/0/0
mpls
quit
步骤 4 创建从RouterA到RouterC的静态LSP。
# 配置入节点RouterA。
static-lsp ingress RAtoRC destination 3.3.3.3 32 nexthop 192.168.1.2 out-label 20
# 配置中间节点RouterB。
static-lsp transit RAtoRC incoming-interface pos 1/0/0 in-label 20 nexthop 192.168.2.1 out-label 40
# 配置出节点RouterC。
static-lsp egress RAtoRC incoming-interface pos 1/0/0 in-label 40
配置完成后,可在各路由器上用display mpls static-lsp verbose或display mpls lsp命令查看LSP的状态。以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
display mpls lsp
----------------------------------------------------------------------
LSP Information: STATIC LSP
----------------------------------------------------------------------
FEC In/Out LabelIn/Out IF Vrf Name
3.3.3.3/32 NULL/20 -/Pos1/0/0
步骤 5 创建从RouterC到RouterA的静态LSP。
用同样的方法可配置RouterC到RouterA的静态LSP。
# 配置入节点RouterC。
static-lsp ingress RCtoRA destination 1.1.1.1 32 nexthop 192.168.4.2 out-label 30
# 配置中间节点RouterD。
static-lsp transit RCtoRA incoming-interface pos 2/0/0 in-label 30 nexthop 192.168.3.1 out-label 60
# 配置出节点RouterA。
static-lsp egress RCtoRA incoming-interface pos 2/0/0 in-label 60
验证结果
配置完成后,可在各路由器上用display mpls static-lsp或display mpls lsp命令查看LSP的状态。以RouterA的显示为例:
display mpls static-lsp
Name FEC I/O LabelI/O If Stat
RAtoRC 3.3.3.3/32 NULL/20 -/Pos1/0/0 Up
RCtoRA -/- 60/NULL Pos2/0/0/- Up
display mpls lsp
----------------------------------------------------------------------
LSP Information: STATIC LSP
----------------------------------------------------------------------
FEC In/Out LabelIn/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
http://bbs.hh010.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 COCO999的微博 {:6_267:} 用的是什么模拟器啊?
{:6_282:}不会弄个文档吗? {:6_290:} {:1_1:} 突然想学些学习MPLS VPN 还没有看希望有帮助。 赞一个:lol 说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit, 说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit, 说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit, 说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit, 说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit, 说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit, 说的不够完整,静态LSP只管单向,所以A-B-C要配来去两条,A-D-C也要配来去两条,即RA、RC上有4条,俩ingress,俩egress,RB、RD上各俩transit, {:6_267:}{:6_267:}
页:
[1]
2