• 单区域OSPF路由协议实现网络区域互通


    1、什么是OSPF协议?

    OSPF协议的全程是开放式最短路径优先协议,协议采用链路状态协议算法(LS协议)

    2、OSPF vs RIP

    RIP路由协议是距离矢量路由选择协议,收敛速度慢,如果在一些大型网络中使用RIP协议,要实现全区域网络互通可能需要一点时间,因此,相较于RIP而言,OSPF路由协议更适合于大型网络。

    3、OSPF协议配置的过程(主要指令)

    router ospf x             //开启ospf协议(其中x代指OSPF路由进程ID)

    router-id x.x.x.x        //指定路由器的Router ID

    network x.x.x.x 反掩码 area x      //宣告路由器各个接口所在网络号及区域

    4、要点提示

    ①OSPF路由进程ID的范围必须是在1~65535,而且只有本地含义,不同路由器的进程ID可以是不同的,但如果要想启动OSPF路由进程,至少确保有一个接口是UP的

    ②Router ID(区域ID)是在0~4294967295内的十进制数,也可以是IP地址格式x.x.x.x,当网络的区域ID为0或0.0.0.0时称为主干区域

    确定Router ID遵循如下的原则:

             最优先的是在OSPF进程中用命令router-id指定路由器ID

             如果没有在OSPF进程中指定路由器的ID,那么选择IP地址最大的环回接口(loopback)的IP定为Router ID

             如果没有环回接口(loopback),那么就选择最大活动的物理接口IP地址作为Router ID(建议用命令router-id来指定路由器ID,这样可控性比较好)

    ③关于反掩码:简言之就是255.255.255.0→0.0.0.255

    实验拓扑:

    详细配置:

    R0:

    enable

    conf t

    hostname R0

    no ip domain-lookup

    int loop 0

    ip add 1.1.1.1 255.255.255.0

    no shu

    int f0/0

    ip add 192.168.12.1 255.255.255.0

    no shu

    exit

    router ospf 1

    router-id 1.1.1.1

    network 1.1.1.0 0.0.0.255 area 0

    network 192.168.12.0 0.0.0.255 area 0

    end

    R1:

    enable

    conf t

    no ip domain-lookup

    hostname R1

    int loop 0

    ip add 2.2.2.2 255.255.255.0

    no shu

    int f0/0

    ip add 192.168.12.2 255.255.255.0

    no shu

    int f0/1

    ip add 192.168.23.1 255.255.255.0

    no shu

    exit

    router ospf 1

    router-id 2.2.2.2

    network 2.2.2.0 0.0.0.255 area 0

    network 192.168.12.0 0.0.0.255 area 0

    network 192.168.23.0 0.0.0.255 area 0

    end

    R2:

    enable

    conf t

    no ip domain-lookup

    hostname R2

    int loop 0

    ip add 3.3.3.3 255.255.255.0

    no shu

    int f0/0

    ip add 192.168.23.2 255.255.255.0

    no shu

    int f0/1

    ip add 192.168.34.1 255.255.255.0

    no shu

    exit

    router ospf 1

    router-id 3.3.3.3

    network 3.3.3.0 0.0.0.255 area 0

    network 192.168.23.0 0.0.0.255 area 0

    network 192.168.34.0 0.0.0.255 area 0

    end

    R3:

    enable

    conf t

    no ip domain-lookup

    hostname R3

    int loop 0

    ip add 4.4.4.4 255.255.255.0

    no shu

    int f0/0

    ip add 192.168.34.2 255.255.255.0

    no shu

    exit

    router ospf 1

    router-id 4.4.4.4

    network 192.168.34.0 0.0.0.255 area 0

    network 4.4.4.0 0.0.0.255 area 0

    end

  • 相关阅读:
    iscroll.js
    HTML 第九章总结
    HTML第八章总结
    HTML第七章总结
    HTML第六章总结
    HTML第五章总结
    HTML第四章总结
    HTML第三章总结
    HTML第二章总结
    HTML第一章总结
  • 原文地址:https://www.cnblogs.com/lilywhite/p/9960884.html
Copyright © 2020-2023  润新知