首页 专题 - 实验 - 软件 - 管理 - 布线 - 方案 - 配置 - 问题 - 协议 - 下载 - 交换 - 路由 - 无线 - 安全 - 认证 - Cisco - 华为 - 网吧 - ADSL
您是本帖第314位浏览者 打印

[分享] 基于广播媒介的OSPF的初始配置

基于广播媒介的OSPF的初始配置

  前言
  默 认情况下在以太网、令牌环和其他广播价质,开放式最短路径优先 (OSPF)运行作为广播网络类型。本文展示基于广播媒介的 OSPF的示例配置。检查运行OSPF的接口的网络类型,使用 show ip ospf interface命令。
  
  使用的组件
  本文的信息根 据以下的软件及硬件版本。
  
  Cisco 2503路由器
  运行在两个路由器的Cisco IOS软件版本 12.2(10b)
  
  本文提供的信息在特定实 验室环境里从设备被创建了。用于本文的所有设备开始了以 一个缺省(默认)配置。如果在一个真实网络工作,保证您 使用它以前了解所有命令的潜在影响。
  
  相关产品
  此配置可以用任何二个 路由器使用,中的每一有一个广播接口。可以使用以太网、 令牌环和FDDI接口。
  
  配置
  在 此部分,您介绍用信息配置在本文描述的功能。
  
  注意: 找到其它信息关于用于本 文的命令,使用 命令查找工具 (注册的用户)。
  
  网络图
  本文使用网络建立图示 如下的。
  


  配置
  本 文使用配置如下所示。
  
  Router1
  
  interface Loopback0
   ip address 192.168.45.1 255.255.255.0
   !
   interface Ethernet0
   ip address 10.10.10.1 255.255.255.0
   !
   router ospf 1
   network 10.10.10.0 0.0.0.255 area 0
   !
  
  
  
  Router2
  
  interface Loopback0
   ip address 172.16.10.1 255.255.255.0
   !
   interface Ethernet0
   ip address 10.10.10.2 255.255.255.0
   !
   router ospf 1
   network 10.10.10.0 0.0.0.255 area 0
  
  
  验证
  此部分提供您能使用确认您的配置适当地工作的信息。
  
  输出解释器工具 支持 某些show命令 (注册的用户 ),允许您查看show命令输出分析 。
  
  使用 show ip ospf neighbor命 令,您能验证router ospf的邻接关系状态的状况。在 Router1发出的 show ip ospf neighbor命令的输出,如下 所示。
  Router1#show ip ospf neighbor
    Neighbor ID   Pri     State     Dead Time   Address    Interface
    172.16.10.1    1     FULL/BDR    00:00:38   10.10.10.2   Ethernet0
  
  
  从特定输出,相邻状态是 充分的在Router1关于相邻ID是172.16.10.1的Router2。 Router2是一个备份指定路由(BDR)在此广播网络。了解更多关于什么 show ip ospf neighbor命令显示,提到 什么执行show ip ospf neighbor命令显示?
  
  OSPF特定数据与接口(例如,链 路的有关网络类型)可以用show ip ospf interface命令 遵守。下列是在 Router1 以太网接口发出的 show ip ospf interface命令的 输出。
  Router1#show ip ospf interface ethernet 0
    Ethernet0 is up, line protocol is up
    Internet Address 10.10.10.1/24, Area 0
    Process ID 1, Router ID 192.168.45.1, Network Type BROADCAST, Cost: 10
    Transmit Delay is 1 sec, State DR, Priority 1
    Designated Router (ID) 192.168.45.1, Interface address 10.10.10.1
    Backup Designated router (ID) 172.16.10.1, Interface address 10.10.10.2
    Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:00
    Index 2/2, flood queue length 0
    Next 0x0(0)/0x0(0)
    Last flood scan length is 2, maximum is 2
    Last flood scan time is 0 msec, maximum is 0 msec
    Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 172.16.10.1 (Backup Designated Router)
    Suppress hello for 0 neighbor(s)
  
  从特定输出,您知道网络类型 为以太网0个接口是广播。了解更多关于什么 show ip ospf interface 命令显示,提到 什么执行show ip ospf interface命令显示?
  
  同样地,输出为 show命令在 Router2如下所示。
  Router2#show ip ospf neighbor
     Neighbor ID  Pri    State    Dead Time    Address    Interface
     192.168.45.1  1    FULL/DR    00:00:31   10.10.10.1    Ethernet0
  
  
  从上述输出,您知道Router1是指定路由器(DR)在此广播网络。
  Router2#show ip ospf interface ethernet 0
     Ethernet0 is up, line protocol is up
     Internet Address 10.10.10.2/24, Area 0
     Process ID 1, Router ID 172.16.10.1, Network Type BROADCAST, Cost: 10
     Transmit Delay is 1 sec, State BDR, Priority 1
     Designated Router (ID) 192.168.45.1, Interface address 10.10.10.1
     Backup Designated router (ID) 172.16.10.1, Interface address 10.10.10.2
     Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
     Hello due in 00:00:00
     Index 1/1, flood queue length 0
     Next 0x0(0)/0x0(0)
     Last flood scan length is 1, maximum is 1
     Last flood scan time is 0 msec, maximum is 0 msec
     Neighbor Count is 1, Adjacent neighbor count is 1
     Adjacent with neighbor 192.168.45.1 (Designated Router)
     Suppress hello for 0 neighbor(s)
  
  排除故障
  此部分提供您能 使用排除您的配置故障的信息。
  
  故障检修命令
  输出解释器工具 支持 某些show命令 (注册的 用户) ,允许您查看show命令输出分析 。
  
  注意: 在发出 debug命令之前,请参阅 重要信息关于Debug命令。
  
  当邻接形成在二个路由器之间 时,有多种状态。您能使用 debug ip ospf adjacency命令发现多种状态并且在 广播OSPF网络发生的DR和BDR选举。 以下输出是从Router1 透视图。粗体部分在输出是邻接进程经历的多种状态。
  Router1#debug ip ospf adjacency OSPF adjacency events debugging is on
  1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FB0 opt 0x42 flag
    0x7 len 32 mtu 1500 state INIT
     1d02h: OSPF: 2 Way Communication to 172.16.10.1 on Ethernet0, state 2WAY
     1d02h: OSPF: Neighbor change Event on interface Ethernet0
     1d02h: OSPF: DR/BDR election on Ethernet0
     1d02h: OSPF: Elect BDR 172.16.10.1
     1d02h: OSPF: Elect DR 192.168.45.1
     1d02h: DR: 192.168.45.1 (Id) BDR: 172.16.10.1 (Id)
     1d02h: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x1FEC opt 0x42 flag
    0x7 len 32
     1d02h: OSPF: First DBD and we are not SLAVE
     1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FEC opt 0x42 flag
    0x2 len 52 mtu 1500 state EXSTART
     1d02h: OSPF: NBR Negotiation Done. We are the MASTER
     1d02h: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x1FED opt 0x42 flag
    0x3 len 52
     1d02h: OSPF: Database request to 172.16.10.1
     1d02h: OSPF: sent LS REQ packet to 10.10.10.2, length 12
     1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FED opt 0x42 flag
    0x0 len 32 mtu 1500 state EXCHANGE
     1d02h: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x1FEE opt 0x42 flag
    0x1 len 32
     1d02h: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1FEE opt 0x42 flag
    0x0 len 32 mtu 1500 state EXCHANGE
     1d02h: OSPF: Exchange Done with 172.16.10.1 on Ethernet0
     1d02h: OSPF: Synchronized with 172.16.10.1 on Ethernet0, state FULL
     1d02h: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.10.1 on Ethernet0 from LOADING
    to FULL, Loading Done
     1d02h: OSPF: Build router LSA for area 0, router ID 192.168.45.1, seq 0x80000041
     1d02h: OSPF: Neighbor change Event on interface Ethernet0
     1d02h: OSPF: DR/BDR election on Ethernet0
     1d02h: OSPF: Elect BDR 172.16.10.1
     1d02h: OSPF: Elect DR 192.168.45.1
     1d02h: DR: 192.168.45.1 (Id) BDR: 172.16.10.1 (Id)
     1d02h: OSPF: Build network LSA for Ethernet0, router ID 192.168.45.1
  
  验证hello计时器值, 用于 debug ip ospf events 命令。 该命令的以下输出如下所示。
  Router1#debug ip ospf events
  OSPF events debugging is on
  Router1#
  21:48:36: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2
  21:48:36: OSPF: End of hello processing
  21:48:46: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2
  21:48:46: OSPF: End of hello processing
  21:48:56: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2
  21:48:56: OSPF: End of hello processing
  
  从以上输出,您能发现hello信息包被交换每10秒。

TOP