科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网网络频道路由交换 ospf配置实验

ospf配置实验

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

ospf配置实验

来源:chinaitlab 2011年4月16日

关键字: OSPF 路由交换

  • 评论
  • 分享微博
  • 分享邮件

  

  ospf实验,拓扑图如上

  一。配置IP地址

  1.在R11上建立Loopback接口:

  Lo:10.10.10.10/24

  在R13上建立loopback接口

  lo:30.30.30.30/24

  2.接口IP=192.168.YX.X/24

  二。启动OSPF

  1。宣告

  2。查看路由表,邻居表,拓扑表(sh ip ospf data)

  3。查看DR,管理距离值?

  三、

  1。修改R12/R13做为DR

  四、在R12与R13上做明文验证,密钥为cisco

  五、让R11与R12点到点链路也选DR

  配置R11:

  R11#conf t

  R11(config)#int s1/1

  R11(config-if)#no sh

  R11(config-if)#ip add 192.168.21.1 255.255.255.0

  R11(config-if)#int l

  % Incomplete command.

  R11(config)#int l 0

  R11(config-if)#ip add 10.10.10.10 255.255.255.0

  R11(config)#router ospf 100

  R11(config-router)#netw 192.168.21.1 0.0.0.255 area 0

  R11(config-router)#net 10.10.10.10 0.0.0.0 area 0

  R11(config-router)#exit

  配置R12

  R12(config)#int s1/1

  R12(config-if)#no sh

  R12(config-if)#ip add 192.168.21.2 255.255.255.0

  R12(config-if)#int f0/0

  R12(config-if)#no sh

  R12(config-if)#ip add 192.168.32.2 255.255.255.0

  R12(config-if)#exit

  R12(config)#router ospf 100

  R12(config-router)#net 192.168.21.0 0.0.0.255

  % Incomplete command.

  R12(config-router)#net 192.168.21.0 0.0.0.255 area

  % Incomplete command.

  R12(config-router)#net 192.168.21.0 0.0.0.255 area 0

  R12(config-router)#net 192.168.32.0 0.0.0.255 area 0

  配置R13

  R13(config)#int f0/0

  R13(config-if)#no sh

  R13(config-if)#ip add 192.168.32.3 255.255.255.0

  R13(config-if)#int l 0

  R13(config-if)#ip add 30.30.30.30 255.255.255.0

  R13(config-if)#no sh

  R13(config-if)#exit

  R13(config)#router ospf 100

  R13(config-router)#net 192.168.32.3 0.0.0.255

  % Incomplete command.

  R13(config-router)#net 192.168.32.3 0.0.0.255 area 0

  R13(config-router)#net 30.30.30.30 0.0.0.0 area 0

  2。查看路由表,邻居表,拓扑表(sh ip ospf data)

  在R12上面查看

  R12#sh ip ospf nei

  *Mar 1 01:08:29.731: %SYS-5-CONFIG_I: Configured from console by console

  R12#sh ip ospf nei

  Neighbor ID Pri State Dead Time Address Interface

  10.10.10.10 0 FULL/ - 00:00:34 192.168.21.1 Serial1/1

  30.30.30.30 1 FULL/DR 00:00:37 192.168.32.3 FastEthernet0/0

  R12#sh ip route

  Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

  D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

  N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

  E1 - OSPF external type 1, E2 - OSPF external type 2

  i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

  ia - IS-IS inter area, * - candidate default, U - per-user static route

  o - ODR, P - periodic downloaded static route

  Gateway of last resort is not set

  20.0.0.0/24 is subnetted, 1 subnets

  C 20.20.20.0 is directly connected, Loopback0

  C 192.168.21.0/24 is directly connected, Serial1/1

  10.0.0.0/32 is subnetted, 1 subnets

  O 10.10.10.10 [110/65] via 192.168.21.1, 00:00:17, Serial1/1(管理距离值)

  C 192.168.32.0/24 is directly connected, FastEthernet0/0

  30.0.0.0/32 is subnetted, 1 subnets

  O 30.30.30.30 [110/11] via 192.168.32.3, 00:00:17, FastEthernet0/0

  R12#sh ip ospf data

  OSPF Router with ID (20.20.20.20) (Process ID 100)

  Router Link States (Area 0)

  Link ID ADV Router Age Seq# Checksum Link count

  10.10.10.10 10.10.10.10 29 0x8000000A 0x004182 3

  20.20.20.20 20.20.20.20 49 0x80000010 0x002874 3

  30.30.30.30 30.30.30.30 939 0x80000008 0x00701F 2

  Net Link States (Area 0)

  Link ID ADV Router Age Seq# Checksum

  192.168.32.3 30.30.30.30 934 0x80000003 0x00CE9B

  三、

  1。修改R2做为DR(根据邻居表能够看出R13为dr)

  R12(config)#router ospf 100

  R12(config-router)#router-

  R12(config-router)#router-id 40.40.40.40

  Reload or use "clear ip ospf process" command, for this to take effect

  R13#clear ip ospf process

  Reset ALL OSPF processes? [no]: y

  R13#

  *Mar 1 01:13:28.103: %OSPF-5-ADJCHG: Process 100, Nbr 20.20.20.20 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached

  *Mar 1 01:13:28.575: %OSPF-5-ADJCHG: Process 100, Nbr 20.20.20.20 on FastEthernet0/0 from LOADING to FULL, Loading Done

  四 在R12与R13上做明文验证,密钥为cisco

  R12(config)#int f0/0

  R12(config-if)#ip ospf auth

  R12(config-if)#ip ospf auth

  R12(config-if)#ip ospf authentication-k

  *Mar 1 01:18:08.667: %OSPF-5-ADJCHG: Process 100, Nbr 30.30.30.30 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

  R12(config-if)#ip ospf authentication-k

  R12(config-if)#ip ospf authentication-key cisco

  R13(config)#int f0/0

  R13(config-if)#ip ospf auth

  R13(config-if)#ip ospf auth

  R13(config-if)#ip ospf authentication-k

  R13(config-if)#ip ospf authentication-key cisoc

  R13(config-if)#

  *Mar 1 01:18:07.835: %OSPF-5-ADJCHG: Process 100, Nbr 20.20.20.20 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

  五 让R11与R12点到点链路也选DR

  R11(config)#int s1/1

  R11(config-if)#ip ospf net bro

  R11(config-if)#

  *Mar 1 01:19:29.363: %OSPF-5-ADJCHG: Process 100, Nbr 20.20.20.20 on Serial1/1 from FULL to DOWN, Neighbor Down: Interface down or detached

  R12(config)#int s1/1

  R12(config-if)#ip ospf net bro

  R12(config-if)#

  *Mar 1 01:19:44.799: %OSPF-5-ADJCHG: Process 100, Nbr 10.10.10.10 on Serial1/1 from EXSTART to DOWN, Neighbor Down: Interface down or detached

  *Mar 1 01:20:25.167: %OSPF-5-ADJCHG: Process 100, Nbr 10.10.10.10 on Serial1/1 from LOADING to FULL, Loading Done

    • 评论
    • 分享微博
    • 分享邮件
    邮件订阅

    如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章