精华内容
下载资源
问答
  • 文章目录前言:一、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高级配置实例(路由重分发、)一、路由重分发题目及需求配置命令R1R2R3R4R5R6结果 一、路由重分发 题目及需求 实现互通 配置命令 R1 <Huawei>sys Enter system view, return user view with Ctrl+Z. ...

    一、路由重分发

    基本配置命令

    [Huawei]rip 1   ###配置RIP
    [Huawei-rip-1]version 2
    [Huawei-rip-1]undo summary
    [Huawei-rip-1]network 11.0.0.0
    [Huawei-rip-1]import-route ospf 1 cost 3
    #把OSPF协议注入到Rip进行路由重分发,路径类型缺省为路径类型2(外部开销),成本开销为3(对于Rip的度量值为跳数),Rip中重分发OSPF需要指定cost值,cost不能超过1515跳)
    [Huawei-rip-1]ospf 1
    [Huawei-ospf-1]import-route rip 1 type 1 cost 1
    #把Rip协议注入到OSPF进行路由重分发,使用路径1(内部开销+外部开销),成本开销为1(COST=100M/BW)  
    
    [Huawei-ospf-1]default-route-advertise always   #OSPF重分发默认路由
    [Huawei-ospf-1]import-route direct              #OSPF重分发直连路由
    [Huawei-ospf-1]import-route static	        #OSPF重分发静态路由 

    实验题目及需求

    在这里插入图片描述
    实现互通

    配置命令

    R1

    <Huawei>sys
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]sys R1
    [R1]int g0/0/0
    [R1-GigabitEthernet0/0/0]ip add 192.168.10.1 24
    [R1-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R1-GigabitEthernet0/0/0]q
    [R1]int loo 0
    [R1-LoopBack0]ip add 1.1.1.1 32
    [R1-LoopBack0]q
    
    [R1]ip route-static 0.0.0.0 0 192.168.10.2   ###配置静态路由
    
    

    R2

    <Huawei>sys
    Enter system view, return user view with Ctrl+Z.
    [Huawei]sys R2
    [R2]un in en
    Info: Information center is disabled.
    [R2]int g0/0/0
    [R2-GigabitEthernet0/0/0]ip add 192.168.10.2 24
    [R2-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R2-GigabitEthernet0/0/0]int g0/0/1
    [R2-GigabitEthernet0/0/1]ip add 192.168.20.2 24
    [R2-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [R2-GigabitEthernet0/0/1]int loo 0
    [R2-LoopBack0]ip add 2.2.2.2 32
    [R2-LoopBack0]q
    
    [R2]ospf
    [R2-ospf-1]area 1
    [R2-ospf-1-area-0.0.0.1]net 192.168.20.0 0.0.0.255
    [R2-ospf-1-area-0.0.0.1]net 2.2.2.2 0.0.0.0   ###宣告0SPF区域内的直连网段,使用反掩码
    [R2-ospf-1-area-0.0.0.1]q
    
    [R2]ip route-static 1.1.1.1 32 192.168.10.1  ###配置静态路由
    
    [R2]ospf
    [R2-ospf-1]import-route static   ###OSPF重分发静态路由
    [R2-ospf-1]import-route direct   ###OSPF重分发直连路由
    

    R3

    <Huawei>sys
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en
    Info: Information center is disabled.
    [Huawei]SYS R3
    [R3]int g0/0/0
    [R3-GigabitEthernet0/0/0]ip add 192.168.30.3 24
    [R3-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R3-GigabitEthernet0/0/0]int g0/0/1
    [R3-GigabitEthernet0/0/1]ip add 192.168.20.3 24
    [R3-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [R3-GigabitEthernet0/0/1]int g0/0/2
    [R3-GigabitEthernet0/0/2]ip add 192.168.40.3 24
    [R3-GigabitEthernet0/0/2]un sh
    Info: Interface GigabitEthernet0/0/2 is not shutdown.
    [R3-GigabitEthernet0/0/2]int loo 0
    [R3-LoopBack0]ip add 3.3.3.3 32
    [R3-LoopBack0]q
    
    [R3]ospf
    [R3-ospf-1]area 0
    [R3-ospf-1-area-0.0.0.0]net 192.168.30.0 0.0.0.255
    [R3-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
    [R3-ospf-1-area-0.0.0.0]area 1
    [R3-ospf-1-area-0.0.0.1]net 192.168.20.0 0.0.0.255   ###宣告0SPF区域内的直连网段,使用反掩码
    [R3-ospf-1-area-0.0.0.1]q
    [R3-ospf-1]q
    
    [R3]ip route-static 0.0.0.0 0 192.168.40.5   ###配置静态路由
    
    [R3]ospf 
    [R3-ospf-1]default-route-advertise always   ###OSPF重分发默认路由
    [R3-ospf-1]import-route direct   ###OSPF重分发直连路由
    
    

    R4

    <Huawei>sys
    Enter system view, return user view with Ctrl+Z.
    [Huawei]un in en 
    Info: Information center is disabled.
    [Huawei]sys R4
    [R4]int g0/0/0
    [R4-GigabitEthernet0/0/0]ip add 192.168.30.4 24
    [R4-GigabitEthernet0/0/0]un sh 
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R4-GigabitEthernet0/0/0]int g0/0/1
    [R4-GigabitEthernet0/0/1]ip add 192.168.50.4 24
    [R4-GigabitEthernet0/0/1]un sh
    Info: Interface GigabitEthernet0/0/1 is not shutdown.
    [R4-GigabitEthernet0/0/1]int loo 0
    [R4-LoopBack0]ip add 4.4.4.4 32
    [R4-LoopBack0]q
    
    [R4]ospf 
    [R4-ospf-1]area 0
    [R4-ospf-1-area-0.0.0.0]net 192.168.30.0 0.0.0.255
    [R4-ospf-1-area-0.0.0.0]net 4.4.4.4 0.0.0.0###宣告0SPF区域内的直连网段,使用反掩码
    [R4-ospf-1-area-0.0.0.0]q
    [R4-ospf-1]
    
    [R4]rip   ###配置RIP
    [R4-rip-1]v 2
    [R4-rip-1]un su
    [R4-rip-1]net 192.168.50.0
    [R4-rip-1]import-route ospf 1 cost 5
    [R4-rip-1]q
    [R4]ospf
    [R4-ospf-1]import-route rip 1 type 1 cost 1
    
    

    R5

    <Huawei>sys
    Enter system view, return user view with Ctrl+Z.
    [Huawei]sys R5
    [R5]un in en
    Info: Information center is disabled.
    [R5]int g0/0/0
    [R5-GigabitEthernet0/0/0]ip add 192.168.40.5 24
    [R5-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R5-GigabitEthernet0/0/0]int loo 0 
    [R5-LoopBack0]ip add 5.5.5.5 32
    [R5-LoopBack0]q
    
    [R5]ip route-static 0.0.0.0 0 192.168.40.3   ###配置静态路由
    

    R6

    <Huawei>sys
    Enter system view, return user view with Ctrl+Z.
    [Huawei]sys R6
    [R6]un in en
    Info: Information center is disabled.
    [R6]int g0/0/0
    [R6-GigabitEthernet0/0/0]ip add 192.168.50.6 24
    [R6-GigabitEthernet0/0/0]un sh
    Info: Interface GigabitEthernet0/0/0 is not shutdown.
    [R6-GigabitEthernet0/0/0]int loo 0
    [R6-LoopBack0]ip add 6.6.6.6 32
    [R6-LoopBack0]q
    
    [R6]rip   ###配置RIP
    [R6-rip-1]v 2
    [R6-rip-1]un su
    [R6-rip-1]net 192.168.20.0
    [R6-rip-1]net 6.0.0.0
    [R6-rip-1]dis th
    [V200R003C00]
    #
    rip 1
     undo summary
     version 2
     network 192.168.20.0
     network 6.0.0.0
    #
    return
    [R6-rip-1]q
    

    结果

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

    展开全文
  • 2.启动ospf协议 3.启动rip协议 4.将PC1 的路由引入OSPF中 [R1]ospf 1 [R1-ospf-1]import-route direct 5.将 PC2发布到RIP中 [R4]rip [R4-rip-1]import-route direct 6.在R2 和R3上进行双点双向发布 [R3]rip ...
  • 二、 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管理路由器
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

    展开全文
  • 主要为大家介绍了给华为路由器eNSP配置rip OSPF 路由发布的过程,不了解路由器rip OSPF 路由发布的朋友可以和脚本之家的小编一起来学习一下
  • 实验: 末梢区域优化的是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路由重分发

    2019-05-11 17:25:01
    就需要使用今天介绍的路由重分发,那我们下面简单介绍一下路由重分发及相关的配置。路由重分发通常在那些负责从一个AS学习路由,然后向另一个AS广播的路由器进行配置,简单来说就是将一种路由协议产生的路...
  • Huawei BGP和OSPF双边界分布(二)

    千次阅读 2019-08-03 00:35:09
    AR1和AR3260-AR2的路由域的边界上,从AR3260-AR1上分布进BGP 65001的路由的时候打tag 650011,在AR3260-AR2上分布进BGP 65001的路由的时候打tag 650012 ,然后在AR3260-AR1上将OSPF 100的路由分布进BGP 65000...
  • 华为 OSPF与RIP分布

    千次阅读 多人点赞 2020-02-18 23:05:44
    华为 OSPF与RIP分布 拓扑 设备AR-1基本配置: sys [Huawei]sysname AR-1 [AR-1]int g0/0/0 [AR-1-GigabitEthernet0/0/0]ip add 12.1.1.1 24 [AR-1-GigabitEthernet0/0/0]quit [AR-1]rip 1 [AR-1-rip-1]undo ...
  • 重分发OSPF域中路由的路径类型 类型1的外部路径(Type 1 external path,E1) 类型2的外部路径(Type 2 external path,E2) ——主要用于当有2个或以上的ASBR通向同一外部网络时进行选路 E1类型: 路
  • 作者:最铁头的网工 (全球首批HCIA-DATACOM认证者) 认证技术:关于HCIA-DATACOM认证技术知识会在我博客做...众元教育-华为HCIA-DATACOM技术认证课:课程通道 众元教育-华为HCIA-DATACOM技术认证裙:696283186 ...
  • 华为ospf与思科ospf对比

    千次阅读 2019-06-08 16:42:55
    1.ospf对比:1)华为ospf基本配置:系统试图:设置router-id:router id 路由器id系统试图:进入ospf配置试图:ospf进入区域配置试图:area 区域编号将接口网段加入ospf:network 网段 反码返回用户试图:return2...
  • IR域内路由器 ABR区域边界路由器 BR骨干路由器 ASBR自治系统边界路由器 全局router-id,如果后面的ospf不宣告的话,默认加入全局...注:华为高端设备,查看隐藏命令 display ip routing-table _vrbd 诊断视...
  • 然后向另一个AS广播的路由器上进行配置,例如,一台路由器即运行OSPF又运行RIP,如果OSPF进程被配置为通告由RIP学习到的路由到OSPF AS中,那么这种做法就可以成为“重分发RIP”。 一个单一的IP路由器协议是管理网络...
  • ospf与rip的重分发,在之前的基础上,添加了使用RIPv2协议的R6 Step1:如图所示,敲必打命令与设置IP地址。 R1: <Huawei>undo terminal monitor <Huawei>system-view [...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 875
精华内容 350
关键字:

华为ospf重分发