R1#debug ip ospf adj
*Sep 23 19:35:38.739: OSPF: Interface FastEthernet0/0 going Down
*Sep 23 19:35:38.739: OSPF: 1.1.1 .1 address 192.168.10.1 . FastEthernet0/0 is dead, state DOWN
*Sep 23 19:35:38.739: OSPF: Neighbor change Event . interface FastEthernet0/0
*Sep 23 19:35:38.739: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:38.739: OSPF: Elect BDR 0.0.0 .0
*Sep 23 19:35:38.739: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:38.739: OSPF: Elect BDR 0.0.0 .0
*Sep 23 19:35:38.743: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:38.743: DR: 192.168.235.1 (Id) BDR: none
*Sep 23 19:35:38.743: OSPF: 192.168.235.1 address 192.168.10.2 . FastEthernet0/0 is dead, state DOWN
*Sep 23 19:47:40.403: OSPF: Cannot see ourself in hello from 192.168.235.1 . FastEthernet0/0, state INIT
*Sep 23 19:35:38.743: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.235.1 . FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Sep 23 19:35:38.747: OSPF: Neighbor change Event . interface FastEthernet0/0
*Sep 23 19:35:38.747: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:38.747: OSPF: Elect BDR 0.0.0 .0
*Sep 23 19:35:38.747: OSPF: Elect DR 0.0.0 .0
*Sep 23 19:35:38.747: DR: none BDR: none
*Sep 23 19:35:38.747: OSPF: Remember old DR 192.168.235.1 (id)
*Sep 23 19:35:38.819: OSPF: Interface FastEthernet0/0 going Up
*Sep 23 19:35:38.819: OSPF: i_up : interface is down
*Sep 23 19:35:39.243: OSPF: Build router LSA for area 0, router ID 1.1.1 .1, seq 0x80000001
*Sep 23 19:35:47.459: OSPF: 2 Way Communication to 192.168.235.1 . FastEthernet0/0, state 2WAY
*Sep 23 19:35:47.459: OSPF: Backup seen Event before WAIT timer . FastEthernet0/0
*Sep 23 19:35:47.459: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:47.459: OSPF: Elect BDR 1.1.1 .1
*Sep 23 19:35:47.463: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:47.463: OSPF: Elect BDR 1.1.1 .1
*Sep 23 19:35:47.463: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:47.463: DR: 192.168.235.1 (Id) BDR: 1.1.1 .1 (Id)
*Sep 23 19:35:47.463: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x727 opt 0x52 flag 0x7 len 32
*Sep 23 19:35:47.535: OSPF: Rcv DBD from 192.168.235.1 . FastEthernet0/0 seq 0x1921 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Sep 23 19:35:47.535: OSPF: NBR Negotiation Done. We are the SLAVE
*Sep 23 19:35:47.535: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x1921 opt 0x52 flag 0x2 len 52
*Sep 23 19:35:47.583: OSPF: Rcv DBD from 192.168.235.1 . FastEthernet0/0 seq 0x1922 opt 0x52 flag 0x3 len 52 mtu 1500 state EXCHANGE
*Sep 23 19:35:47.583: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x1922 opt 0x52 flag 0x0 len 32
*Sep 23 19:35:47.587: OSPF: Database request to 192.168.235.1
*Sep 23 19:35:47.587: OSPF: sent LS REQ packet to 192.168.10.2, length 12
*Sep 23 19:35:47.607: OSPF: Rcv DBD from 192.168.235.1 . FastEthernet0/0 seq 0x1923 opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE
*Sep 23 19:35:47.607: OSPF: Exchange Done with 192.168.235.1 . FastEthernet0/0
*Sep 23 19:35:47.607: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x1923 opt 0x52 flag 0x0 len 32
*Sep 23 19:35:47.611: OSPF: Synchronized with 192.168.235.1 . FastEthernet0/0, state FULL
*Sep 23 19:35:47.611: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.235.1 . FastEthernet0/0 from LOADING to FULL, Loading Done
向
DR
返回
LS Acknowlege
报文,
LSDB
达到同步。
Full
状态
*Sep 23 19:35:47.967: OSPF: Build router LSA for area 0, router ID 1.1.1 .1, seq 0x80000002
*Sep 23 19:35:53.347: OSPF: Build router LSA for area 0, router ID 1.1.1 .1, seq 0x80000005
*Sep 23 19:35:57.419: OSPF: Neighbor change Event . interface FastEthernet0/0
*Sep 23 19:35:57.419: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:57.419: OSPF: Elect BDR 1.1.1 .1
*Sep 23 19:35:57.419: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:57.419: DR: 192.168.235.1 (Id) BDR: 1.1.1 .1 (Id)
如果是在
DR
上重启
OSPF
进程的话,也大致相同,只是原来
DR
的位置会被
BDR
顶替上。
其实从进程开始重启后,马上已经开始了一轮
DR
竞选。状态为
Down
在hello
包里未发现自己的router-id
,所以状态变为 INIT
重启
ospf
进程后,当路由器启动进程后,首先发送
hello
报文,构建一个空包
BDR
和
DR
的竞选(
BDR
和
DR
的地址都是全
0
),并构建一个
wait timer
,在这时间内如果没有收到域内
DR/BDR
的通告,就会发出通告说自己要参加竞选啦。这里的结果是收到了
DR
的通告(
router-id
:
192.168.235.1
是老的
DR
),而并没
BDR
。
下一步,当与邻居发生邻接关系后(
state :2WAY
),
发起自己的竞选通告
!
前面指出,
DR
有了,
BDR
还没人当呢,所以
hello
报文里
BDR
部分就把自己的
R-ID
填上了。最后竞选成功,当了
BDR
。
接下来进入
EXSTART
状态。通过互相发送
DBD
报文,协商参数,决定了自己是从路由器身份。