动态路由协议- 单区域 OSPF

OSPF(Open Shortest Path First,开放最短链路优先)路由协议是典型的链路状态路由协议。 OSPF 由 IETF 在 20 世纪 80 年代末期开发, OSPF 是 SPF 类路由协议中的开放式版本。最初的 OSPF 规范体现在 RFC1131 中,被称为 OSPF 版本 1,但是版本 1 很快被进行了重大改进的版本所代替,这个新版本体现在 RFC1247 文档中。RFC1247 被称为 OSPF 版本 2,是为了明确指出其在稳定性和功能性方面的实质性改进。这个 OSPF 版本有许多更新文档,每一个更新都是对开放标准的精心改进。接下来的一些规范出现在 RFC1583 和 2328 中。OSPF 版本2 的最新版体现在 RFC 2328 中。而 OSPF 版本 3 是关于 IPv6 的。OSPF 的内容多而复杂,所以本书分了多个章节来介绍。本章只讨论单区域的 OSPF。

8.1 OSPF 概述

OSPF 作为一种内部网关协议(Interior Gateway Protocol,IGP) ,用于在同一个自治系统(AS)中的路由器之间交换路由信息。OSPF 的特性如下:

1. 可适应大规模网络;

2. 收敛速度快;

3. 无路由环路;

4. 支持 VLSM 和 CIDR;

5. 支持等价路由;

6. 支持区域划分, 构成结构化的网络;

7. 提供路由分级管理;

8. 支持简单口令和 MD5 认证;

9. 以组播方式传送协议报文;

10. OSPF 路由协议的管理距离是 110;

11. OSPF 路由协议采用 cost 作为度量标准;

12. OSPF 维护邻居表、拓扑表和路由表。

另外, OSPF 将网络划分为四种类型: 广播多路访问型 (BMA) 、 非广播多路访问型 (NBMA) 、点到点型(Point-to-Point) 、点到多点型(Point-to-MultiPoint) 。不同的二层链路的类型需要 OSPF 不同的网络类型来适应。

下面的几个术语是学习 OSPF 要掌握的:

1. 链路:链路就是路由器用来连接网络的接口;

2. 链路状态:用来描述路由器接口及其与邻居路由器的关系。所有链路状态信息构成

链路状态数据库;

3. 区域:有相同的区域标志的一组路由器和网络的集合。在同一个区域内的路由器有

相同的链路状态数据库;

4. 自治系统: 采用同一种路由协议交换路由信息的路由器及其网络构成一个自治系统;

5. 链路状态通告(LSA) :LSA 用来描述路由器的本地状态,LSA 包括的信息有关于路由器接口的状态和所形成的邻接状态;

6. 最短路经优先 (SPF) 算法: 是 OSPF 路由协议的基础。 SPF 算法有时也被称为 Dijkstra算法,这是因为最短路径优先算法(SPF)是 Dijkstra 发明的。OSPF 路由器利用 SPF,独立地计算出到达任意目的地的最佳路由。

8.2 实验 1:点到点链路上的 OSPF

1.实验目的

通过本实验可以掌握:

(1)在路由器上启动 OSPF 路由进程

(2)启用参与路由协议的接口,并且通告网络及所在的区域

(3)度量值 cost 的计算

(4)hello 相关参数的配置

(5)点到点链路上的 OSPF 的特征

(6)查看和调试 OSPF 路由协议相关信息

2.实验拓扑

本实验的拓扑结构如图 6-1 所示。

ospf有几个版本 ospf的版本_OSPF

3.实验步骤

(1)步骤 1:配置路由器 R1
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.12.0 0.0.0.255 area 0
(2)步骤 2:配置路由器 R2
R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 192.168.12.0 0.0.0.255 area 0
R2(config-router)# network 192.168.23.0 0.0.0.255 area 0
R2(config-router)# network 2.2.2.0 0.0.0.255 area 0
(3)步骤 3:配置路由器 R3
R3(config)# router ospf 1
R3(config-router)# router-id 3.3.3.3
R3(config-router)# network 192.168.23.0 0.0.0.255 area 0
R3(config-router)# network 192.168.34.0 0.0.0.255 area 0
R3(config-router)# network 3.3.3.0 0.0.0.255 area 0
(4)步骤 4:配置路由器 R4
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.34.0 0.0.0.255 area 0

【技术要点 】

(1)OSPF 路由进程 ID 的范围必须在 1-65535 之间,而且只有本地含义,不同路由器的路由进程 ID 可以不同。如果要想启动 OSPF 路由进程,至少确保有一个接口是 up 的;

