• 路由器配置——OSPF协议(1)


    一、实验目的:用OSPF协议使全网互通

    二、拓扑图

    三、具体步骤配置

    (1)R1路由器配置

    Router>enable
    Router#configure terminal
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#hostname R1
    R1(config)#interface f0/0
    R1(config-if)#ip address 192.168.1.2 255.255.255.0
    R1(config-if)#no shutdown

    R1(config-if)#interface s0/0/0
    R1(config-if)#ip address 10.1.1.1 255.255.255.0
    R1(config-if)#clock rate 64000
    R1(config-if)#no shutdown

    R1(config-if)#interface s0/0/1
    R1(config-if)#ip address 30.1.1.1 255.255.255.0
    R1(config-if)#clock rate 64000
    This command applies only to DCE interfaces
    R1(config-if)#no shutdown

    R1(config-if)#exit
    R1(config)#router ospf 1
    R1(config-router)#router-id 1.1.1.1
    R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
    R1(config-router)#network 10.1.1.0 0.0.0.255 area 0
    R1(config-router)#network 30.1.1.0 0.0.0.255 area 0
    R1(config-router)#end

    (2)R2路由器配置

    Router>enable
    Router#configure terminal
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#hostname R2
    R2(config)#interface f0/0
    R2(config-if)#ip address 192.168.2.2 255.255.255.0
    R2(config-if)#no shutdown

    R2(config-if)#interface s0/0/0
    R2(config-if)#ip address 20.1.1.1 255.255.255.0
    R2(config-if)#clock rate 64000
    R2(config-if)#no shutdown

    R2(config-if)#interface s0/0/1
    R2(config-if)#ip address 10.1.1.2 255.255.255.0
    R2(config-if)#clock rate 64000
    This command applies only to DCE interfaces
    R2(config-if)#no shutdown

    %LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
    R2(config-if)#exit
    R2(config)#router ospf 1
    R2(config-router)#router-id 2.2.2.2
    R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
    R2(config-router)#network 20.1.1.0 0.0.0.255 area 0
    R2(config-router)#network 10.1.1.0 0.0.0.255 area 0
    R2(config-router)#end

    (3)R3路由器配置

    Router>enable
    Router#configure terminal
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#hostname R3
    R3(config)#interface f0/0
    R3(config-if)#ip address 192.168.3.1 255.255.255.0
    R3(config-if)#no shutdown

    R3(config-if)#interface s0/0/0
    R3(config-if)#ip address 30.1.1.2 255.255.255.0
    R3(config-if)#clock rate 64000
    R3(config-if)#no shutdown

    %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
    R3(config-if)#interface s0/0/1
    R3(config-if)#ip address 20.1.1.2 255.255.255.0
    R3(config-if)#clock rate 64000
    This command applies only to DCE interfaces
    R3(config-if)#no shutdown

    %LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
    R3(config-if)#exit
    R3(config)#router ospf 1
    R3(config-router)#router-id 3.3.3.3
    R3(config-router)#network 192.168.3.0 0.0.0.255 area 0
    R3(config-router)#network 30.1.1.0 0.0.0.255 area 0
    R3(config-router)#network 20.1.1.0 0.0.0.255 area 0
    R3(config-router)#end

    (4)R4路由器配置

    Router>enable
    Router#configure terminal
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#hostname R4
    R4(config)#interface f0/0
    R4(config-if)#ip address 192.168.1.1 255.255.255.0
    R4(config-if)#no shutdown

    R4(config-if)#interface f0/1
    R4(config-if)#ip address 192.168.10.254 255.255.255.0
    R4(config-if)#no shutdown

    R4(config-if)#exit
    R4(config)#router ospf 1
    R4(config-router)#router-id 4.4.4.4
    R4(config-router)#network 192.168.1.0 0.0.0.255 area 0
    R4(config-router)#network 192.168.10.0 0.0.0.255 area 0
    R4(config-router)#end

    (5)R5路由器配置

    Router>enable
    Router#configure terminal
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#hostname R5
    R5(config)#interface f0/0
    R5(config-if)#ip address 192.168.3.2 255.255.255.0
    R5(config-if)#no shutdown

    R5(config-if)#interface f0/1
    R5(config-if)#ip address 192.168.30.254 255.255.255.0
    R5(config-if)#no shutdown

    R5(config-if)#exit
    R5(config)#router ospf 1
    R5(config-router)#router-id 5.5.5.5
    R5(config-router)#network 192.168.3.0 0.0.0.255 area 0
    R5(config-router)#network 192.168.30.0 0.0.0.255 area 0
    R5(config-router)#end

    (6)R6路由器配置

    Router>enable
    Router#configure terminal
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#hostname R6
    R6(config)#interface f0/0
    R6(config-if)#ip address 192.168.2.1 255.255.255.0
    R6(config-if)#no shutdown

    R6(config-if)#interface f0/1
    R6(config-if)#ip address 192.168.20.254 255.255.255.0
    R6(config-if)#no shutdown

    R6(config-if)#exit
    R6(config)#router ospf 1
    R6(config-router)#router-id 6.6.6.6
    R6(config-router)#network 192.168.2.0 0.0.0.255 area 0
    R6(config-router)#network 192.168.20.0 0.0.0.255 area 0
    R6(config-router)#end

    四、验证测试

    1、查看R1路由表信息

    2、查看ip路由协议配置与统计信息

    3、查看OSPF数据库信息

    4、查看OSPF进程及区域的细节。如路由器运行SPF算法的次数

    5、测试各台主机间是否互通

    (1)PC1与PC2

    (2)PC2与PC3

    (3)PC3与PC1

  • 相关阅读:
    Software_Kingjdk配置java
    SSH中的分页错误:java.lang.Integer cannot be cast to java.lang.Long
    struts2中文件上传出错!
    Navicat Premium(导航猫数据库管理)navicat091_premium_cs + instantclientbasic
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in readonly mode (FlushMode.NEVER/MANUAL): Turn your Ses
    OAS2Sh项目中:java.lang.IllegalArgumentException: id to load is required for loading
    python之封装
    python函数中的装饰器
    OSI七层模型
    函数
  • 原文地址:https://www.cnblogs.com/evolve/p/9230807.html
Copyright © 2020-2023  润新知