当前位置:   article > 正文

思科模拟器OSPF V2配置_思科ospfv2

思科ospfv2

OSPFv2是OSPF第2个版本,与RIP相比它收敛速度快,适用于规模较大的网络。
OSPFv2使用了区域的概念,可以把路由器划分为不同的区域然后进行流量的控制 。     
和OSPF相比,增加router-id的ospf就是ospf v2

1.R1(config-router)#auto-cost reference-bandwidth 1000

[修改参考带宽为1000Mbps]  这两条命令是干预OSPFv2自动选路的

2.R1(config-if)#ip ospf cost 3 [修改接口开销为3]

  1. 就像这样,默认路径走的是中间的百兆路线,如果想让他默认走两侧的前兆 路线,就需要更改他的参考带宽
  2. 比如改成1000mbps,就可以默认走两侧的千兆路线走
  3. 验证PC1与PC2互通时流量经过的路径
  4. C:\>tracert 192.168.2.1
  5. Tracing route to 192.168.2.1 over a maximum of 30 hops:
  6. 1 0 ms 0 ms 0 ms 192.168.1.254 //路由器R1
  7. 2 0 ms 0 ms 0 ms 10.2.13.3 //路由器R3
  8. 3 0 ms 0 ms 0 ms 10.2.36.6 //路由器R6
  9. 4 0 ms 0 ms 10 ms 10.2.68.8 //路由器R8
  10. 5 0 ms 11 ms 0 ms 192.168.2.1 //目的主机
  11. Trace complete.

3.R1(config-if)#ip ospf hello-interval 5

R1(config-if)#ip ospf dead-interval 20

[接口的Hello间隔和Dead间隔默认值为10s和40s]

[这两条是修改路由器Hello间隔、Dead间隔干预邻接关系的,若两端间隔设置不相同,会导致邻里关系失效]

  1. 修改OSPF v2协议中:hello和dead间隔后,会发现两端路由器建立邻接关系
  2. 所以两端的hello和dead必须相同,如果不同的话会造成邻接关系失效
  3. 所以要么还原这台路由器的设置,或者将另一台路由器也修改成相同的参数即可恢复
  4. R2(config)#in g 0/0
  5. R2(config-if)#
  6. R2(config-if)#ip os
  7. R2(config-if)#ip ospf h
  8. R2(config-if)#ip ospf hello-interval 5
  9. R2(config-if)#ip o
  10. R2(config-if)#ip ospf de
  11. R2(config-if)#ip ospf dead-interval 20
  12. R2(config-if)#do sh ip os ne
  13. Neighbor ID Pri State Dead Time Address Interface
  14. 1.1.1.1 1 FULL/DR 00:00:29 10.0.12.1 GigabitEthernet0/0
  15. R2(config-if)#do sh ip os ne
  16. Neighbor ID Pri State Dead Time Address Interface
  17. 1.1.1.1 1 FULL/DR 00:00:09 10.0.12.1 GigabitEthernet0/0
  18. R2(config-if)#do sh ip os ne
  19. Neighbor ID Pri State Dead Time Address Interface
  20. 1.1.1.1 1 FULL/DR 00:00:08 10.0.12.1 GigabitEthernet0/0
  21. R2(config-if)#do sh ip os ne
  22. Neighbor ID Pri State Dead Time Address Interface
  23. 1.1.1.1 1 FULL/DR 00:00:00 10.0.12.1 GigabitEthernet0/0
  24. R2(config-if)#
  25. 00:08:37: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
  26. 00:08:37: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
  27. 修改成默认设置之后会发现他们之间邻里关系恢复正常了
  28. R2(config-if)#ip ospf he
  29. R2(config-if)#ip ospf hello-interval 10
  30. R2(config-if)#ip os de
  31. R2(config-if)#ip os dead-interval 40
  32. R2(config-if)#do sh ip os ne
  33. Neighbor ID Pri State Dead Time Address Interface
  34. 1.1.1.1 1 INIT/DROTHER 00:00:36 10.0.12.1 GigabitEthernet0/0
  35. R2(config-if)#
  36. 00:15:33: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done

4.R2(config-if)#ip ospf priority 0[修改OSPF接口优先级为0]

5..R2#clear ip ospf  process [重置OSPFv2进程]

修改OSPFV2接口优先级,重置一下OSPFV2进程之后就可以重新建立邻接关系

  1. R2(config-if)#ip ospf priority 0
  2. R2(config-if)#do clear ip ospf pro
  3. Reset ALL OSPF processes? [no]: y
  4. R2(config-if)#
  5. 00:18:22: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Adjacency forced to reset
  6. 00:18:22: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
  7. R2(config-if)#
  8. 00:18:24: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
  9. 当两台路由器接口优先级都设置为0时,接口状态会显示2WAY,这个时候网络中就不存在DR/BDR信息,所以R1R2这个时候都会变成DROTHER,这种状态下是一个错误的状态,这样会使邻接关系发生错误,进而无法形成路由表
  10. 想要改变这种故障,只需要修改一台路由器的优先级非0即可,也可以修改为点到点类型{point-to-point}
  11. R1#show ip os neighbor
  12. Neighbor ID Pri State Dead Time Address Interface
  13. 2.2.2.2 0 2WAY/DROTHER 00:00:39 10.0.12.2 GigabitEthernet0/0
  14. R1#
  15. R1#ping 10.2.1.2
  16. Type escape sequence to abort.
  17. Sending 5, 100-byte ICMP Echos to 10.2.1.2, timeout is 2 seconds:
  18. .....
  19. Success rate is 0 percent (0/5)

6.R1(config-if)#ip ospf network point-to-point [修改OSPFV2接口模式为点到点类型]

  1. 修改两边路由器接口类型为点对点模式,即可排除故障
  2. R2(config)#in g 0/0
  3. R2(config-if)#ip os net point-to-point
  4. R2(config-if)#
  5. 00:35:03: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from 2WAY to DOWN, Neighbor Down: Interface down or detached
  6. 00:35:03: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
  7. R2(config-if)#do sh ip os ne
  8. Neighbor ID Pri State Dead Time Address Interface
  9. 1.1.1.1 0 FULL/ - 00:00:35 10.0.12.1 GigabitEthernet0/0
  10. R2#
  11. %SYS-5-CONFIG_I: Configured from console by console
  12. 两侧修改之后可以发现,两侧正常通信了
  13. R2#ping 10.2.1.2
  14. Type escape sequence to abort.
  15. Sending 5, 100-byte ICMP Echos to 10.2.1.2, timeout is 2 seconds:
  16. !!!!!
  17. Success rate is 100 percent (5/5), round-trip min/avg/max = 0/2/5 ms
  18. R2#

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/743615
推荐阅读
相关标签
  

闽ICP备14008679号