OSPF 路由控制-过滤Type 3 LSA示例

组网需求

  1. 组网中有R1、R2、R3三个路由器,R1、R2属于核心区域,R2、R3属于Area 1
  2. 过滤区域1内的Type 3 LSA

组网拓扑

OSPF路由控制-过滤Type 3 LSA

配置思路

  1. 配置路由器基本功能以及各个接口IP地址
  2. 配置OSPF路由协议,宣告路由
  3. 在ABR设备上配置过滤Type 3 LSA
  4. 在ABR设备上配置缺省路由

配置命令

  1. 配置路由器基本功能以及各个接口IP地址

    • R1配置

      1
      2
      3
      4
      sys
      sys R1
      int g0/0/0
      ip add 10.1.12.1 30
  • R2配置

    1
    2
    3
    4
    5
    6
    sys
    sys R2
    int g0/0/0
    ip add 10.1.12.2 30
    int g0/0/1
    ip add 10.1.23.1 30
  • R3配置

    1
    2
    3
    4
    5
    6
    sys
    sys R3
    int g0/0/1
    ip add 10.1.23.2 30
    int LoopBack 0
    ip add 10.1.3.3
  1. 配置OSPF路由协议,宣告路由

    • R1配置

      1
      2
      3
      4
      sys
      ospf 1 router-id 10.1.1.1
      area 0
      network 10.1.12.0 0.0.0.3
  • R2配置

    1
    2
    3
    4
    5
    6
    sys
    ospf 1 router-id 10.1.2.2
    area 0
    network 10.1.12.0 0.0.0.3
    area 1
    network 10.1.23.0 0.0.0.3
  • R3配置

    1
    2
    3
    4
    5
    sys
    ospf 1 router-id 10.1.3.3
    area 1
    network 10.1.23.0 0.0.0.3
    network 10.1.3.3 0.0.0.0
  1. 过滤Type 3 LSA

    • R2配置

      1
      2
      3
      4
      5
      6
      7
      sys
      acl 2000
      rule 1 deny
      quit
      ospf 1
      aera 1
      filter 2000 import
  2. 如果要实现路由互通,需要在R2配置默认路由

    • R2配置

      1
      2
      3
      sys
      ospf 1
      default-route-advertise always

查看结果

  1. 查看未过滤前R3的路由表以及LSDB

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    display ip routing-table

    <R3>display ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
    Destinations : 9 Routes : 9

    Destination/Mask Proto Pre Cost Flags NextHop Interface

    10.1.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
    10.1.12.0/30 OSPF 10 2 D 10.1.23.1 GigabitEthernet
    0/0/1
    10.1.23.0/30 Direct 0 0 D 10.1.23.2 GigabitEthernet
    0/0/1
    10.1.23.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
    0/0/1
    10.1.23.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
    0/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

    display ospf lsdb

    <R3>display ospf lsdb

    OSPF Process 1 with Router ID 10.1.3.3
    Link State Database

    Area: 0.0.0.1
    Type LinkState ID AdvRouter Age Len Sequence Metric
    Router 10.1.3.3 10.1.3.3 47 48 80000006 1
    Router 10.1.2.2 10.1.2.2 48 36 80000004 1
    Network 10.1.23.2 10.1.3.3 47 32 80000001 0
    Sum-Net 10.1.12.0 10.1.2.2 48 28 80000001 1
  1. 查看过滤后R3的路由表以及LSDB

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    display ip routing-table

    <R3>display ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
    Destinations : 8 Routes : 8

    Destination/Mask Proto Pre Cost Flags NextHop Interface

    10.1.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
    10.1.23.0/30 Direct 0 0 D 10.1.23.2 GigabitEthernet
    0/0/1
    10.1.23.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
    0/0/1
    10.1.23.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
    0/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

    display ospf lsdb

    <R3>display ospf lsdb

    OSPF Process 1 with Router ID 10.1.3.3
    Link State Database

    Area: 0.0.0.1
    Type LinkState ID AdvRouter Age Len Sequence Metric
    Router 10.1.3.3 10.1.3.3 131 48 80000006 1
    Router 10.1.2.2 10.1.2.2 132 36 80000004 1
    Network 10.1.23.2 10.1.3.3 131 32 80000001 0
吴超 wechat
subscribe to my blog by scanning my public wechat account