(2)区域 ID 是在 0-4294967295 内的十进制数,也可以是 IP 地址的格式 A.B.C.D。当网络区域 ID 为 0 或 0.0.0.0 时称为主干区域;

(3)在高版本的 IOS 中通告 OSPF 网络的时候,网络号的后面可以跟网络掩码,也可以跟反掩码,都是可以的;

(4)确定 Router ID 遵循如下顺序:

① 最优先的是在 OSPF 进程中用命令“ router-id”指定了路由器 ID;

② 如果没有在 OSPF 进程中指定路由器 ID,那么选择 IP 地址最大的环回接口的 IP 地址为 Router ID;

③ 如果没有环回接口,就选择最大的活动的物理接口的 IP 地址为 Router ID。

建议用命令“ router-id”来指定路由器 ID,这样可控性比较好。

4.实验调试

(1) show ip route

R2# show 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
C 192.168.12.0/24 is directly connected, Serial0/0/0
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/782] via 192.168.12.1, 00:18:40, Serial0/0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/782] via 192.168.23.3, 00:18:40, Serial0/0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/1563] via 192.168.23.3, 00:18:40, Serial0/0/1
O 3.3.3.3 [110/782] via 192.168.23.3, 00:18:40, Serial0/0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/1563] via 192.168.23.3, 00:18:40, Serial0/0/1
C 192.168.23.0/24 is directly connected, Serial0/0/1
O 192.168.34.0/24 [110/1562] via 192.168.23.3, 00:18:41, Serial0/0/1

输出结果表明同一个区域内通过 OSPF 路由协议学习的路由条目用代码“O O”表示。

【说明 】

① 环回接口 OSPF 路由条目的掩码长度都是 32 位,这是环回接口的特性,尽管通告了24 位,解决的办法是在环回接口下修改网络类型为“ Point-to-Point” ,操作如下:

R2(config)# interface loopback 0

R2(config-if)# ip ospf network point-to-point

这样收到的路由条目的掩码长度和通告的一致。

② 路由条目“ 4.4.4.4”的度量值为 1563,计算过程如下:

cost 的计算公式为 108 /带宽(bps) ,然后取整,而且是所有链路入口的 cost 之和,环回接口的 cost 为 1,路由条目“4.4.4.4”到路由器 R2 经过的入接口包括路由器 R4 的loopback0 , 路 由 器 R3 的 s0/0/0 , 路 由 器 R2 的 s0/0/1 , 所 以 计 算 如 下 :

。也可以直接通过命令“ ip ospf cost”设置接口的 cost值,并且它是优先计算的 cost 值的。

(2) show ip protocols

R2# show ip protocols
Routing Protocol is "ospf 1"
//当前路由器运行的 OSPF 进程 ID
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 2.2.2.2
//本路由器 ID
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
//本路由器参与的区域数量和类型
Maximum path: 4
//支持等价路径最大数目
Routing for Networks:
2.2.2.0 0.0.0.255 area 0
192.168.12.0 0.0.0.255 area 0
192.168.23.0 0.0.0.255 area 0
//以上四行表明 OSPF 通告的网络以及这些网络所在的区域
Reference bandwidth unit is 100 mbps
//参考带宽为
Routing Information Sources:
Gateway Distance Last Update
4.4.4.4 110 00:08:36
3.3.3.3 110 00:08:36
1.1.1.1 110  00:08:36
//以上 5 行表明路由信息源
Distance: (default is 110)
//OSPF 路由协议默认的管理距离

(3) show ip ospf

该命令显示 OSPF 进程及区域的细节,如路由器运行 SPF 算法的次数等。

R2# show ip ospf 1
Routing Process "ospf 1" with ID 2.2.2.2
Start time: 00:50:57.156, Time elapsed: 00:42:41.880
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Area BACKBONE(0)
Number of interfaces in this area is 3 3
Area has no authentication
SPF algorithm last executed 00:15:07.580 ago
SPF algorithm executed 9 times
Area ranges are
Number of LSA 4. Checksum Sum 0x02611A
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0

(4) show ip ospf interface

