MPLS-静态标签-配置小例子

一、拓扑图:

MPLS-静态标签-配置小例子_第1张图片

二、路由器之间运行isis宣告各个接口配置如下

  R1配置:

sys
#
sysname R1
#
mpls lsr-id 10.10.1.1
mpls
isis 
net 49.0001.0000.0000.0001.00
#
interface GigabitEthernet0/0/0
ip address 10.12.1.1 24
isis en
mpls
#
interface LoopBack0
ip address 10.10.1.1 255.255.255.255
isis en
#
static-lsp ingress R3 destination 10.10.1.3 32 nexthop 10.12.1.2 out-label 20 
static-lsp egress R1 incoming-interface GigabitEthernet0/0/0 in-label 60
#
return
#

R2配置:

sys
#
sysname R2
#
mpls lsr-id 10.10.1.2
mpls
isis
net 49.0001.0000.0000.0002.00
#
interface GigabitEthernet0/0/0
ip address 10.12.1.2 24
isis en
mpls
#
interface GigabitEthernet0/0/1
ip address 10.23.1.2 24 
mpls
isis en 
#
interface LoopBack0
ip address 10.10.1.2 255.255.255.255
isis en
#
static-lsp transit R3 incoming-interface GigabitEthernet0/0/0 in-label 20 nexthop 10.23.1.3 out-label 40 
static-lsp transit R1 incoming-interface GigabitEthernet0/0/1 in-label 30 nexthop 10.12.1.1 out-label 60
#
return
#

R3配置:

sys
sysname R3
#
mpls lsr-id 10.10.1.3
mpls
isis 
net 49.0001.0000.0000.0003.00
#
interface GigabitEthernet0/0/0
ip address 10.23.1.3 24
isis en
mpls
#
interface LoopBack0
ip address 10.10.1.3 255.255.255.255
isis en 
#
#
static-lsp egress R3 incoming-interface GigabitEthernet0/0/0 in-label 40
static-lsp ingress R1 destination 10.10.1.1 32 nexthop 10.23.1.2 out-label 30
#
return
#

注意:静态LSP与静态CR-LSP使用相同的标签空间(16~1023)。配置静态LSP时需要遵循的原则是:前一节点出标签的值等于下一个节点入标签的值。

static-lsp egress 和  static-lsp transit  的in-label  整数形式,取值范围是16~1023 

static-lsp ingress 和 static-lsp transit  的out-label  整数形式,取值范围是16~1048575

三、各个路由器之间不运行动态路由协议,在R1和R3上配置去往mpls标签转发目标的明细路由。

R1配置:

sys
#
sysname R1
#
mpls lsr-id 10.10.1.1
mpls
#
interface GigabitEthernet0/0/0
ip address 10.12.1.1 24
mpls
#
interface LoopBack0
ip address 10.10.1.1 255.255.255.255
#
static-lsp ingress R3 destination 10.10.1.3 32 nexthop 10.12.1.2 out-label 20 
static-lsp egress R1 incoming-interface GigabitEthernet0/0/0 in-label 60
#
ip route-static 10.10.1.3 255.255.255.255 10.12.1.2
#
return
#

R2配置:

sys
#
sysname R2
#
mpls lsr-id 10.10.1.2
mpls
#
interface GigabitEthernet0/0/0
ip address 10.12.1.2 24
 mpls
#
interface GigabitEthernet0/0/1
ip address 10.23.1.2 24 
mpls
#
interface LoopBack0
ip address 10.10.1.2 255.255.255.255
#
static-lsp transit R3 incoming-interface GigabitEthernet0/0/0 in-label 20 nexthop 10.23.1.3 out-label 40 
static-lsp transit R1 incoming-interface GigabitEthernet0/0/1 in-label 30 nexthop 10.12.1.1 out-label 60
#
return
#

R3配置:


sys
sysname R3
#
mpls lsr-id 10.10.1.3
mpls
#
interface GigabitEthernet0/0/0
ip address 10.23.1.3 24
mpls
#
interface LoopBack0
ip address 10.10.1.3 255.255.255.255
#
static-lsp egress R3 incoming-interface GigabitEthernet0/0/0 in-label 40
static-lsp ingress R1 destination 10.10.1.1 32 nexthop 10.23.1.2 out-label 30
#
ip route-static 10.10.1.1 255.255.255.255 10.23.1.2
#
return
#

检测能不能通:用ping ping -a 10.10.1.1 10.10.1.3  注意一定要加上-a制定源地址 这样才能保证回程也能出发mpls转发。

MPLS-静态标签-配置小例子_第2张图片

 

 

MPLS-静态标签-配置小例子_第3张图片

静态mpls中的除了ingress 要有去往目标的明细路由 ,中间transit 设备不需要有明细路由即可根据设置的标签转发。

-------------------------对网络感兴趣的朋友可以加我微信:【piaofeng0129】一起交流讨论。

 

你可能感兴趣的:(MPLS-多协议标签转发)