玩转华为ENSP模拟器系列 | 配置静态LSP示例

素材来源:华为路由器配置指南

一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全


目标

介绍静态LSP的配置过程,包括在各设备以及各接口使能MPLS。

组网需求

如图1所示,各节点均支持MPLS,运行OSPF作为MPLS骨干网上的IGP。

在LSRA和LSRD之间建立双向静态LSP。其中从LSRA到LSRD的LSP路径为LSRA→LSRB→LSRD;从LSRD到LSRA的LSP路径为LSRD→LSRC→LSRA。

配置思路

  • 配置各节点接口的IP地址及作为LSR ID的Loopback地址,并用OSPF协议通告各接口所连网段和LSR ID主机路由。
  • 全局使能各节点的MPLS。
  • 使能各接口的MPLS。
  • 在Ingress配置此LSP的目的地址、下一跳和出标签的值。
  • 在Transit配置此LSP的入接口、与上一节点出标签相等的入标签的值、对应的下一跳和出标签的值。
  • 在Egress配置此LSP的入接口及与上一节点出标签相等的入标签的值。

操作步骤

  1. 配置各接口的IP地址

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

  1. 配置OSPF协议发布各节点接口所连网段和LSR ID的主机路由

配置LSRA。

LSRA:
ospf 1
 area 0.0.0.0
  network 1.1.1.9 0.0.0.0
  network 10.1.1.0 0.0.0.3
  network 10.3.1.0 0.0.0.3

配置LSRB。

LSRB:
ospf 1
 area 0.0.0.0
  network 2.2.2.9 0.0.0.0
  network 10.1.1.0 0.0.0.3
  network 10.2.1.0 0.0.0.3

配置LSRC。

LSRC:
ospf 1
 area 0.0.0.0
  network 3.3.3.9 0.0.0.0
  network 10.3.1.0 0.0.0.3
  network 10.4.1.0 0.0.0.3

配置LSRD。

LSRD:
ospf 1
 area 0.0.0.0
  network 4.4.4.9 0.0.0.0
  network 10.2.1.0 0.0.0.3
  network 10.4.1.0 0.0.0.3

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

LSRA上的显示为:

[~LSRA-ospf-1]dis ip routing-table 
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole
 route
------------------------------------------------------------------------------
Routing Table : _public_
         Destinations : 16       Routes : 17        
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface
        1.1.1.9/32  Direct  0    0             D   127.0.0.1       LoopBack1
        2.2.2.9/32  OSPF    10   1             D   10.1.1.2        Ethernet1/0/0
        3.3.3.9/32  OSPF    10   1             D   10.3.1.2        Ethernet1/0/1
        4.4.4.9/32  OSPF    10   2             D   10.3.1.2        Ethernet1/0/1
                    OSPF    10   2             D   10.1.1.2        Ethernet1/0/0
       10.1.1.0/30  Direct  0    0             D   10.1.1.1        Ethernet1/0/0
       10.1.1.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
       10.1.1.3/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
       10.2.1.0/30  OSPF    10   2             D   10.1.1.2        Ethernet1/0/0
       10.3.1.0/30  Direct  0    0             D   10.3.1.1        Ethernet1/0/1
       10.3.1.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
       10.3.1.3/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
       10.4.1.0/30  OSPF    10   2             D   10.3.1.2        Ethernet1/0/1
      127.0.0.0/8   Direct  0    0             D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0             D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
[~LSRA-ospf-1]

由LSRA到LSRD上4.4.4.9/32的静态LSP的下一跳/出接口由路由表决定,已用粗体表示。本例中选用下一跳IP地址为10.1.1.2/30。

LSRD上的显示为:

[~LSRD-ospf-1]dis ip routing-table 
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole
 route
------------------------------------------------------------------------------
Routing Table : _public_
         Destinations : 16       Routes : 17        
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface
        1.1.1.9/32  OSPF    10   2             D   10.4.1.1        Ethernet1/0/1
                    OSPF    10   2             D   10.2.1.1        Ethernet1/0/0
        2.2.2.9/32  OSPF    10   1             D   10.2.1.1        Ethernet1/0/0
        3.3.3.9/32  OSPF    10   1             D   10.4.1.1        Ethernet1/0/1
        4.4.4.9/32  Direct  0    0             D   127.0.0.1       LoopBack1
       10.1.1.0/30  OSPF    10   2             D   10.2.1.1        Ethernet1/0/0
       10.2.1.0/30  Direct  0    0             D   10.2.1.2        Ethernet1/0/0
       10.2.1.2/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
       10.2.1.3/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
       10.3.1.0/30  OSPF    10   2             D   10.4.1.1        Ethernet1/0/1
       10.4.1.0/30  Direct  0    0             D   10.4.1.2        Ethernet1/0/1
       10.4.1.2/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
       10.4.1.3/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
      127.0.0.0/8   Direct  0    0             D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0             D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
[~LSRD-ospf-1]