R2# show ip ospf interface s0/0/0
Serial0/0/0 is up, line protocol is up
Internet Address 192.168.12.2/24, Area 0  //该接口的地址和运行的 OSPF 区域
Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 781
//进程 ID,路由器 ID,网络类型,接口 Cost 值
Transmit Delay is 1 sec, State POINT_TO_POINT  //接口的延迟和状态
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40 //显示几个计时器的值
Hello due in 00:00:05 //距离下次发送 Hello 包的时间
Supports Link-local Signaling (LLS) //支持 LLS
Cisco NSF helper support enabled
IETF NSF helper support enabled
//以上两行表示启用了 IETF 和 Cisco 的 NSF 功能
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 1.1.1.1 //已经建立邻接关系的邻居路由器 ID
Suppress hello for 0 neighbor(s) //没有进行 Hello 抑制

(5) show ip ospf neighbor

R2# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/ - 00:00:35 192.168.23.3 Serial0/0/1
1.1.1.1 0 FULL/ - 00:00:38 192.168.12.1 Serial0/0/0

以上输出表明路由器 R2 有两个邻居,它们的路由器 ID 分别为 1.1.1.1 和 3.3.3.3,其

它参数解释如下:

①  Pri:邻居路由器接口的优先级;

②  State:当前邻居路由器接口的状态;

③  Dead Time:清除邻居关系前等待的最长时间;

④  Address:邻居接口的地址;

⑤  Interface:自己和邻居路由器相连接口;

⑥ “-” : 表示点到点的链路上 OSPF 不进行 DR 选举。

【技术要点 】

OSPF 邻居关系不能建立的常见原因:

① hello 间隔和 dead 间隔不同;

同一链路上的 hello 包间隔和 dead 间隔必须相同才能建立邻接关系。默认情况下,

hello 包发送间隔如表 6-1 所示。

表 6-1 OSPF hello 间隔和 dead 间隔

网络类型

Hello间隔(秒)

Dead间隔(秒)

广播多路访问

10

40

非广播多路访问

30

120

点到点

10

40

点到多点

30

120

默认时 Dead 间隔是 Hello 间隔的四倍。 可以在接口下通过 “ ip ospf hello-interval”

和“ ip ospf dead-interval”命令调整。

② 区域号码不一致;

③ 特殊区域(如stub,nssa等)区域类型不匹配;

④ 认证类型或密码不一致;

⑤ 路由器 ID 相同;

⑥ Hello 包被 ACL deny;

⑦ 链路上的MTU 不匹配;

⑧ 接口下OSPF网络类型不匹配。

(6) show ip ospf database

R2# show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 240 0x80000005 0x00BA35 3
2.2.2.2 2.2.2.2 1308 0x80000008 0x00D7C0 5
3.3.3.3 3.3.3.3 1310 0x80000007 0x00282D 5
4.4.4.4 4.4.4.4 44 0x80000004 0x009AFE 3

以上输出是 R2 的区域 0 的拓扑结构数据库的信息,标题行的解释如下:

① Link ID:是指 Link State ID,代表整个路由器,而不是某个链路;

② ADV Router:是指通告链路状态信息的路由器 ID;

③ Age:老化时间;

④ Seq#:序列号;

⑤ Checksum:校验和;

⑥ Link count:通告路由器在本区域内的链路数目。

8.3 实验 2:广播多路访问链路上的 OSPF

1.实验目的

通过本实验可以掌握:

(1)在路由器上启动 OSPF 路由进程

(2)启用参与路由协议的接口,并且通告网络及所在的区域

(3)修改参考带宽

(4)DR 选举的控制

(5)广播多路访问链路上的 OSPF 的特征

2.实验拓扑本实验的拓扑结构如图 6-2 所示。

ospf有几个版本 ospf的版本_OSPF_02

 

 

 

3.实验步骤

(1)步骤 1:配置路由器 R1

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)# auto-cost reference-bandwidth 1000

(2)步骤 2:配置路由器 R2

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)# auto-cost reference-bandwidth 1000

(3)步骤 3:配置路由器 R3

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.1.0 0.0.0.255 area 0
R3(config-router)# auto-cost reference-bandwidth 1000

(4)步骤 4:配置路由器 R4

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.1.0 0.0.0.255 area 0
R4(config-router)# auto-cost reference-bandwidth 1000

【说明 】

“ auto-cost reference-bandwidth”命令是修改参考带宽的,因为本实验中的以太口的带宽为千兆,如果采用默认的百兆参考带宽,计算出来的 cost 是 0.1,这显然是不合理的。修改参考带宽要在所有的 OSPF 路由器上配置,目的是确保参考标准是相同的。另外,当执行命令“ auto-cost reference-bandwidth”的时候,系统也会提示如下信息:

% OSPF: Reference bandwidth is changed.

Please ensure reference bandwidth is consistent across all routers.

4.实验调试

