MSR路由器MPLS 静态LSP的典型配置
一、组网需求
1. Router 1、Router2、Router3均支持MPLS;
2. Router1和Router3之间建立静态LSP,使得11.1.1.1和33.3.3.3两个网段的互访能够通过 MPLS进行传输;
3. 检测Router1和Router3之间静态LSP的可达性。
设备清单:MSR路由器3台
二、组网图
图一 MSR路由器MPLS建立静态LSP组网图
三、配置步骤
Router1配置:
[Router1]display current-configuration
#
version 5.20, Release 2318, Standard
#
sysname Router1
#
mpls lsr-id 1.1.1.1
#
interface LoopBack0
ip address 11.1.1.1 255.255.255.255
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
//接口使能MPLS功能
interface GigabitEthernet0/0
port link-mode route
ip address 12.1.1.1 255.255.255.0
mpls
#
//配置掩码为32的路由条目
ip route-static 33.3.3.3 255.255.255.255 12.1.1.2
#
//配置为33.3.3.3/32分配标签,出标签为30
static-lsp ingress atoc destination 33.3.3.3 32 nexthop 12.1.1.2 out-label 30
static-lsp egress ctoa incoming-interface GigabitEthernet0/0 in-label 70
Router2配置:
<Router2>display current-configuration
#
version 5.20, Release 2105P31, Standard
#
sysname Router2
#
mpls lsr-id 2.2.2.2
#
mpls
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
//接口G0/0使能MPLS功能
interface GigabitEthernet0/0
port link-mode route
ip address 12.1.1.2 255.255.255.0
mpls
#
//接口G0/1使能MPLS功能
interface GigabitEthernet0/1
port link-mode route
ip address 23.1.1.1 255.255.255.0
mpls
#
//配置静态LSP
static-lsp transit atoc incoming-interface GigabitEthernet0/0 in-label 30 nexthop 23.1.1.2 out-label 50
static-lsp transit ctoa incoming-interface GigabitEthernet0/1 in-label 40 nexthop 12.1.1.1 out-label 70
Router3配置:
[Router3]display current-configuration
#
version 5.20, Release 2311, Standard
#
sysname Router3
#
mpls lsr-id 3.3.3.3
#
interface LoopBack0
ip address 33.3.3.3 255.255.255.255
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
//使能MPLS功能
interface GigabitEthernet0/1
port link-mode route
ip address 23.1.1.2 255.255.255.0
mpls
#
//配置24位的静态路由
ip route-static 11.1.1.0 255.255.255.0 23.1.1.1
#
//为11.1.1.0/24分配标签
static-lsp ingress ctoa destination 11.1.1.0 24 nexthop 23.1.1.1 out-label 40
static-lsp egress atoc incoming-interface GigabitEthernet0/1 in-label 50
四、测试过程
//显示为FEC静态分配的标签
[Router1]display mpls static-lsp
total statics-lsp : 2
Name FEC I/O Label I/O If State
atoc 33.3.3.3/32 NULL/30 -/GE0/0 Up
ctoa -/- 70/NULL GE0/0/- Up
//查看Router1的全局FIB表项,token值为3
[Router1]display fib
Destination/Mask Nexthop Flag OutInterface InnerLabel Token
33.3.3.3/32 12.1.1.2 USGH GE0/0 Null 3
//查看Router1的NHLFE表象,Token3对应动作为压入标签30
[Router1]display mpls nhlfe
Total NHLFE Entry: 1
Out-Interface Token Oper Nexthop Deep Stack
------------------------------------------------------------------------
GE0/0 3 PUSH 12.1.1.2 1 30
//查看Router3的全局FIB表,token值为2
[Router3]display fib
Destination/Mask Nexthop Flag OutInterface InnerLabel Token
11.1.1.0/24 23.1.1.1 USG GE0/1 Null 2
//查看Router3的NHLFE表,token为2,对应动作为压入标签40
[Router3]display mpls nhlfe
Out-Interface Token Oper Nexthop Deep Stack
------------------------------------------------------------------------
GE0/1 2 PUSH 23.1.1.1 1 40
//测试静态LSP的连通性
[Router1]ping lsp -a 11.1.1.1 ipv4 33.3.3.3 32
LSP Ping FEC: IPV4 PREFIX 33.3.3.3/32 : 100 data bytes, press CTRL_C to break
Reply from 23.1.1.2: bytes=100 Sequence=1 time = 2 ms
Reply from 23.1.1.2: bytes=100 Sequence=2 time = 2 ms
Reply from 23.1.1.2: bytes=100 Sequence=3 time = 2 ms
Reply from 23.1.1.2: bytes=100 Sequence=4 time = 1 ms
Reply from 23.1.1.2: bytes=100 Sequence=5 time = 1 ms
--- FEC: IPV4 PREFIX 33.3.3.3/32 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/2 ms
//本地是为33.3.3.3/32分的标签(查看static-lsp表可以看出),因此:
[Router1]ping lsp -a 11.1.1.1 ipv4 33.3.3.0 24
Error: Unknown lsp.
//在Router3上进行LSP可达性测试
[Router3]ping lsp -a 33.3.3.3 ipv4 11.1.1.0 24
LSP Ping FEC: IPV4 PREFIX 11.1.1.0/24 : 100 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
[Router1]display ip routing-table
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost NextHop Interface
11.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
33.3.3.3/32 Static 60 0 12.1.1.2 GE0/0
原因分析:
Router3本地封装好标签,经过中间网络的MPLS转发,到达Router1后,查找目的地址11.1.1.0,没有对应的路由表项,因此丢弃
而对端Router1 可以ping通,因为使用的是33.3.3.3/32,对端可以找到对应路由,而回包的时候,11.1.1.1可以匹配上11.1.1.0/24的路由,是可以打上标签的
Router3如果采用如下配置:
ip route-static 11.1.1.1 255.255.255.255 23.1.1.1
static-lsp ingress ctoa destination 11.1.1.0 24 nexthop 23.1.1.1 out-label 40
//上面路由和静态LSP不匹配(路由是32位,LSP是24位)则:
[Router3]display mpls static-lsp
total statics-lsp : 2
Name FEC I/O Label I/O If State
ctoa 11.1.1.0/24 NULL/40 -/GE0/1 Down
//Router3配置LSP和路由同为32的时候,LSP状态是Up的
ip route-static 11.1.1.1 255.255.255.255 23.1.1.1
static-lsp ingress ctoa destination 11.1.1.1 32 nexthop 23.1.1.1 out-label 40
[Router3]display mpls static-lsp
total statics-lsp : 2
Name FEC I/O Label I/O If State
ctoa 11.1.1.1/32 NULL/40 -/GE0/1 Up
[Router3]ping lsp -a 33.3.3.3 ipv4 11.1.1.1 32
LSP Ping FEC: IPV4 PREFIX 11.1.1.1/32 : 100 data bytes, press CTRL_C to break
Reply from 12.1.1.1: bytes=100 Sequence=1 time = 2 ms
Reply from 12.1.1.1: bytes=100 Sequence=2 time = 1 ms
Reply from 12.1.1.1: bytes=100 Sequence=3 time = 1 ms
Reply from 12.1.1.1: bytes=100 Sequence=4 time = 1 ms
Reply from 12.1.1.1: bytes=100 Sequence=5 time = 1 ms
修改上述组网:
将Router1的loopback0接口删除,在Router1的G0/1接口配置11.1.1.1/24,保证接口Up
[Router1]interface LoopBack 0
[Router1-LoopBack0]undo ip address
[Router1]interface GigabitEthernet 0/1
[Router1-GigabitEthernet0/1]ip address 11.1.1.1 24
[Router1]display ip routing-table
11.1.1.0/24 Direct 0 0 11.1.1.1 GE0/1
//再次在Router3进行LSP可达性测试
[Router3]ping lsp -a 33.3.3.3 ipv4 11.1.1.0 24
LSP Ping FEC: IPV4 PREFIX 11.1.1.0/24 : 100 data bytes, press CTRL_C to break
Reply from 12.1.1.1: bytes=100 Sequence=1 time = 2 ms
Reply from 12.1.1.1: bytes=100 Sequence=2 time = 2 ms
Reply from 12.1.1.1: bytes=100 Sequence=3 time = 2 ms
Reply from 12.1.1.1: bytes=100 Sequence=4 time = 1 ms
Reply from 12.1.1.1: bytes=100 Sequence=5 time = 1 ms
原因在于Router1本地存在11.1.1.0/24位的路由条目,可以找到对应的出口
五、配置关键点
1.手工指定静态LSP时,需要遵循以下原则:一条LSP,上游LSR出标签的值与下游LSR入标签的值相同;
2.LSP是一条单向路径,因此需要在数据传输的两个方向上分别配置一条静态LSP;
3.配置静态LSP时,只要求在Ingress节点上存在到达FEC目的地址的路由,Transit节点和Egresss节点上不需要存在到达FEC目的地址的路由,因此无需配置路由协议保证路由器之间路由的可达性,只需要在Ingress节点上配置到达FEC目的地址的静态路由即可,在P设备依靠标签交换进行转发。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作