由LSRD到LSRA上1.1.1.9/32的静态LSP的下一跳/出接口由路由表决定,已用粗体表示。本例中选用下一跳IP地址为10.4.1.1/30。

  1. 配置各节点全局的MPLS能力

配置LSRA。

LSRA:
mpls lsr-id 1.1.1.9
mpls

配置LSRB。

LSRB:
mpls lsr-id 2.2.2.9
mpls

配置LSRC。

LSRC:
mpls lsr-id 3.3.3.9
mpls

配置LSRD。

LSRD:
mpls lsr-id 4.4.4.9
mpls
  1. 配置各接口的MPLS能力

配置LSRA。

LSRA:
interface Ethernet1/0/0
 mpls
interface Ethernet1/0/1
 mpls

配置LSRB。

LSRB:
interface Ethernet1/0/0
 mpls
interface Ethernet1/0/1
 mpls

配置LSRC。

LSRC:
interface Ethernet1/0/0
 mpls
interface Ethernet1/0/1
 mpls

配置LSRD。

LSRD:
interface Ethernet1/0/0
 mpls
interface Ethernet1/0/1
 mpls
  1. 创建从LSRA到LSRD的静态LSP

配置Ingress LSRA。

LSRA:
static-lsp ingress RAtoRD destination 4.4.4.9 32 nexthop 10.1.1.2 out-label 20

配置Transit LSRB。

LSRB:
static-lsp transit RAtoRD incoming-interface Ethernet1/0/0 in-label 20 nexthop 1
0.2.1.2 out-label 40

配置Egress LSRD。

LSRD:
static-lsp egress RAtoRD incoming-interface Ethernet1/0/0 in-label 40

配置完成后,可在各节点上用display mpls static-lsp命令查看静态LSP的状态。以LSRA的显示为例:

[~LSRA]dis mpls static-lsp
TOTAL          : 1     STATIC LSP(S)
UP             : 1     STATIC LSP(S)
DOWN           : 0     STATIC LSP(S)
Name                FEC                I/O Label        I/O If                  
                          Status
RAtoRD              4.4.4.9/32         NULL/20          -/Ethernet1/0/0         
                          Up

LSP是单向的,需要再配置LSRD到LSRA的静态LSP。

  1. 创建从LSRD到LSRA的静态LSP

用同样的方法可配置LSRD到LSRA的静态LSP。

配置Ingress LSRD。

LSRD:
static-lsp ingress RDtoRA destination 1.1.1.9 32 nexthop 10.4.1.1 out-label 30

配置Transit LSRC。

LSRC:
static-lsp transit RDtoRA incoming-interface Ethernet1/0/1 in-label 30 nexthop 1
0.3.1.1 out-label 60

配置Egress LSRA。

LSRA:
static-lsp egress RDtoRA incoming-interface Ethernet1/0/1 in-label 60
  1. 检查配置结果

配置完成后,在LSRD上执行命令ping lsp ip 1.1.1.9 32,发现ping lsp是通的。

[~LSRD]ping lsp ip 1.1.1.9 32
  LSP PING FEC: IPV4 PREFIX 1.1.1.9/32/ : 100  data bytes, press CTRL_C to break
    Reply from 10.3.1.1: bytes=100 Sequence=1 time=17 ms
    Reply from 10.3.1.1: bytes=100 Sequence=2 time=9 ms
    Reply from 10.3.1.1: bytes=100 Sequence=3 time=11 ms
    Reply from 10.3.1.1: bytes=100 Sequence=4 time=8 ms
    Reply from 10.3.1.1: bytes=100 Sequence=5 time=14 ms
  --- FEC: IPV4 PREFIX 1.1.1.9/32 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 8/11/17 ms
 
[~LSRD]

然后在各节点上用display mpls static-lsp或display mpls static-lsp verbose命令查看静态LSP的状态及其详细信息。以LSRD的显示为例:

[~LSRD]dis mpls static-lsp
TOTAL          : 2     STATIC LSP(S)
UP             : 2     STATIC LSP(S)
DOWN           : 0     STATIC LSP(S)
Name                FEC                I/O Label        I/O If                  
                          Status
RAtoRD              -/-                40/NULL          Ethernet1/0/0/-         
                          Up
RDtoRA              1.1.1.9/32         NULL/30          -/Ethernet1/0/1         
                          Up
[~LSRD]dis mpls static-lsp verbose 
 No              : 1
 LSP-Name        : RAtoRD
 LSR-Type        : Egress
 FEC             : -/-
 In-Label        : 40
 Out-Label       : NULL
 In-Interface    : Ethernet1/0/0
 Out-Interface   : -
 NextHop         : -
 Static-Lsp Type : Normal
 Lsp Status      : Up
 No              : 2
 LSP-Name        : RDtoRA
 LSR-Type        : Ingress
 FEC             : 1.1.1.9/32
 In-Label        : NULL
 Out-Label       : 30
 In-Interface    : -
 Out-Interface   : Ethernet1/0/1
 NextHop         : 10.4.1.1
 Static-Lsp Type : Normal
 Lsp Status      : Up
[~LSRD] 

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值