(1) show ip ospf neighbor

R1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/BDR 00:00:37 192.168.1.2 GigabitEthernet0/0
3.3.3.3 1 FULL/DROTHER 00:00:37 192.168.1.3 GigabitEthernet0/0
4.4.4.4 1 FULL/DROTHER 00:00:34 192.168.1.4 GigabitEthernet0/0

以上输出表明在该广播多路访问网络中,R1 是 DR,R2 是 BDR,R3 和 R4 为 DROTHER。

【技术要点 】

(1)为了避免路由器之间建立完全邻接关系而引起的大量开销,OSPF 要求在多路访问的网络中选举一个 DR, 每个路由器都与之建立邻接关系。 选举 DR 的同时也选举出一个 BDR,在 DR 失效的时候,BDR 担负起 DR 的职责,而且所有其它路由器只与 DR 和 BDR 建立邻接关系;

(2)DR 和 BDR 有它们自己的组播地址 224.0.0.6;

(3)DR 和 BDR 的选举是以各个网络为基础的,也就是说 DR 和 BDR 选举是一个路由器的接口特性,而不是整个路由器的特性;

(4)DR 选举的原则:

① 首要因素是时间,最先启动的路由器被选举成 DR;

② 如果同时启动,或者重新选举,则看接口优先级(范围为 0-255) ,优先级最高的被选举成 DR,默认情况下,多路访问网络的接口优先级为 1,点到点网络接口优先级为 0,修改接口优先级的命令是“ ip ospf priority” ” ,如果接口的优先级被设置为 0,那么该接口将不参与 DR 选举;

③ 如果前两者相同,最后看路由器 ID,路由器 ID 最高的被选举成 DR;

(5)DR 选举是非抢占的,除非人为地重新选举。重新选举 DR 的方法有两种,一是路由器重新启动,二是执行“ clear ip ospf process”命令。

(2) show ip ospf interface

分别在路由器 R1 和 R4 上执行该命令:

R1# show ip ospf interface g0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec,  State DR, Priority 1 //自己 state 是 DR
Designated Router (ID) 1.1.1.1,  Interface address 192.168.1.1
//DR 的路由器 ID 以及接口地址
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
//BDR 的路由器 ID 以及接口地址
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:09
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 2/2, 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 4 msec
Neighbor Count is 3, Adjacent neighbor count is 3
//R1 是 DR,有 3 个邻居,并且全部形成邻接关系
Adjacent with neighbor 2.2.2.2 ( Backup Designated Router) //R2 是 BDR
Adjacent with neighbor 3.3.3.3
Adjacent with neighbor 4.4.4.4
Suppress hello for 0 neighbor(s)
R4# show ip ospf interface g0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.4/24, Area 0
Process ID 1, Router ID 4.4.4.4, Network Type  BROADCAST, Cost:  10
//网络类型为 BROADCAST
Transmit Delay is 1 sec,  State DROTHER, Priority 1
//自己的 state 是 DROTHER
Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
//DR 的路由器 ID 和接口地址
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
//BDR 的路由器 ID 和接口地址
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 2/2, 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 3, Adjacent neighbor count is 2
//有 3 个邻居,只与 R1 和 R2 形成邻接关系,与 R3 只是邻居关系
Adjacent with neighbor 1.1.1.1 (Designated Router)
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
//上面两行表示与 DR 和 BDR 形成邻接关系
Suppress hello for 0 neighbor(s)

从上面的路由器 R1 和 R4 的输出得知, 邻居关系和邻接关系是不能混为一谈的, 邻居关系是指达到 2WAY 状态的两台路由器,而邻接关系是指达到 FULL 状态的两台路由器。

(3) debug ip ospf adj

该命令显示 OSPF 邻接关系创建或中断的过程。

