zoukankan      html  css  js  c++  java
  • 路由器配置——OSPF协议(2)

    一、实验目的:使用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 l0

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

    %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
    R1(config-if)#exit
    R1(config)#router ospf 1
    R1(config-router)#router-id 1.1.1.1
    R1(config-router)#network 1.1.1.0 0.0.0.255 area 0
    R1(config-router)#network 192.168.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 l0

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

    R2(config-if)#interface s0/0/1
    R2(config-if)#ip address 192.168.2.1 255.255.255.0
    R2(config-if)#clock rate 64000
    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 2.2.2.0 0.0.0.255 area 0
    R2(config-router)#network 192.168.1.0 0.0.0.255 area 0
    R2(config-router)#network 192.168.2.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 l0

    R3(config-if)#ip address 3.3.3.3 255.255.255.0
    R3(config-if)#no shutdown
    R3(config-if)#interface s0/0/0
    R3(config-if)#ip address 192.168.3.1 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 192.168.2.2 255.255.255.0
    R3(config-if)#clock rate 64000
    This command applies only to DCE interfaces
    R3(config-if)#no shutdown

    R3(config-if)#exit
    R3(config)#router ospf 1
    R3(config-router)#router-id 3.3.3.3
    R3(config-router)#network 3.3.3.0 0.0.0.255 area 0
    R3(config-router)#network 192.168.3.0 0.0.0.255 area 0
    R3(config-router)#network 192.168.2.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 l0

    R4(config-if)#ip address 4.4.4.4 255.255.255.0
    R4(config-if)#no shutdown
    R4(config-if)#interface s0/0/0
    R4(config-if)#ip address 192.168.3.2 255.255.255.0
    R4(config-if)#clock rate 64000
    This command applies only to DCE interfaces
    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 4.4.4.0 0.0.0.255 area 0
    R4(config-router)#network 192.168.3.0 0.0.0.255 area 0
    R4(config-router)#end

    四、验证测试

    (1)查看R1路由表信息

    (2)查看R1的OSPF协议数据库信息

    (3)测试网络是否互通

     

    结果:全网互通成功

  • 相关阅读:
    usaco dec 2012 first!
    uva 1449
    unity3D学习笔记之DOTween插件的学习(持续更新)
    中南林业科技大学第十一届程序设计大赛 G 0和5
    中南林业科技大学第十一届程序设计大赛 D 最大的湖
    最小生成树之克鲁斯卡尔(Kruskal)算法
    最小生成树Prim算法理解
    判断无向图是否联通模板(并查集版)(DFS),BFS等其他方法将陆续更新
    矩阵压缩学习笔记
    C/C++ assert()函数用法总结
  • 原文地址:https://www.cnblogs.com/evolve/p/9230816.html
Copyright © 2011-2022 走看看