精华内容
下载资源
问答
  • 文章目录前言:一、OSPF重分发理论1.1 OSPF 6类LSA用途回顾1.2 OSPF协议的区域简介二、OSPF重分发实验2.1 实验拓扑2.2 路由器R1配置2.3 路由器R2配置2.4 路由器R3配置2.5 路由R4配置2.6 路由器R5配置2.7 路由器R6...

    前言:

    前篇博客介绍了OSPF的基础理论和配置实验,本篇博客主要介绍OSPF多区域的路由器设置中的路由重分发,还有一些末梢区域和非纯末梢区域的优化。

    一、OSPF重分发理论

    1.1 OSPF 6类LSA用途回顾

    在这里插入图片描述

    1.2 OSPF协议的区域简介
    • 骨干区域 (area 0)

      作为中央实体,其他区域与之相连,骨干区域编号为 0,在该区域中,各种类型的 LSA 均允许发布。

    • 标准区域

      除骨干区域外的默认的区域类型,在该类型区域中,各种类型的 LSA 均允许发布。

    • 末梢区域
      即 STUB 区域,该类型区域中不接受关于AS外部的路由信息,即不接受类型 5 的 AS 外部LSA,需要路由到自治系统外部的网络时,路由器使用默认路由(0.0.0.0),末梢区域中不能包含有自治系统边界路由器 ASBR。

    • 完全末梢区域

      该类型区域中不接受关于AS外部的路由信息,同时也不接受来自 AS 中其他区域的汇总路由,即不接受类型 3、类型 4、类型 5 的 LSA,完全末梢区域也不能包换有自治系统边界路由器 ASBR。

    • NSSA区域

      NSSA区域是stub(末梢区域)的升级版。它允许一些外部路由通告到OSPF自治系统内部,如果把该区域配置成NSSA区域,那么ASBR会产生NSSA外部lsa(type=7),然后泛洪到整个NSSA区域内,这些7类的lsa在NSSA的ABR上最后会转换成type=5的lsa进行泛洪到整个OSPF域中。

    • 完全NSSA区域

      和NSSA区域类似,完全NSSA区域允许一些外部路由通告到OSPF资质系统内部,而同时保留资质系统区域部分的完全stbu区域的特征。该去的ASBR会产生NSSA外部LSA(type=7),然后在区域内泛洪并通过该区域的ABR将7类lsa转换成5类lsa然后在其他所有区域进行泛洪。

      同时,该区域的ABR也会产生一条默认路由(0.0.0.0)传播到区域内,所有区域间的路由都必须通过ABR才能到达。

    二、OSPF重分发实验

    2.1 实验拓扑

    在这里插入图片描述

    2.2 路由器R1配置
    <Huawei>sys	
    [Huawei]sysname R1
    #配置物理接口和环回接口的IP地址
    [R1]int g0/0/0
    [R1-GigabitEthernet0/0/0]ip add 10.0.0.1 24
    [R1-GigabitEthernet0/0/0]undo shut
    [R1-GigabitEthernet0/0/0]q
    [R1]int LoopBack 0
    [R1-LoopBack0]ip add 1.1.1.1 24
    [R1-LoopBack0]q
    
    [R1]rip 1
    [R1-rip-1]undo summary 
    [R1-rip-1]version 2
    [R1-rip-1]network 1.0.0.0	
    [R1-rip-1]network 10.0.0.0
    [R1-rip-1]q
    [R1]
    2.3 路由器R2配置
    <Huawei>sys	
    [Huawei]sysname R2
    
    #配置物理接口和环回接口的IP地址
    [R2]int g0/0/0
    [R2-GigabitEthernet0/0/0]ip add 10.0.0.2 24
    [R2-GigabitEthernet0/0/0]undo shut
    [R2-GigabitEthernet0/0/0]q
    [R2]int g0/0/1
    [R2-GigabitEthernet0/0/1]ip add 11.0.0.1 24
    [R2-GigabitEthernet0/0/1]undo shut
    [R2-GigabitEthernet0/0/1]q
    [R2]int LoopBack 0
    [R2-LoopBack0]ip add 2.2.2.2 24
    [R2-LoopBack0]q
    [R2]rip 1
    
    #配置RIP区域
    #在RIP区域下重分发OSPF区域中的路由
    [R2-rip-1]import-route ospf 1	
    #关闭路由汇总
    [R2-rip-1]undo summary
    #选择RIP verson2
    [R2-rip-1]version 2
    #宣告网段
    [R2-rip-1]network 10.0.0.0
    [R2-rip-1]q
    
    #配置OSPF区域
    [R2]ospf 1 router-id 2.2.2.2
    #在OSPF区域中重分发RIP区域的路由
    [R2-ospf-1]import-route rip 1
    #宣告OSPF区域
    [R2-ospf-1]area 1
    #宣告网段
    [R2-ospf-1-area-0.0.0.1]network 2.2.2.0 0.0.0.255
    [R2-ospf-1-area-0.0.0.1]network 11.0.0.0 0.0.0.255
    [R2-ospf-1-area-0.0.0.1]q
    
    2.4 路由器R3配置
    <Huawei>sys
    [Huawei]sysname R3	
    
    #配置物理接口和环回接口的IP地址
    [R3]int g0/0/1
    [R3-GigabitEthernet0/0/1]ip add 11.0.0.2 24
    [R3-GigabitEthernet0/0/1]undo shut
    [R3-GigabitE2thernet0/0/1]q
    [R3]int g0/0/0
    [R3-GigabitEthernet0/0/0]ip add 12.0.0.1 24
    [R3-GigabitEthernet0/0/0]undo shut
    [R3-GigabitEthernet0/0/0]q
    [R3]int LoopBack 0
    [R3-LoopBack0]ip add 3.3.3.3 24
    [R3-LoopBack0]q
    
    #配置OSPF区域
    [R3]ospf 1 router-id 3.3.3.3
    [R3-ospf-1]area 1	
    [R3-ospf-1-area-0.0.0.1]network 3.3.3.0 0.0.0.255	
    [R3-ospf-1-area-0.0.0.1]network 11.0.0.0 0.0.0.255
    [R3-ospf-1-area-0.0.0.1]network 12.0.0.0 0.0.0.255
    2.5 路由R4配置
    <Huawei>sys
    [Huawei]sysname R4
    
    #配置物理接口和环回接口的IP地址
    [R4]int g0/0/0
    [R4-GigabitEthernet0/0/0]ip add 12.0.0.2 24
    [R4-GigabitEthernet0/0/0]undo shut
    [R4-GigabitEthernet0/0/0]q
    [R4]int g0/0/1
    [R4-GigabitEthernet0/0/1]ip add 13.0.0.1 24
    [R4-GigabitEthernet0/0/1]undo shut
    [R4-GigabitEthernet0/0/1]q
    [R4]int LoopBack 0
    [R4-LoopBack0]ip add 4.4.4.4 24
    [R4-LoopBack0]q
    
    #配置OSPF区域
    [R4]ospf 1 router-id 4.4.4.4
    #宣告区域1的直连网段
    [R4-ospf-1]area 1	
    [R4-ospf-1-area-0.0.0.1]network 12.0.0.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.1]network 4.4.4.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.1]q
    #宣告区域0的直连网段
    [R4-ospf-1]area 0
    [R4-ospf-1-area-0.0.0.0]network 13.0.0.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.0]q
    
    2.6 路由器R5配置
    <Huawei>sys	
    [Huawei]sysname R5
    
    #配置物理接口和环回接口的IP地址
    [R5]int g0/0/1
    [R5-GigabitEthernet0/0/1]ip add 13.0.0.2 24
    [R5-GigabitEthernet0/0/1]undo shutdown 
    [R5-GigabitEthernet0/0/1]q
    [R5]int g0/0/2
    [R5-GigabitEthernet0/0/2]ip add 14.0.0.1 24	
    [R5-GigabitEthernet0/0/2]undo shutdown 
    [R5-GigabitEthernet0/0/2]q
    [R5]int LoopBack 0
    [R5-LoopBack0]ip add 5.5.5.5 24
    [R5-LoopBack0]q
    	
    
    #配置OSPF区域
    [R5]ospf 1 router-id 5.5.5.5
    #宣告区域1的直连网段
    [R5-ospf-1]area 0	
    [R5-ospf-1-area-0.0.0.0]network 13.0.0.0 0.0.0.255
    [R5-ospf-1-area-0.0.0.0]q
    #宣告区域0的直连网段
    [R5-ospf-1]area 2
    [R5-ospf-1-area-0.0.0.2]network 14.0.0.0 0.0.0.255
    [R5-ospf-1-area-0.0.0.2]network 5.5.5.0 0.0.0.255
    
    2.7 路由器R6配置
    <Huawei>sys
    [Huawei]sysname R6
    [R6]int g0/0/2
    [R6-GigabitEthernet0/0/2]ip add 14.0.0.2 24
    [R6-GigabitEthernet0/0/2]undo shutdown 
    [R6-GigabitEthernet0/0/2]q
    [R6]int LoopBack 0
    [R6-LoopBack0]ip add 6.6.6.6 24
    [R6-LoopBack0]q
    	
    [R6]ospf 1 router-id 6.6.6.6
    [R6-ospf-1]area 2
    [R6-ospf-1-area-0.0.0.2]network 6.6.6.0 0.0.0.255
    [R6-ospf-1-area-0.0.0.2]network 14.0.0.0 0.0.0.255
    [R6-ospf-1-area-0.0.0.2]q
    
    2.8 验证配置
    • 查看R1路由表,同时在R1路由器上ping R6
    [R1]dis ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.0/24  Direct  0    0           D   1.1.1.1         LoopBack0
            1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
            2.2.2.0/24  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
            3.3.3.3/32  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
            4.4.4.4/32  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
            5.5.5.5/32  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
            6.6.6.6/32  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
           10.0.0.0/24  Direct  0    0           D   10.0.0.1        GigabitEthernet
    0/0/0
           10.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
    0/0/0
           11.0.0.0/24  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
           12.0.0.0/24  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
           13.0.0.0/24  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
           14.0.0.0/24  RIP     100  1           D   10.0.0.2        GigabitEthernet
    0/0/0
          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
    
    [R1]ping -a 1.1.1.1 6.6.6.6
      PING 6.6.6.6: 56  data bytes, press CTRL_C to break
        Reply from 6.6.6.6: bytes=56 Sequence=1 ttl=251 time=190 ms
        Reply from 6.6.6.6: bytes=56 Sequence=2 ttl=251 time=140 ms
        Reply from 6.6.6.6: bytes=56 Sequence=3 ttl=251 time=150 ms
        Reply from 6.6.6.6: bytes=56 Sequence=4 ttl=251 time=80 ms
        Reply from 6.6.6.6: bytes=56 Sequence=5 ttl=251 time=140 ms
    
      --- 6.6.6.6 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 80/140/190 ms

    三、优化OSPF协议下的路由

    3.1 修改OSPF重分发的RIP的cost值
    [R2]ospf 1 router-id 2.2.2.2
    [R2-ospf-1]import-route rip 1 cost 5 type 2
    • 查看R6路由表

      修改之后,OSPF重分发的路由,costt值改变为5,经过路由之后不再累加

    [R6]dis ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.0/24  O_ASE   150  5           D   14.0.0.1        GigabitEthernet
    0/0/2
            2.2.2.2/32  OSPF    10   4           D   14.0.0.1        GigabitEthernet
    0/0/2
            3.3.3.3/32  OSPF    10   3           D   14.0.0.1        GigabitEthernet
    0/0/2
            4.4.4.4/32  OSPF    10   2           D   14.0.0.1        GigabitEthernet
    0/0/2
            5.5.5.5/32  OSPF    10   1           D   14.0.0.1        GigabitEthernet
    0/0/2
            6.6.6.0/24  Direct  0    0           D   6.6.6.6         LoopBack0
            6.6.6.6/32  Direct  0    0           D   127.0.0.1       LoopBack0
           10.0.0.0/24  O_ASE   150  5           D   14.0.0.1        GigabitEthernet
    0/0/2
           11.0.0.0/24  OSPF    10   4           D   14.0.0.1        GigabitEthernet
    0/0/2
           12.0.0.0/24  OSPF    10   3           D   14.0.0.1        GigabitEthernet
    0/0/2
           13.0.0.0/24  OSPF    10   2           D   14.0.0.1        GigabitEthernet
    0/0/2
           14.0.0.0/24  Direct  0    0           D   14.0.0.2        GigabitEthernet
    0/0/2
           14.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
    0/0/2
          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
    • 查看R5的路由表

      可查看到10.0网段的cost值固定为5

    [R5]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 16       Routes : 16       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.0/24  O_ASE   150  5           D   13.0.0.1        GigabitEthernet
    0/0/1
            2.2.2.2/32  OSPF    10   3           D   13.0.0.1        GigabitEthernet
    0/0/1
            3.3.3.3/32  OSPF    10   2           D   13.0.0.1        GigabitEthernet
    0/0/1
            4.4.4.4/32  OSPF    10   1           D   13.0.0.1        GigabitEthernet
    0/0/1
            5.5.5.0/24  Direct  0    0           D   5.5.5.5         LoopBack0
            5.5.5.5/32  Direct  0    0           D   127.0.0.1       LoopBack0
            6.6.6.6/32  OSPF    10   1           D   14.0.0.2        GigabitEthernet
    0/0/2
           10.0.0.0/24  O_ASE   150  5           D   13.0.0.1        GigabitEthernet
    0/0/1
           11.0.0.0/24  OSPF    10   3           D   13.0.0.1        GigabitEthernet
    0/0/1
           12.0.0.0/24  OSPF    10   2           D   13.0.0.1        GigabitEthernet
    0/0/1
           13.0.0.0/24  Direct  0    0           D   13.0.0.2        GigabitEthernet
    0/0/1
           13.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
    0/0/1
           14.0.0.0/24  Direct  0    0           D   14.0.0.1        GigabitEthernet
    0/0/2
           14.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
    0/0/2
          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
    
    
    3.2 优化外部路由协议(NSSA)
    • 查看R6路由信息表

      其中协议信息中O_ASE部分为OSPF协议外部路由信息

    [R6]dis ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.0/24  O_ASE   150  5           D   14.0.0.1        GigabitEthernet
    0/0/2
            2.2.2.2/32  OSPF    10   4           D   14.0.0.1        GigabitEthernet
    0/0/2
            3.3.3.3/32  OSPF    10   3           D   14.0.0.1        GigabitEthernet
    0/0/2
            4.4.4.4/32  OSPF    10   2           D   14.0.0.1        GigabitEthernet
    0/0/2
            5.5.5.5/32  OSPF    10   1           D   14.0.0.1        GigabitEthernet
    0/0/2
            6.6.6.0/24  Direct  0    0           D   6.6.6.6         LoopBack0
            6.6.6.6/32  Direct  0    0           D   127.0.0.1       LoopBack0
           10.0.0.0/24  O_ASE   150  5           D   14.0.0.1        GigabitEthernet
    0/0/2
    .........省略部分内容
    • 优化R2、R3、R4路由 area1区域的路由信息

      nssa优化:设置nssa规则可以节省收敛时间

      因为nssa使用第7类LSA报文,只在NSSA(末梢区域中产生),用于向NSSA区域通告外部路由

    [R2]ospf 1 router-id 2.2.2.2
    [R2-ospf-1]area 1
    [R2-ospf-1-area-0.0.0.1]nssa
    
    [R3]ospf 1 router-id 3.3.3.3
    [R3-ospf-1]area 1
    [R3-ospf-1-area-0.0.0.1]nssa
    
    [R4]ospf 1 router-id 4.4.4.4
    [R4-ospf-1]area 1
    [R4-ospf-1-area-0.0.0.1]nssa
    • 查看R4的路由信息

      可见RIP区域路由信息变为NSSA类

    [R4]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 16       Routes : 16       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.0/24  O_NSSA  150  5           D   12.0.0.1        GigabitEthernet
    0/0/0
           10.0.0.0/24  O_NSSA  150  5           D   12.0.0.1        GigabitEthernet
    0/0/0
    ...................省略部分内容
    3.3 设置STUB区域
    3.3.1 修改R5、R6路由器area 2信息
    [R5]ospf 1 router-id 5.5.5.5
    [R5-ospf-1]area 2
    [R5-ospf-1-area-0.0.0.2]stub
    
    [R6]ospf 1 router-id 6.6.6.6
    [R6-ospf-1]area 2
    [R6-ospf-1-area-0.0.0.2]stub
    • 查看R2 R6路由信息表

    R2路由信息表

    路由信息表中,ASBR路由器上多了一条默认路由

    [R2]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 17       Routes : 17       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            0.0.0.0/0   O_NSSA  150  1           D   11.0.0.2        GigabitEthernet
    0/0/1
            1.1.1.0/24  RIP     100  1           D   10.0.0.1        GigabitEthernet
    0/0/0
    
    ........省略部分内容

    R6路由信息表

    路由信息表中,外部的路由信息变为了一条默认路由,节省了收敛时间

    [R6]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 14       Routes : 14       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            0.0.0.0/0   OSPF    10   2           D   14.0.0.1        GigabitEthernet
    0/0/2
            2.2.2.2/32  OSPF    10   4           D   14.0.0.1        GigabitEthernet
    0/0/2
            3.3.3.3/32  OSPF    10   3           D   14.0.0.1        GigabitEth
    ........省略部分内容

    总结:

    查看邻居关系表

    dis ospf peer brief 

    查看指定路由协议相关配置

    dis ip routing-table protocol (加指定协议,ospf、RIP、IS-IS等)
    展开全文
  • 二、 Ospf多区域,路由重分发ospf身份认证 三、 R2配置单臂路由 四、 开启所有路由器的Telnet远程 五、 桥接PC访问全网和远程路由器 实验过程 一、 R1、R2、R3、R4配置IP地址 [R1]int GigabitEthernet0/0/0 ...

    华为综合实验(2)

    作者:牛贺东
    实验拓扑图
    在这里插入图片描述

    实验步骤:

    一、 RIP配置为RIPv2,rip路由重分发,rip路由汇总

    二、 Ospf多区域,路由重分发,ospf身份认证

    三、 R2配置单臂路由

    四、 开启所有路由器的Telnet远程

    五、 桥接PC访问全网和远程路由器

    实验过程

    一、 R1、R2、R3、R4配置IP地址

    [R1]int GigabitEthernet0/0/0      
    
    [R1-GigabitEthernet0/0/0]ip address 192.168.1.1 255.255.255.0   
    
    [R1-GigabitEthernet0/0/0]undo shutdown 
    
    [R1]int LoopBack 1       
    
    [R1-LoopBack1]ip address 172.16.1.1 24
    
    [R1-LoopBack1]quit
    
    [R1]int loo2   
    
    [R1-LoopBack2]ip address 172.16.2.1 24
    
    [R1-LoopBack2]quit
    
    [R1]int loo3   
    
    [R1-LoopBack3]ip address 172.16.3.1 24
    
    [R1-LoopBack3]quit
    
    [R1]int loo 4  
    
    [R1-LoopBack4]ip address 172.16.4.1 24
    

    在这里插入图片描述

    [R2]int GigabitEthernet0/0/0      
    
    [R2-GigabitEthernet0/0/0]ip address 192.168.1.2 255.255.255.0
    
    [R2-GigabitEthernet0/0/0]undo shutdown 
    
    [R2]int GigabitEthernet0/0/1      
    
    [R2-GigabitEthernet0/0/1]ip address 192.168.2.1 255.255.255.0
    
    [R2-GigabitEthernet0/0/1]undo shutdown
    
    [R2]int loo 0  
    
    [R2-LoopBack0]ip address 1.1.1.1 32
    

    在这里插入图片描述
    [R3]int g0/0/0

    [R3-GigabitEthernet0/0/0]ip address 192.168.2.2 255.255.255.0   
    
    [R3-GigabitEthernet0/0/0]undo shutdown
    
    [R3]int GigabitEthernet0/0/1      
    
    [R3-GigabitEthernet0/0/1]ip address 192.168.3.1 255.255.255.0   
    
    [R3-GigabitEthernet0/0/1]undo shutdown 
    
    [R3]int loo0   
    
    [R3-LoopBack0]ip address 2.2.2.2 32
    
    [R3-LoopBack0]quit
    

    在这里插入图片描述

    [R4]int g0/0/0      
    
    [R4-GigabitEthernet0/0/0]ip address 192.168.3.2 255.255.255.0   
    
    [R4-GigabitEthernet0/0/0]undo shutdown 
    
    [R4]int g0/0/1      
    
    [R4-GigabitEthernet0/0/1]ip address 192.168.4.1 255.255.255.0   
    
    [R4-GigabitEthernet0/0/1]undo shutdown
    
    [R4]int loo0   
    
    [R4-LoopBack0]ip address 3.3.3.3 32
    

    在这里插入图片描述
    二、 交换机配置trunk,添加vlan,将接口加入vlan

    [LSW1]int GigabitEthernet 0/0/1 
    
    [LSW1-GigabitEthernet0/0/1]port link-type trunk   
    
    [LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
    

    添加vlan

    [LSW1]vlan 10
    
    [LSW1-vlan10]quit
    
    [LSW1]vlan 20
    
    [LSW1-vlan20]quit
    

    将接口加入vlan

    [LSW1]int Ethernet 0/0/1
    
    [LSW1-Ethernet0/0/1]port link-type access     
    
    [LSW1-Ethernet0/0/1]port default vlan 10
    
    [LSW1-Ethernet0/0/1]quit
    
    [LSW1]int e0/0/2
    
    [LSW1-Ethernet0/0/2]port link-type access     
    
    [LSW1-Ethernet0/0/2]port default vlan 20
    
    [LSW1-Ethernet0/0/2]quit
    

    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    三、 路由器R2配置单臂路由

    [R2]int g0/0/2.10  
    
    [R2-GigabitEthernet0/0/2.10]ip address 192.168.10.254 255.255.255.0
    
    [R2-GigabitEthernet0/0/2.10]dot1q termination vid 10  
    
    [R2-GigabitEthernet0/0/2.10]arp broadcast enable       
    
    [R2-GigabitEthernet0/0/2.10]int g0/0/2.20
    
    [R2-GigabitEthernet0/0/2.20]ip address 192.168.20.254 255.255.255.0
    
    [R2-GigabitEthernet0/0/2.20]dot1q termination vid 20
    
    [R2-GigabitEthernet0/0/2.20]arp broadcast enable
    

    在这里插入图片描述
    在这里插入图片描述
    四、路由器R1、R2配置RIPv2,并宣告直连网络

    [R1]rip 1 
    
    [R1-rip-1]version 2
    
    [R1-rip-1]network 172.16.0.0
    
    [R1-rip-1]network 192.168.1.0
    
    [R2]rip 1
    
    [R2-rip-1]version 2
    
    [R2-rip-1]network 192.168.1.0
    
    [R2-rip-1]network 192.168.10.0
    
    [R2-rip-1]network 192.168.20.0
    

    RIP配置路由汇总

    [R1]int g0/0/0
    
    [R1-GigabitEthernet0/0/0]rip summary-address 172.16.0.0 255.255.0.0
    

    在这里插入图片描述

    五、 ospf多区域,ospf身份认证,

    [R2]ospf router-id 1.1.1.1
    
    [R2-ospf-1]area 0
    
    [R2-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
    
    [R2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
    
    [R2-ospf-1-area-0.0.0.0]authentication-mode simple pwd@123
    
    [R3]ospf router-id 2.2.2.2
    
    [R3-ospf-1]area 0 
    
    [R3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
    
    [R3-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
    
    [R3-ospf-1-area-0.0.0.0]authentication-mode simple pwd@123
    
    [R3-ospf-1]area 1
    
    [R3-ospf-1-area-0.0.0.1]network 192.168.3.0 0.0.0.255
    
    [R3-ospf-1-area-0.0.0.1]authentication-mode simple pwd@123
    
    [R4]ospf router-id 3.3.3.3
    
    [R4-ospf-1]area 1
    
    [R4-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
    
    [R4-ospf-1-area-0.0.0.1]network 192.168.3.0 0.0.0.255
    
    [R4-ospf-1-area-0.0.0.1]network 192.168.4.0 0.0.0.255
    
     [R4-ospf-1-area-0.0.0.1]authentication-mode simple pwd@123
    

    在路由器R2配置路由重分发,RIP重发到OSPF,OSPF重分发到RIP

    [R2]rip 1
    
    [R2-rip-1]import-route ospf
    
    [R2-rip-1]quit
    
    [R2]ospf 
    
    [R2-ospf-1]import-route rip
    

    六、 所有路由器开启Telnet远程

    [R1]user-interface vty 0 4
    
    [R1-ui-vty0-4]authentication-mode password   
    
    [R1-ui-vty0-4]set authentication password simple pwd@123 
    
    [R1-ui-vty0-4]user privilege level 15
    
    [R2]user-interface vty 0 4
    
    [R2-ui-vty4]authentication-mode password      
    
    [R2-ui-vty4]set authentication password simple pwd@123
    
    [R2-ui-vty4]user privilege level 15
    
    [R3]user-interface vty 0 4
    
    [R3-ui-vty0-4]authentication-mode password   
    
    [R3-ui-vty0-4]set authentication password simple pwd@123 
    
    [R3-ui-vty0-4]user privilege level 15
    
    [R4]user-interface vty 0 4
    
    [R4-ui-vty0-4]authentication-mode password   
    
    [R4-ui-vty0-4]set authentication password simple pwd@123 
    
    [R4-ui-vty0-4]user privilege level 15
    

    桥接PC机,并配置IP地址
    在这里插入图片描述
    在这里插入图片描述

    给PC机配置IP地址

    在这里插入图片描述
    在这里插入图片描述
    验证全网互通
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    Telnet管理路由器
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    展开全文
  • 实验: 末梢区域优化的是asbr的外部协议信息,使其变成默认路由 完全末梢:配置在asbr,使该区域外的所有路由都变成默认路由 area1是nssa区域,使协议外的路由信息变成...Huawei>system-view Enter system view...

    在这里插入图片描述

    在这里插入图片描述

    实验:

    在这里插入图片描述

    末梢区域优化的是asbr的外部协议信息,使其变成默认路由

    完全末梢:配置在asbr,使该区域外的所有路由都变成默认路由

    area1是nssa区域,使协议外的路由信息变成了nssa,还增加了一条默认路由

    1.配置接口IP地址,宣告自身所在区域

    • R1
    The device is running!
    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]sysname R1
    [R1]int loo 0
    [R1-LoopBack0]ip add 1.1.1.1 32
    [R1-LoopBack0]int g 0/0/0
    [R1-GigabitEthernet0/0/0]ip add  16.0.0.1 24
    [R1-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R1-GigabitEthernet0/0/0]int g 0/0/1
    [R1-GigabitEthernet0/0/1]ip add 12.0.0.1 24
    [R1-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [R1-GigabitEthernet0/0/1]q
    [R1]ospf 1 router-id 1.1.1.1
    [R1-ospf-1]area 1
    [R1-ospf-1-area-0.0.0.1]network 12.0.0.0 0.0.0.255	
    [R1-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
    [R1-ospf-1-area-0.0.0.1]q
    [R1-ospf-1]q
    [R1]rip 1
    [R1-rip-1]version 2	
    [R1-rip-1]undo summary 
    [R1-rip-1]network 16.0.0.0
    [R1-rip-1]q
    
    • R2
    The device is running!
    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]sysname R2
    [R2]int loo 0
    [R2-LoopBack0]ip add 2.2.2.2 32
    [R2-LoopBack0]int g 0/0/1
    [R2-GigabitEthernet0/0/1]ip add 12.0.0.2 24
    [R2-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [R2-GigabitEthernet0/0/1]int g 0/0/2
    [R2-GigabitEthernet0/0/2]ip add 23.0.0.2 24
    [R2-GigabitEthernet0/0/2]un sh
    Info: Interface GigabitEthernet0/0/2 is not shutdown.
    [R2-GigabitEthernet0/0/2]q
    [R2]ospf 1 router-id 2.2.2.2
    [R2-ospf-1]area 1
    [R2-ospf-1-area-0.0.0.1]network 12.0.0.0 0.0.0.255
    [R2-ospf-1-area-0.0.0.1]network 23.0.0.0 0.0.0.255
    [R2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
    [R2-ospf-1-area-0.0.0.1]
    
    • R3
    The device is running!
    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]sysname R3
    [R3]int loo 0
    [R3-LoopBack0]ip add 3.3.3.3 32
    [R3-LoopBack0]int g 0/0/2
    [R3-GigabitEthernet0/0/2]ip add 23.0.0.3 24
    [R3-GigabitEthernet0/0/2]un sh
    Info: Interface GigabitEthernet0/0/2 is not shutdown.
    [R3-GigabitEthernet0/0/2]int g 0/0/3
    [R3-GigabitEthernet0/0/3]ip add 34.0.0.3 24
    [R3-GigabitEthernet0/0/3]un sh
    Info: Interface GigabitEthernet0/0/3 is not shutdown.
    [R3-GigabitEthernet0/0/3]q
    [R3]ospf 1 router-id 3.3.3.3
    [R3-ospf-1]area 1
    [R3-ospf-1-area-0.0.0.1]network 23.0.0.0 0.0.0.255
    [R3-ospf-1-area-0.0.0.1]q
    [R3-ospf-1]area 0
    [R3-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
    [R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
    [R3-ospf-1-area-0.0.0.0]q
    
    • R4
    The device is running!
    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]sysname R4
    [R4]int loo 0
    [R4-LoopBack0]ip add 4.4.4.4 32
    [R4-LoopBack0]int g 0/0/3
    [R4-GigabitEthernet0/0/3]ip add 34.0.0.4 24
    [R4-GigabitEthernet0/0/3]un sh
    Info: Interface GigabitEthernet0/0/3 is not shutdown.
    [R4-GigabitEthernet0/0/3]int g 0/0/0
    [R4-GigabitEthernet0/0/0]ip add 45.0.0.4 24
    [R4-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R4-GigabitEthernet0/0/0]q
    [R4]ospf 1 router-id 4.4.4.4
    [R4-ospf-1]area 0
    [R4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
    [R4-ospf-1-area-0.0.0.0]q
    [R4-ospf-1]area 2
    [R4-ospf-1-area-0.0.0.2]network 45.0.0.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.2]
    
    • R5
    The device is running!
    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]sysname R5
    [R5]int loo 0
    [R5-LoopBack0]ip add 5.5.5.5 32
    [R5-LoopBack0]int g 0/0/0
    [R5-GigabitEthernet0/0/0]ip add 45.0.0.5 24
    [R5-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R5-GigabitEthernet0/0/0]q
    [R5]ospf 1 router-id 5.5.5.5
    [R5-ospf-1]area 2
    [R5-ospf-1-area-0.0.0.2]network 45.0.0.0 0.0.0.255
    [R5-ospf-1-area-0.0.0.2]network 5.5.5.5 0.0.0.0
    [R5-ospf-1-area-0.0.0.2]
    
    • R6
    The device is running!
    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]sysname R6
    [R6]int loo 0
    [R6-LoopBack0]ip add 6.6.6.6 32
    [R6-LoopBack0]int g 0/0/0
    [R6-GigabitEthernet0/0/0]ip add 16.0.0.6 24
    [R6-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R6-GigabitEthernet0/0/0]q
    [R6]rip 1	
    [R6-rip-1]version 2
    [R6-rip-1]network 16.0.0.0
    [R6-rip-1]network 6.0.0.0	
    [R6-rip-1]undo summary 
    [R6-rip-1]
    

    2. 此时查看路由表

    • R1
    [R1]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
            2.2.2.2/32  OSPF    10   1           D   12.0.0.2        GigabitEthernet0/0/1
            3.3.3.3/32  OSPF    10   2           D   12.0.0.2        GigabitEthernet0/0/1
            4.4.4.4/32  OSPF    10   3           D   12.0.0.2        GigabitEthernet0/0/1
            5.5.5.5/32  OSPF    10   4           D   12.0.0.2        GigabitEthernet0/0/1
            6.6.6.6/32  RIP     100  1           D   16.0.0.6        GigabitEthernet0/0/0
           12.0.0.0/24  Direct  0    0           D   12.0.0.1        GigabitEthernet0/0/1
           12.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
           16.0.0.0/24  Direct  0    0           D   16.0.0.1        GigabitEthernet0/0/0
           16.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
           23.0.0.0/24  OSPF    10   2           D   12.0.0.2        GigabitEthernet0/0/1
           34.0.0.0/24  OSPF    10   3           D   12.0.0.2        GigabitEthernet0/0/1
           45.0.0.0/24  OSPF    10   4           D   12.0.0.2        GigabitEthernet0/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
    
    [R1]
    
    • R2
    [R2]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 13       Routes : 13       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   1           D   12.0.0.1        GigabitEthernet0/0/1
            2.2.2.2/32  Direct  0    0           D   127.0.0.1       LoopBack0
            3.3.3.3/32  OSPF    10   1           D   23.0.0.3        GigabitEthernet0/0/2
            4.4.4.4/32  OSPF    10   2           D   23.0.0.3        GigabitEthernet0/0/2
            5.5.5.5/32  OSPF    10   3           D   23.0.0.3        GigabitEthernet0/0/2
           12.0.0.0/24  Direct  0    0           D   12.0.0.2        GigabitEthernet0/0/1
           12.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
           23.0.0.0/24  Direct  0    0           D   23.0.0.2        GigabitEthernet0/0/2
           23.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
           34.0.0.0/24  OSPF    10   2           D   23.0.0.3        GigabitEthernet0/0/2
           45.0.0.0/24  OSPF    10   3           D   23.0.0.3        GigabitEthernet0/0/2
          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
    
    [R2]
    
    • R3
    [R3]dis ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 13       Routes : 13       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   2           D   23.0.0.2        GigabitEthernet0/0/2
            2.2.2.2/32  OSPF    10   1           D   23.0.0.2        GigabitEthernet0/0/2
            3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
            4.4.4.4/32  OSPF    10   1           D   34.0.0.4        GigabitEthernet0/0/3
            5.5.5.5/32  OSPF    10   2           D   34.0.0.4        GigabitEthernet0/0/3
           12.0.0.0/24  OSPF    10   2           D   23.0.0.2        GigabitEthernet0/0/2
           23.0.0.0/24  Direct  0    0           D   23.0.0.3        GigabitEthernet0/0/2
           23.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
           34.0.0.0/24  Direct  0    0           D   34.0.0.3        GigabitEthernet0/0/3
           34.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  OSPF    10   2           D   34.0.0.4        GigabitEthernet0/0/3
          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
    
    [R3]
    
    • R4
    [R4]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 13       Routes : 13       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
            2.2.2.2/32  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
            3.3.3.3/32  OSPF    10   1           D   34.0.0.3        GigabitEthernet0/0/3
            4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
            5.5.5.5/32  OSPF    10   1           D   45.0.0.5        GigabitEthernet0/0/0
           12.0.0.0/24  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
           23.0.0.0/24  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
           34.0.0.0/24  Direct  0    0           D   34.0.0.4        GigabitEthernet0/0/3
           34.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  Direct  0    0           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R4]
    
    • R5
    [R5]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 12       Routes : 12       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   4           D   45.0.0.4        GigabitEthernet0/0/0
            2.2.2.2/32  OSPF    10   3           D   45.0.0.4        GigabitEthernet0/0/0
            3.3.3.3/32  OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
            4.4.4.4/32  OSPF    10   1           D   45.0.0.4        GigabitEthernet0/0/0
            5.5.5.5/32  Direct  0    0           D   127.0.0.1       LoopBack0
           12.0.0.0/24  OSPF    10   4           D   45.0.0.4        GigabitEthernet0/0/0
           23.0.0.0/24  OSPF    10   3           D   45.0.0.4        GigabitEthernet0/0/0
           34.0.0.0/24  OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.0/24  Direct  0    0           D   45.0.0.5        GigabitEthernet0/0/0
           45.0.0.5/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R5]
    
    • R6
    [R6]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 5        Routes : 5        
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            6.6.6.6/32  Direct  0    0           D   127.0.0.1       LoopBack0
           16.0.0.0/24  Direct  0    0           D   16.0.0.6        GigabitEthernet0/0/0
           16.0.0.6/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R6]
    

    3. ospf与rip协议之间重分发

    • ASBR R1
    [R1]ospf 1	
    [R1-ospf-1]import-route ?
      bgp     Border Gateway Protocol (BGP) routes
      direct  Connected routes
      isis    Intermediate System to Intermediate System (IS-IS) routes
      limit   Limit the number of routes imported into OSPF
      ospf    Open Shortest Path First (OSPF) routes
      rip     Routing Information Protocol (RIP) routes
      static  Static routes
      unr     User Network Routes
    [R1-ospf-1]import-route rip ?
      INTEGER<1-65535>  Process ID
      cost              Set cost
      route-policy      Route policy
      tag               Specify route tag
      type              Metric type of the imported external routes
      <cr>              
    	
    [R1-ospf-1]import-route rip type ?
      INTEGER<1-2>  Type value
    
    [R1-ospf-1]import-route rip type 1 ?
      cost          Set cost
      route-policy  Route policy
      tag           Specify route tag
      <cr>          
    	
    [R1-ospf-1]import-route rip type 1 cost 5
    [R1-ospf-1]q
    [R1]rip 1
    [R1-rip-1]import-route ?
      bgp     Border Gateway Protocol (BGP) routes
      direct  Direct routes
      isis    Intermediate System to Intermediate System (ISIS) routes
      ospf    Open Shortest Path First (OSPF) routes
      rip     Routing Information Protocol (RIP) routes
      static  Static routes
      unr     Unr routes
    [R1-rip-1]import-route ospf ?
      INTEGER<1-65535>  Process ID
      cost              Cost of the import route
      route-policy      Apply the specified route policy to filter route
      <cr>              
    
    [R1-rip-1]import-route ospf 1 ?
      cost          Cost of the import route
      route-policy  Apply the specified route policy to filter route
      <cr>          
    [R1-rip-1]import-route ospf 1 cost ?
      INTEGER<0-15>  Specify the metric value
    
    [R1-rip-1]import-route ospf 1 cost 6
    

    4. 此时再次查看路由表

    • R1
    [R1]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
            2.2.2.2/32  OSPF    10   1           D   12.0.0.2        GigabitEthernet0/0/1
            3.3.3.3/32  OSPF    10   2           D   12.0.0.2        GigabitEthernet0/0/1
            4.4.4.4/32  OSPF    10   3           D   12.0.0.2        GigabitEthernet0/0/1
            5.5.5.5/32  OSPF    10   4           D   12.0.0.2        GigabitEthernet0/0/1
            6.6.6.6/32  RIP     100  1           D   16.0.0.6        GigabitEthernet0/0/0
           12.0.0.0/24  Direct  0    0           D   12.0.0.1        GigabitEthernet0/0/1
           12.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
           16.0.0.0/24  Direct  0    0           D   16.0.0.1        GigabitEthernet0/0/0
           16.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
           23.0.0.0/24  OSPF    10   2           D   12.0.0.2        GigabitEthernet0/0/1
           34.0.0.0/24  OSPF    10   3           D   12.0.0.2        GigabitEthernet0/0/1
           45.0.0.0/24  OSPF    10   4           D   12.0.0.2        GigabitEthernet0/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
    
    [R1]
    
    • R2
    [R2]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   1           D   12.0.0.1        GigabitEthernet0/0/1
            2.2.2.2/32  Direct  0    0           D   127.0.0.1       LoopBack0
            3.3.3.3/32  OSPF    10   1           D   23.0.0.3        GigabitEthernet0/0/2
            4.4.4.4/32  OSPF    10   2           D   23.0.0.3        GigabitEthernet0/0/2
            5.5.5.5/32  OSPF    10   3           D   23.0.0.3        GigabitEthernet0/0/2
            6.6.6.6/32  O_ASE   150  6           D   12.0.0.1        GigabitEthernet0/0/1
           12.0.0.0/24  Direct  0    0           D   12.0.0.2        GigabitEthernet0/0/1
           12.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
           16.0.0.0/24  O_ASE   150  6           D   12.0.0.1        GigabitEthernet0/0/1
           23.0.0.0/24  Direct  0    0           D   23.0.0.2        GigabitEthernet0/0/2
           23.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
           34.0.0.0/24  OSPF    10   2           D   23.0.0.3        GigabitEthernet0/0/2
           45.0.0.0/24  OSPF    10   3           D   23.0.0.3        GigabitEthernet0/0/2
          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
    
    [R2]
    
    • R3
    [R3]dis ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   2           D   23.0.0.2        GigabitEthernet0/0/2
            2.2.2.2/32  OSPF    10   1           D   23.0.0.2        GigabitEthernet0/0/2
            3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
            4.4.4.4/32  OSPF    10   1           D   34.0.0.4        GigabitEthernet0/0/3
            5.5.5.5/32  OSPF    10   2           D   34.0.0.4        GigabitEthernet0/0/3
            6.6.6.6/32  O_ASE   150  7           D   23.0.0.2        GigabitEthernet0/0/2
           12.0.0.0/24  OSPF    10   2           D   23.0.0.2        GigabitEthernet0/0/2
           16.0.0.0/24  O_ASE   150  7           D   23.0.0.2        GigabitEthernet0/0/2
           23.0.0.0/24  Direct  0    0           D   23.0.0.3        GigabitEthernet0/0/2
           23.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
           34.0.0.0/24  Direct  0    0           D   34.0.0.3        GigabitEthernet0/0/3
           34.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  OSPF    10   2           D   34.0.0.4        GigabitEthernet0/0/3
          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
    
    [R3]
    
    • R4
    [R4]dis ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
            2.2.2.2/32  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
            3.3.3.3/32  OSPF    10   1           D   34.0.0.3        GigabitEthernet0/0/3
            4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
            5.5.5.5/32  OSPF    10   1           D   45.0.0.5        GigabitEthernet0/0/0
            6.6.6.6/32  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           12.0.0.0/24  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
           16.0.0.0/24  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           23.0.0.0/24  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
           34.0.0.0/24  Direct  0    0           D   34.0.0.4        GigabitEthernet0/0/3
           34.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  Direct  0    0           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R4]
    
    • R5
    [R5]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 14       Routes : 14       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   4           D   45.0.0.4        GigabitEthernet0/0/0
            2.2.2.2/32  OSPF    10   3           D   45.0.0.4        GigabitEthernet0/0/0
            3.3.3.3/32  OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
            4.4.4.4/32  OSPF    10   1           D   45.0.0.4        GigabitEthernet0/0/0
            5.5.5.5/32  Direct  0    0           D   127.0.0.1       LoopBack0
            6.6.6.6/32  O_ASE   150  9           D   45.0.0.4        GigabitEthernet0/0/0
           12.0.0.0/24  OSPF    10   4           D   45.0.0.4        GigabitEthernet0/0/0
           16.0.0.0/24  O_ASE   150  9           D   45.0.0.4        GigabitEthernet0/0/0
           23.0.0.0/24  OSPF    10   3           D   45.0.0.4        GigabitEthernet0/0/0
           34.0.0.0/24  OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.0/24  Direct  0    0           D   45.0.0.5        GigabitEthernet0/0/0
           45.0.0.5/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R5]
    
    • R6
    [R6]display ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 14       Routes : 14       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            2.2.2.2/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            3.3.3.3/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            4.4.4.4/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            5.5.5.5/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            6.6.6.6/32  Direct  0    0           D   127.0.0.1       LoopBack0
           12.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           16.0.0.0/24  Direct  0    0           D   16.0.0.6        GigabitEthernet0/0/0
           16.0.0.6/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
           23.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           34.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           45.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
          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
    
    [R6]
    

    5. 优化区域

    • 末梢区域

      stub ###末梢 2变都要加

    [R4]ospf 1 router-id 4.4.4.4
    [R4-ospf-1]area 2	
    [R4-ospf-1-area-0.0.0.2]stub ?
      no-summary  Do not send summary LSA into stub area
      <cr>        
    [R4-ospf-1-area-0.0.0.2]stub 
    
    [R5]ospf 1 rou	
    [R5]ospf 1 router-id 5.5.5.5
    [R5-ospf-1]area 2
    [R5-ospf-1-area-0.0.0.2]stub
    
    [R4]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
            2.2.2.2/32  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
            3.3.3.3/32  OSPF    10   1           D   34.0.0.3        GigabitEthernet0/0/3
            4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
            5.5.5.5/32  OSPF    10   1           D   45.0.0.5        GigabitEthernet0/0/0
            6.6.6.6/32  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           12.0.0.0/24  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
           16.0.0.0/24  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           23.0.0.0/24  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
           34.0.0.0/24  Direct  0    0           D   34.0.0.4        GigabitEthernet0/0/3
           34.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  Direct  0    0           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    
    
    [R5]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 13       Routes : 13       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            0.0.0.0/0   OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
            1.1.1.1/32  OSPF    10   4           D   45.0.0.4        GigabitEthernet0/0/0
            2.2.2.2/32  OSPF    10   3           D   45.0.0.4        GigabitEthernet0/0/0
            3.3.3.3/32  OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
            4.4.4.4/32  OSPF    10   1           D   45.0.0.4        GigabitEthernet0/0/0
            5.5.5.5/32  Direct  0    0           D   127.0.0.1       LoopBack0
           12.0.0.0/24  OSPF    10   4           D   45.0.0.4        GigabitEthernet0/0/0
           23.0.0.0/24  OSPF    10   3           D   45.0.0.4        GigabitEthernet0/0/0
           34.0.0.0/24  OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.0/24  Direct  0    0           D   45.0.0.5        GigabitEthernet0/0/0
           45.0.0.5/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    [R5]
    
    • 完全末梢

      在abr上 加入 stub no-summary

    [R4]ospf 1 router-id 4.4.4.4
    [R4-ospf-1]ar	
    [R4-ospf-1]area 2
    [R4-ospf-1-area-0.0.0.2]dis this
    #
     area 0.0.0.2
      network 45.0.0.0 0.0.0.255
      stub
    #
    return
    [R4-ospf-1-area-0.0.0.2]stub ?
      no-summary  Do not send summary LSA into stub area
      <cr>        
    
    [R4-ospf-1-area-0.0.0.2]stub no	
    [R4-ospf-1-area-0.0.0.2]stub no-summary 
    [R4-ospf-1-area-0.0.0.2]dis this
    #
     area 0.0.0.2
      network 45.0.0.0 0.0.0.255
      stub no-summary
    #
    return
    [R4-ospf-1-area-0.0.0.2]
    
    [R5]ospf 1 router-id 5.5.5.5
    [R5-ospf-1]area 2
    [R5-ospf-1-area-0.0.0.2]dis this
    #
     area 0.0.0.2
      network 45.0.0.0 0.0.0.255
      network 5.5.5.5 0.0.0.0
      stub
    #
    return
    [R5-ospf-1-area-0.0.0.2]stub no	
    [R5-ospf-1-area-0.0.0.2]stub no-summary 
    [R5-ospf-1-area-0.0.0.2]
    
    [R4]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
            2.2.2.2/32  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
            3.3.3.3/32  OSPF    10   1           D   34.0.0.3        GigabitEthernet0/0/3
            4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
            5.5.5.5/32  OSPF    10   1           D   45.0.0.5        GigabitEthernet0/0/0
            6.6.6.6/32  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           12.0.0.0/24  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
           16.0.0.0/24  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           23.0.0.0/24  OSPF    10   2           D   34.0.0.3        GigabitEtherne0/0/3
           34.0.0.0/24  Direct  0    0           D   34.0.0.4        GigabitEthernet0/0/3
           34.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  Direct  0    0           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R4]
    
    [R5]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 6        Routes : 6        
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            0.0.0.0/0   OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
            5.5.5.5/32  Direct  0    0           D   127.0.0.1       LoopBack0
           45.0.0.0/24  Direct  0    0           D   45.0.0.5        GigabitEthernet0/0/0
           45.0.0.5/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R5]
    
    • nssa区域

      ###ASBR主要是靠5类的LSA来通告链路状态信息,可以用7类LSA优化,通告外部路由信息

    [R1]ospf 1 rou	
    [R1]ospf 1 router-id 1.1.1.1
    [R1-ospf-1]are	
    [R1-ospf-1]area 1
    [R1-ospf-1-area-0.0.0.1]dis this
    #
     area 0.0.0.1
      network 12.0.0.0 0.0.0.255
      network 1.1.1.1 0.0.0.0
    #
    return
    [R1-ospf-1-area-0.0.0.1]nssa	
    [R1-ospf-1-area-0.0.0.1]nssa ?
      default-route-advertise      Originate Type 7 default into NSSA area
      flush-waiting-timer          Flush waiting timer
      no-import-route              No redistribution into this NSSA area
      no-summary                   Do not send summary LSA into NSSA
      set-n-bit                    Set n bit in DD packet in NSSA area
      suppress-forwarding-address  Suppress forwarding address for Translated
                                   Type-5 LSAs
      translator-always            Set NSSA translator role always
      translator-interval          Configure NSSA translator interval value
      zero-address-forwarding      Allow zero forwarding address for Type-7 LSAs
      <cr>                         
    
    [R1-ospf-1-area-0.0.0.1]nssa 
    [R1-ospf-1-area-0.0.0.1]
    
    <R2>SYS	
    <R2>system-view 
    Enter system view, return user view with Ctrl+Z.
    [R2]OSPF 1 ROU	
    [R2]OSPF 1 router-id 2.2.2.2
    [R2-ospf-1]area	
    [R2-ospf-1]area 1
    [R2-ospf-1-area-0.0.0.1]nssa
    [R2-ospf-1-area-0.0.0.1]dis this
    #
     area 0.0.0.1
      network 12.0.0.0 0.0.0.255
      network 23.0.0.0 0.0.0.255
      network 2.2.2.2 0.0.0.0
      nssa
    #
    return
    [R2-ospf-1-area-0.0.0.1]
    
    <R3>system-view 
    Enter system view, return user view with Ctrl+Z.
    [R3]ospf 1 rou	
    [R3]ospf 1 router-id 3.3.3.3
    [R3-ospf-1]nssa	
    [R3-ospf-1]nssa
               ^
    Error: Unrecognized command found at '^' position.
    [R3-ospf-1]area	
    [R3-ospf-1]area 1
    [R3-ospf-1-area-0.0.0.1]nssa	
    [R3-ospf-1-area-0.0.0.1]nssa 
    [R3-ospf-1-area-0.0.0.1]dis this
    #
     area 0.0.0.1
      network 23.0.0.0 0.0.0.255
      nssa
    #
    return
    [R3-ospf-1-area-0.0.0.1]
    

    此时查看新的路由表

    [R1]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 16       Routes : 16       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            0.0.0.0/0   O_NSSA  150  1           D   12.0.0.2        GigabitEthernet0/0/1
            1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
            2.2.2.2/32  OSPF    10   1           D   12.0.0.2        GigabitEthernet0/0/1
            3.3.3.3/32  OSPF    10   2           D   12.0.0.2        GigabitEthernet0/0/1
            4.4.4.4/32  OSPF    10   3           D   12.0.0.2        GigabitEthernet0/0/1
            5.5.5.5/32  OSPF    10   4           D   12.0.0.2        GigabitEthernet0/0/1
            6.6.6.6/32  RIP     100  1           D   16.0.0.6        GigabitEthernet0/0/0
           12.0.0.0/24  Direct  0    0           D   12.0.0.1        GigabitEthernet0/0/1
           12.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
           16.0.0.0/24  Direct  0    0           D   16.0.0.1        GigabitEthernet0/0/0
           16.0.0.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
           23.0.0.0/24  OSPF    10   2           D   12.0.0.2        GigabitEthernet0/0/1
           34.0.0.0/24  OSPF    10   3           D   12.0.0.2        GigabitEthernet0/0/1
           45.0.0.0/24  OSPF    10   4           D   12.0.0.2        GigabitEthernet0/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
    
    [R1]
    
    [R2]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 16       Routes : 16       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            0.0.0.0/0   O_NSSA  150  1           D   23.0.0.3        GigabitEthernet0/0/2
            1.1.1.1/32  OSPF    10   1           D   12.0.0.1        GigabitEthernet0/0/1
            2.2.2.2/32  Direct  0    0           D   127.0.0.1       LoopBack0
            3.3.3.3/32  OSPF    10   1           D   23.0.0.3        GigabitEthernet0/0/2
            4.4.4.4/32  OSPF    10   2           D   23.0.0.3        GigabitEthernet0/0/2
            5.5.5.5/32  OSPF    10   3           D   23.0.0.3        GigabitEthernet0/0/2
            6.6.6.6/32  O_NSSA  150  6           D   12.0.0.1        GigabitEthernet0/0/1
           12.0.0.0/24  Direct  0    0           D   12.0.0.2        GigabitEthernet0/0/1
           12.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
           16.0.0.0/24  O_NSSA  150  6           D   12.0.0.1        GigabitEthernet0/0/1
           23.0.0.0/24  Direct  0    0           D   23.0.0.2        GigabitEthernet0/0/2
           23.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
           34.0.0.0/24  OSPF    10   2           D   23.0.0.3        GigabitEthernet0/0/2
           45.0.0.0/24  OSPF    10   3           D   23.0.0.3        GigabitEthernet0/0/2
          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
    
    [R2]
    
    [R3]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   2           D   23.0.0.2        GigabitEthernet0/0/2
            2.2.2.2/32  OSPF    10   1           D   23.0.0.2        GigabitEthernet0/0/2
            3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
            4.4.4.4/32  OSPF    10   1           D   34.0.0.4        GigabitEthernet0/0/3
            5.5.5.5/32  OSPF    10   2           D   34.0.0.4        GigabitEthernet0/0/3
            6.6.6.6/32  O_NSSA  150  7           D   23.0.0.2        GigabitEthernet0/0/2
           12.0.0.0/24  OSPF    10   2           D   23.0.0.2        GigabitEthernet0/0/2
           16.0.0.0/24  O_NSSA  150  7           D   23.0.0.2        GigabitEthernet0/0/2
           23.0.0.0/24  Direct  0    0           D   23.0.0.3        GigabitEthernet0/0/2
           23.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/2
           34.0.0.0/24  Direct  0    0           D   34.0.0.3        GigabitEthernet0/0/3
           34.0.0.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  OSPF    10   2           D   34.0.0.4        GigabitEthernet0/0/3
          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
    
    [R3]
    
    [R4]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 15       Routes : 15       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
            2.2.2.2/32  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
            3.3.3.3/32  OSPF    10   1           D   34.0.0.3        GigabitEthernet0/0/3
            4.4.4.4/32  Direct  0    0           D   127.0.0.1       LoopBack0
            5.5.5.5/32  OSPF    10   1           D   45.0.0.5        GigabitEthernet0/0/0
            6.6.6.6/32  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           12.0.0.0/24  OSPF    10   3           D   34.0.0.3        GigabitEthernet0/0/3
           16.0.0.0/24  O_ASE   150  8           D   34.0.0.3        GigabitEthernet0/0/3
           23.0.0.0/24  OSPF    10   2           D   34.0.0.3        GigabitEthernet0/0/3
           34.0.0.0/24  Direct  0    0           D   34.0.0.4        GigabitEthernet0/0/3
           34.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/3
           45.0.0.0/24  Direct  0    0           D   45.0.0.4        GigabitEthernet0/0/0
           45.0.0.4/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R4]
    
    [R5]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 6        Routes : 6        
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            0.0.0.0/0   OSPF    10   2           D   45.0.0.4        GigabitEthernet0/0/0
            5.5.5.5/32  Direct  0    0           D   127.0.0.1       LoopBack0
           45.0.0.0/24  Direct  0    0           D   45.0.0.5        GigabitEthernet0/0/0
           45.0.0.5/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
          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
    
    [R5]
    
    [R6]dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 14       Routes : 14       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
            1.1.1.1/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            2.2.2.2/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            3.3.3.3/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            4.4.4.4/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            5.5.5.5/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            6.6.6.6/32  Direct  0    0           D   127.0.0.1       LoopBack0
           12.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           16.0.0.0/24  Direct  0    0           D   16.0.0.6        GigabitEthernet0/0/0
           16.0.0.6/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
           23.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           34.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           45.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
          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
    
    [R6]
            3.3.3.3/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            4.4.4.4/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            5.5.5.5/32  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
            6.6.6.6/32  Direct  0    0           D   127.0.0.1       LoopBack0
           12.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           16.0.0.0/24  Direct  0    0           D   16.0.0.6        GigabitEthernet0/0/0
           16.0.0.6/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/0
           23.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           34.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
           45.0.0.0/24  RIP     100  7           D   16.0.0.1        GigabitEthernet0/0/0
          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
    
    [R6]
    
    展开全文
  • ospf与rip的重分发,在之前的基础上,添加了使用RIPv2协议的R6 Step1:如图所示,敲必打命令与设置IP地址。 R1: <Huawei>undo terminal monitor <Huawei>system-view [...

    项目:OSPF中,Area0为骨干区域、Area1、Area2、Area3为非骨干区域。其中Area3不是Area0的直连区域,所以要在Area1中建立一个虚连接,帮助一个非骨干区域跨越另一个非骨干区域与骨干区域连接。ospf与rip的重分发,在之前的基础上,添加了使用RIPv2协议的R6

              Step1:如图所示,敲必打命令与设置IP地址。

    R1:

    <Huawei>undo terminal monitor

    <Huawei>system-view

     [Huawei]sysname R1

     [R1]user-interface console 0

     [R1-ui-console0]idle-timeout 0 0

    [R1-ui-console0]quit
    [R1]int g0/0/0
    [R1-GigabitEthernet0/0/0]ip add 10.1.0.1 16
    [R1-GigabitEthernet0/0/0]undo shut
    [R1-GigabitEthernet0/0/0]int loop 0
    [R1-LoopBack0]ip add 1.1.1.1 32
    [R1-LoopBack0]quit

    R2、R3、R4、R5、R6同理,先设置IP。全部设置完并可以相互ping通后,开始Step2

    Step2:开始设置路由协议和末梢、完全末梢、次末节、完全次末节

    R1:

    [R1]ospf 1 router-id 1.1.1.1
    [R1-ospf-1]area 3
    [R1-ospf-1-area-0.0.0.3]network 10.1.0.1 0.0.0.0
    [R1-ospf-1-area-0.0.0.3]network 1.1.1.1 0.0.0.0
    [R1-ospf-1-area-0.0.0.3]quit
    [R1-ospf-1]quit
    [R1]ospf 
    [R1-ospf-1]area 3
    [R1-ospf-1-area-0.0.0.3]stub
    [R1-ospf-1-area-0.0.0.3]quit
    [R1-ospf-1]quit

    R2:

    [R2]ospf 1 router-id 2.2.2.2
    [R2-ospf-1]area 3
    [R2-ospf-1-area-0.0.0.3]network 10.1.0.2 0.0.0.0
    [R2-ospf-1-area-0.0.0.3]quit
    [R2-ospf-1]area 1
    [R2-ospf-1-area-0.0.0.1]network 10.0.0.2 0.0.0.0
    [R2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
    [R2-ospf-1-area-0.0.0.1]quit
    [R2-ospf-1]quit 
    [R2]ospf
    [R2-ospf-1]area 3
    [R2-ospf-1-area-0.0.0.3]stub no-summary

    [R2-ospf-1-area-0.0.0.3]return 

    R3:

    [R3]ospf 1 router-id 3.3.3.3
    [R3-ospf-1]area 1
    [R3-ospf-1-area-0.0.0.1]network 10.0.0.3 0.0.0.0
    [R3-ospf-1-area-0.0.0.1]quit
    [R3-ospf-1]area 0
    [R3-ospf-1-area-0.0.0.0]network 10.56.0.3 0.0.0.0
    [R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
    [R3-ospf-1-area-0.0.0.0]network 100.100.100.100 0.0.0.0
    [R3-ospf-1-area-0.0.0.0]quit
    [R3-ospf-1]quit
    [R3]ospf 
    [R3-ospf-1]area 1
    [R3-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
    [R3-ospf-1-area-0.0.0.1]quit
    [R3-ospf-1]quit
     

    R4:

    [R4]ospf 1 router-id 4.4.4.4
    [R4-ospf-1]area 0
    [R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
    [R4-ospf-1-area-0.0.0.0]network 10.56.0.4 0.0.0.0
    [R4-ospf-1-area-0.0.0.0]quit
    [R4-ospf-1]area 2
    [R4-ospf-1-area-0.0.0.2]network 10.2.0.4 0.0.0.0
    [R4-ospf-1-area-0.0.0.2]quit
    [R4-ospf-1]quit
    [R4]ospf 
    [R4-ospf-1]area 2
    [R4-ospf-1-area-0.0.0.2]nssa no-summary 
    [R4-ospf-1-area-0.0.0.2]quit
    [R4-ospf-1]quit

    R5:

    [R5]ospf 1 router-id 5.5.5.5
    [R5-ospf-1]area 2
    [R5-ospf-1-area-0.0.0.2]network 5.5.5.5 0.0.0.0
    [R5-ospf-1-area-0.0.0.2]network 10.2.0.5 0.0.0.0
    [R5-ospf-1-area-0.0.0.2]quit
    [R5-ospf-1]quit
    [R5]rip 
    [R5-rip-1]network 172.16.0.0
    [R5-rip-1]version 2
    [R5-rip-1]undo summary 
    [R5-rip-1]quit
    [R5]ospf
    [R5-ospf-1]import-route rip 1 cost 100
    [R5-ospf-1]quit
    [R5]rip 
    [R5-rip-1]import-route ospf 1 cost 0
    [R5-rip-1]quit
    [R5]ospf
    [R5-ospf-1]area 2
    [R5-ospf-1-area-0.0.0.2]nssa
    [R5-ospf-1-area-0.0.0.2]quit
    [R5-ospf-1]quit
    [R5]rip 
    [R5-rip-1]default-route originate cost 0
    [R5-rip-1]display ip routing-table

     

    设置完可以检查一下,路由器里的路由表,此时除了R4的路由表是齐的,R1、R2、R3缺R5的路由,R5缺R1、R2、R3的路由

    Step3:设置虚连接,在Area1里,通过R2和R3设置

    R2:

    [R2]ospf 
    [R2-ospf-1]area 1
    [R2-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3
    [R2-ospf-1-area-0.0.0.1]quit 
    [R2-ospf-1]quit 

    R3:

    [R3]ospf 
    [R3-ospf-1]area 1
    [R3-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
    [R3-ospf-1-area-0.0.0.1]quit
    [R3-ospf-1]quit

    设置完后,R1到R5的路由表都全了,R1可以ping通R5,项目结束。

    Step4:设置ospf与rip的重分发,在之前的基础上,添加了使用RIPv2协议的R6

    R6:

    [R6]rip 
    [R6-rip-1]network 172.16.0.0
    [R6-rip-1]network 6.0.0.0
    [R6-rip-1]version 2
    [R6-rip-1]undo summary 
    [R6-rip-1]quit

    此时,R5与R6间运行RIPv2协议,检查路由表,R5是全的,R6只能接收到R5的

    R5:

    [R5]ospf
    [R5-ospf-1]import-route rip 1 cost 100
    [R5-ospf-1]quit
    [R5]rip 
    [R5-rip-1]import-route ospf 1 cost 0
    [R5-rip-1]quit

    此时R1到R6都可以互通,项目结束。

    展开全文
  • 实验分析拓扑图R1配置R2配置R3配置R4配置R5配置R6配置将OSPF和RIP相互注入,来相互学习网段末梢区域的优化完全末梢区域的优化NSSA区域(非纯末梢区域)优化总结查看邻居关系OSPF设置末梢区域配置方法 六类链路通告 ...
  • OSPF多区域的路由器设置需要用到路由重分发,还有一些末梢区域和非纯末梢区域的优化

空空如也

空空如也

1 2 3 4 5
收藏数 95
精华内容 38
关键字:

华为ospf重分发