R2# debug ip ospf adj
OSPF adjacency events debugging is on
R2# clear ip ospf  process
Reset ALL OSPF processes? [no]: y
*Feb 10 10:37:33.447: OSPF: Interface GigabitEthernet0/0 going Down
*Feb 10 10:37:33.447: OSPF: 2.2.2.2 address 192.168.1.2 on GigabitEthernet0/0 is dead, state
DOWN
DOWN
*Feb 10 10:37:33.447: OSPF: Neighbor change Event on interface GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: DR/BDR election on GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: Elect BDR 4.4.4.4
*Feb 10 10:37:33.447: OSPF: Elect DR 1.1.1.1
*Feb 10 10:37:33.447: OSPF: Elect BDR 4.4.4.4
*Feb 10 10:37:33.447: OSPF: Elect DR 1.1.1.1
*Feb 10 10:37:33.447: DR: 1.1.1.1 (Id) BDR: 4.4.4.4 (Id)
*Feb 10 10:37:33.447: OSPF: Reset adjacency with 3.3.3.3 on GigabitEthernet0/0, state 2WAY
*Feb 10 10:37:33.447: OSPF: 1.1.1.1 address 192.168.1.1 on GigabitEthernet0/0 is dead, state
DOWN
*Feb 10 10:37:33.447: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from FULL
to DOWN, Neighbor Down: Interface down or detached
*Feb 10 10:37:33.447: OSPF: Neighbor change Event on interface GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: DR/BDR election on GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: Elect BDR 4.4.4.4
*Feb 10 10:37:33.447: OSPF: Elect DR 4.4.4.4
*Feb 10 10:37:33.447: DR: 4.4.4.4 (Id) BDR: 4.4.4.4 (Id)
*Feb 10 10:37:33.447: OSPF: Remember old DR 1.1.1.1 (id)
*Feb 10 10:37:33.447: OSPF: 3.3.3.3 address 192.168.1.3 on GigabitEthernet0/0 is dead, state
DOWN
*Feb 10 10:37:33.447: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on GigabitEthernet0/0 from 2WAY
to DOWN, Neighbor Down: Interface down or detached
*Feb 10 10:37:33.447: OSPF: Neighbor change Event on interface GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: DR/BDR election on GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: Elect BDR 4.4.4.4
*Feb 10 10:37:33.447: OSPF: Elect DR 4.4.4.4
*Feb 10 10:37:33.447: DR: 4.4.4.4 (Id) BDR: 4.4.4.4 (Id)
*Feb 10 10:37:33.447: OSPF: 4.4.4.4 address 192.168.1.4 on GigabitEthernet0/0 is dead, state
DOWN
*Feb 10 10:37:33.447: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on GigabitEthernet0/0 from FULL
to DOWN, Neighbor Down: Interface down or detached
*Feb 10 10:37:33.447: OSPF: Neighbor change Event on interface GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: DR/BDR election on GigabitEthernet0/0
*Feb 10 10:37:33.447: OSPF: Elect BDR 0.0.0.0
*Feb 10 10:37:33.447: OSPF: Elect DR 0.0.0.0
*Feb 10 10:37:33.447: DR: none BDR: none
*Feb 10 10:37:33.447: OSPF: Remember old DR 4.4.4.4 (id)
*Feb 10 10:37:33.447: OSPF: Interface Loopback0 going Down
*Feb 10 10:37:33.447: OSPF: 2.2.2.2 address 2.2.2.2 on Loopback0 is dead, state DOWN
*Feb 10 10:37:33.459: OSPF: Interface GigabitEthernet0/0 going Up
*Feb 10 10:37:33.459: OSPF: Interface Loopback0 going Up
*Feb 10 10:37:33.459: OSPF:  2 Way Communication to 1.1.1.1 on GigabitEthernet0/0, state 2WAY
*Feb 10 10:37:33.459: OSPF: 2 Way Communication to 3.3.3.3 on GigabitEthernet0/0, state 2WAY
*Feb 10 10:37:33.459: OSPF: 2 Way Communication to 4.4.4.4 on GigabitEthernet0/0, state 2WAY
*Feb 10 10:37:33.459: OSPF: Backup seen Event before WAIT timer on GigabitEthernet0/0
*Feb 10 10:37:33.459: OSPF: DR/BDR election on GigabitEthernet0/0
*Feb 10 10:37:33.459: OSPF: Elect BDR 4.4.4.4
*Feb 10 10:37:33.459: OSPF: Elect DR 1.1.1.1
*Feb 10 10:37:33.459: DR: 1.1.1.1 (Id) BDR: 4.4.4.4 (Id)
*Feb 10 10:37:33.459: OSPF: Send DBD to 1.1.1.1 on GigabitEthernet0/0 seq 0xC87 opt 0x52 flag
0x7 len 32
*Feb 10 10:37:33.459: OSPF: Send DBD to 4.4.4.4 on GigabitEthernet0/0 seq 0x1B1C opt 0x52
flag 0x7 len 32
*Feb 10 10:37:33.463: OSPF: Rcv DBD from 1.1.1.1 on GigabitEthernet0/0 seq 0x1A0 opt 0x52
flag 0x7 len 32 mtu 1500 state  EXSTART
*Feb 10 10:37:33.463: OSPF: First DBD and we are not SLAVE
*Feb 10 10:37:33.463: OSPF: Rcv DBD from 1.1.1.1 on GigabitEthernet0/0 seq 0xC87 opt 0x52
flag 0x2 len 112 mtu 1500 state EXSTART
*Feb 10 10:37:33.463: OSPF: NBR Negotiation Done. We are the MASTER
*Feb 10 10:37:33.463: OSPF: Send DBD to 1.1.1.1 on GigabitEthernet0/0 seq 0xC88 opt 0x52 flag
0x1 len 32
*Feb 10 10:37:33.463: OSPF: Rcv DBD from 4.4.4.4 on GigabitEthernet0/0 seq 0x13C0 opt 0x52
flag 0x7 len 32 mtu 1500 state EXSTART
*Feb 10 10:37:33.463: OSPF: NBR Negotiation Done. We are the SLAVE
*Feb 10 10:37:33.463: OSPF: Send DBD to 4.4.4.4 on GigabitEthernet0/0 seq 0x13C0 opt 0x52
flag 0x0 len 32
*Feb 10 10:37:33.463: OSPF: Rcv DBD from 1.1.1.1 on GigabitEthernet0/0 seq 0xC88 opt 0x52
flag 0x0 len 32 mtu 1500 state  EXCHANGE
*Feb 10 10:37:33.463: OSPF: Exchange Done with 1.1.1.1 on GigabitEthernet0/0
*Feb 10 10:37:33.463: OSPF: Send LS REQ to 1.1.1.1 length 48 LSA count 4
*Feb 10 10:37:33.463: OSPF: Rcv DBD from 4.4.4.4 on GigabitEthernet0/0 seq 0x13C1 opt 0x52
flag 0x3 len 112 mtu 1500 state EXCHANGE
*Feb 10 10:37:33.463: OSPF: Send DBD to 4.4.4.4 on GigabitEthernet0/0 seq 0x13C1 opt 0x52
flag 0x0 len 32
*Feb 10 10:37:33.463: OSPF: Rcv LS UPD from 1.1.1.1 on GigabitEthernet0/0 length 212 LSA count
4
*Feb 10 10:37:33.467: OSPF: Synchronized with 1.1.1.1 on GigabitEthernet0/0, state FULL
*Feb 10 10:37:33.467: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from
LOADING to  FULL, Loading Done
*Feb 10 10:37:33.467: OSPF: Rcv DBD from 4.4.4.4 on GigabitEthernet0/0 seq 0x13C2 opt 0x52
flag 0x1 len 32 mtu 1500 state EXCHANGE
*Feb 10 10:37:33.467: OSPF: Exchange Done with 4.4.4.4 on GigabitEthernet0/0
*Feb 10 10:37:33.467: OSPF: Synchronized with 4.4.4.4 on GigabitEthernet0/0, state  FULL
*Feb 10 10:37:33.467: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on GigabitEthernet0/0 from
LOADING to FULL, Loading Done
*Feb 10 10:37:33.467: OSPF: Send DBD to 4.4.4.4 on GigabitEthernet0/0 seq 0x13C2 opt 0x52
flag 0x0 len 32
*Feb 10 10:37:33.947: OSPF: Build router LSA for area 0, router ID 2.2.2.2, seq 0x80000001,
process 1
*Feb 10 10:37:38.155: OSPF: Rcv LS UPD from 4.4.4.4 on GigabitEthernet0/0 length 76 LSA count
1
*Feb 10 10:37:38.443: OSPF: Rcv LS UPD from 1.1.1.1 on GigabitEthernet0/0 length 76 LSA count
1
*Feb 10 10:37:38.595: OSPF: Rcv LS UPD from 4.4.4.4 on GigabitEthernet0/0 length 76 LSA count
1
*Feb 10 10:37:38.635: OSPF: Rcv LS UPD from 1.1.1.1 on GigabitEthernet0/0 length 76 LSA count
1
*Feb 10 10:37:43.155: OSPF: Build router LSA for area 0, router ID 2.2.2.2, seq 0x80000005,
process 1
*Feb 10 10:37:43.155: OSPF: Rcv LS UPD from 1.1.1.1 on GigabitEthernet0/0 length 76 LSA count
1

以上的输出表明:

① DR 重新选举的过程和结果,新的 DR 是 R1,BDR 是 R4;

② 在 OSPF 邻接关系建立的过程中,接口的状态的变化包括 DOWN、2 Way、EXSTART、EXCHANGE、Loading 和 FULL。