• 交换机与路由技术-27-OSPF路由重分发


    目录

    一 、路由重分发

    1.1 路由重分发概念

    1.2 路由重分发目的

    1.3 需要重分发的路由

    1.4 重分发到OSPF域中路由的路径类型

    1.5 路由重分发配置命令

    1.5.1 OSPF重分发到静态路由

    1.5.2 OSPF重分发到默认路由

    1.5.3 OSPF重分发到RIP路由

    1.5.4 将RIP重分发到OSPF

    1.6 OSPF路由重分配置案例


    一 、路由重分发

    1.1 路由重分发概念

    路由重分发,为了实现多种路由协议协同工作,路由器可以使用路由重分发,将其学习到的一种路由协议的路由,通过另一种路由协议广播出去,这样网络就能连通了。即将一种路由协议中的路由条目转换为另一种路由协议的路由条目,达到多路由环境下的网络互通。

    1.2 路由重分发目的

    两个自治系统想要互联,可以通过ASBR 运行BGP边界网关协议或者使用路由重分发

    1.3 需要重分发的路由

    OSPF/RIP重分发到静态路由、默认路由、直连路由

    1.4 重分发到OSPF域中路由的路径类型

    类型1外部路径 E1

    内部的代价加上外部的代价(cost值)

    带宽越高,代价越低 cost值越小

    类型2外部路径 E2

    只考虑外部的代价(cost值)

    E1类型(考虑内部和外部)

    路径A—B---D 代价是5+25 ----优先

    路径A—C---D 代价是30+18

    E2类型(只考虑外部)

    路径A—B---D 代价是20

    路径A—C---D 代价是18----优先

    1.5 路由重分发配置命令

    1.5.1 OSPF重分发到静态路由

    1. /* 进入ospf进程 */
    2. Router(config)#route ospf 1
    3. /* static是静态路由 metric 是度量值 subnets 携带子网掩码 */
    4. Router(config-router)#redistribute static metric 100 subnets

    1.5.2 OSPF重分发到默认路由

    1. Router(config)#route ospf 1
    2. /* default-information 是控制默认路由分发 */
    3. /* originate 是分发默认路由 */
    4. Router(config-router)#default-information originate

    1.5.3 OSPF重分发到RIP路由

    1. Router(config)#router ospf 1
    2. Router(config-router)#redistribute rip metric 10 subnets

    1.5.4 将RIP重分发到OSPF

    1. Router(config)#route rip
    2. Router(config-router)#version 2
    3. /* metric值是最大不能超过15,最小不能低于ospf区域路由个数*/
    4. Router(config-router)#redistribute ospf 1 metric 10
    5. Router(config-router)#

    1.6 OSPF路由重分配置案例

    第一步:划分网段、配置IP

    第二步:分区域配置路由协议

    R4上配置出去的静态路由

    R4(config)#

    R4(config)#ip route 0.0.0.0 0.0.0.0 g0/2

    R3上配置回来的静态路由

    R3>enable

    R3#configure terminal

    R3(config)#ip route 192.168.10.0 255.255.255.0 g0/1

    R3上宣告ospf网段和区域

    R3(config)#

    R3(config)#router ospf 1

    R3(config-router)#network 20.0.0.0 0.0.0.3 area 3

    R1上宣告网段和区域

    R1(config)#

    R1(config-router)#router ospf 1

    R1(config-router)#network 30.0.0.0 0.0.0.3 area 0

    R1(config-router)#network 192.168.20.0 0.0.0.255 area 1

    R1(config-router)#network 20.0.0.0 0.0.0.3 area 1

    R1(config-router)#

    R1上配置Eth1/3默认出口路由

    Router(config)#ip route 0.0.0.0 0.0.0.0 eth1/3

    R2上宣告网段和区域

    R2(config)#router ospf 1

    R2(config-router)#network 30.0.0.0 0.0.0.3 area 0

    R2上配置RIP协议

    R2(config)#router rip

    R2(config-router)#version 2

    R2(config-router)#no auto-summary

    R2(config-router)#network 50.0.0.0

    R5上配置RIP协议

    R5(config)#route rip

    R5(config-router)#version 2

    R5config-router)#no auto-summary

    R5(config-router)#network 50.0.0.0

    R5(config-router)#network 192.168.30.0

    ISP路由器配置默认路由

    R2(config-router)#no auto-summary

    R3 OSPF重分发到静态路由

    R3(config)#router ospf 1

    R3(config-router)#redistribute static metric 100 subnets

    R1 OSPF重分发到默认路由

    R1(config)#route ospf 1

    R1(config-router)#default-information originate

    R2配置RIP路由重分发到OSPF

    R2(config)#router ospf 1

    R2(config-router)#redistribute rip metric 10 subnets

    R2将RIP重分发到OSPF

    Router(config)#route rip

    Router(config-router)#version 2

    Router(config-router)#redistribute ospf 1 metric 10

    Router(config-router)#

  • 相关阅读:
    wordpress redirected you too many times.(多重重定向)
    【李宏毅机器学习】Explainable AI
    维格云代码块入门教程
    前端页面布局之【响应式布局】
    反射,折射,菲涅尔反射Shader实现
    React 入门笔记
    10:00面试,10:06就出来了,问的问题有点变态。。。
    automake工具基本使用
    Uniapp 应用消息通知插件 Ba-Notify
    Spring 6【数据校验Validation、JSR 303 和 Hibernate 实现】(十三)-全面详解(学习总结---从入门到深化)
  • 原文地址:https://blog.csdn.net/weixin_46232917/article/details/127031093