拓扑图如下所示:
R1 L0 1.1.1.1/32 F1/0 10.1.1.1/30
R2 L0 1.1.1.2/32 F1/0 10.1.1.2/30
在两台路由器上开启OSPF进程,配置如下:
R1(config)#router ospf 10
R1(config-router)#network 0.0.0.0 255.255.255.255 area 10
R2(config)#router ospf 10
R2(config-router)#network 0.0.0.0 255.255.255.255 area 10
在R1上开启debug ip ospf event :
R1(config)#
00:11:45: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:F598 aut:0 auk: from FastEthernet1/0
00:11:45: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:11:45: OSPF: 2 Way Communication to 2.2.2.2 on FastEthernet1/0, state 2WAY
00:11:45: OSPF: End of hello processing
// 收到HELLO报文
00:11:55: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:F598 aut:0 auk: from FastEthernet1/0
00:11:55: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:11:55: OSPF: End of hello processing
// 10s第二次HELLO报文收到
00:12:05: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:F598 aut:0 auk: from FastEthernet1/0
00:12:05: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:12:05: OSPF: End of hello processing
// 20s第三次HELLO报文发出
00:12:15: OSPF: rcv. v:2 t:2 l:32 rid:2.2.2.2
aid:0.0.0.0 chk:97BE aut:0 auk: from FastEthernet1/0
00:12:15: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet1/0 seq 0x1A38 opt 0x42 flag 0x7 len 32 mtu 1500 state 2WAY
00:12:15: OSPF: Nbr state is 2WAY
00:12:15: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:DF93 aut:0 auk: from FastEthernet1/0
00:12:15: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:12:15: OSPF: End of hello processing
// 30s再次收到HELLO报文,同时2-WAY完成
00:12:20: OSPF: rcv. v:2 t:2 l:32 rid:2.2.2.2
aid:0.0.0.0 chk:97BE aut:0 auk: from FastEthernet1/0
00:12:20: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet1/0 seq 0x1A38 opt 0x42 flag 0x7 len 32 mtu 1500 state 2WAY
00:12:20: OSPF: Nbr state is 2WAY
// 38s时2-WAY完成,准备DR、BDR选举
00:12:23: OSPF: end of Wait on interface FastEthernet1/0
00:12:23: OSPF: DR/BDR election on FastEthernet1/0
00:12:23: OSPF: Elect BDR 1.1.1.1
00:12:23: OSPF: Elect DR 2.2.2.2
00:12:23: OSPF: Elect BDR 1.1.1.1
00:12:23: OSPF: Elect DR 2.2.2.2
00:12:23: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id)
00:12:23: OSPF: Send DBD to 2.2.2.2 on FastEthernet1/0 seq 0x1A4 opt 0x42 flag 0x7 len 32
// 40sDR、BDR选举完成,迅速进入EXSTART状态协调主从;然后立刻进入EXCHANGE状态,比较数据库内容。
00:12:25: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:DF93 aut:0 auk: from FastEthernet1/0
00:12:25: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:12:25: OSPF: Neighbor change Event on interface FastEthernet1/0
00:12:25: OSPF: DR/BDR election on FastEthernet1/0
00:12:25: OSPF: Elect BDR 1.1.1.1
00:12:25: OSPF: Elect DR 2.2.2.2
00:12:25: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id)
00:12:25: OSPF: End of hello processing
00:12:25: OSPF: rcv. v:2 t:2 l:32 rid:2.2.2.2
aid:0.0.0.0 chk:97BE aut:0 auk: from FastEthernet1/0
00:12:25: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet1/0 seq 0x1A38 opt 0x42 flag 0x7 len 32 mtu 1500 state EXSTART
00:12:25: OSPF: NBR Negotiation Done. We are the SLAVE
00:12:25: OSPF: Send DBD to 2.2.2.2 on FastEthernet1/0 seq 0x1A38 opt 0x42 flag 0x2 len 52
00:12:25: OSPF: rcv. v:2 t:2 l:52 rid:2.2.2.2
aid:0.0.0.0 chk:200F aut:0 auk: from FastEthernet1/0
00:12:25: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet1/0 seq 0x1A39 opt 0x42 flag 0x3 len 52 mtu 1500 state EXCHANGE
00:12:25: OSPF: Send DBD to 2.2.2.2 on FastEthernet1/0 seq 0x1A39 opt 0x42 flag 0x0 len 32
00:12:25: OSPF: Database request to 2.2.2.2
00:12:25: OSPF: sent LS REQ packet to 10.1.1.2, length 12
00:12:25: OSPF: rcv. v:2 t:3 l:36 rid:2.2.2.2
aid:0.0.0.0 chk:F5CF aut:0 auk: from FastEthernet1/0
00:12:25: OSPF: rcv. v:2 t:2 l:32 rid:2.2.2.2
aid:0.0.0.0 chk:97C2 aut:0 auk: from FastEthernet1/0
00:12:26: OSPF: Rcv DBD from 2.2.2.2 on FastEthernet1/0 seq 0x1A3A opt 0x42 flag 0x1 len 32 mtu 1500 state EXCHANGE
00:12:26: OSPF: Exchange Done with 2.2.2.2 on FastEthernet1/0
00:12:26: OSPF: Send DBD to 2.2.2.2 on FastEthernet1/0 seq 0x1A3A opt 0x42 flag 0x0 len 32
00:12:26: OSPF: rcv. v:2 t:4 l:76 rid:2.2.2.2
aid:0.0.0.0 chk:6D05 aut:0 auk: from FastEthernet1/0
00:12:26: OSPF: Synchronized with 2.2.2.2 on FastEthernet1/0, state FULL
00:12:26: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on FastEthernet1/0 from LOADING to FULL, Loading Done
00:12:26: OSPF: rcv. v:2 t:4 l:108 rid:2.2.2.2
aid:0.0.0.0 chk:E799 aut:0 auk: from FastEthernet1/0
00:12:28: OSPF: rcv. v:2 t:5 l:44 rid:2.2.2.2
aid:0.0.0.0 chk:5C55 aut:0 auk: from FastEthernet1/0
00:12:31: OSPF: rcv. v:2 t:4 l:76 rid:2.2.2.2
aid:0.0.0.0 chk:B8E6 aut:0 auk: from FastEthernet1/0
00:12:33: OSPF: rcv. v:2 t:5 l:44 rid:2.2.2.2
aid:0.0.0.0 chk:CC1A aut:0 auk: from FastEthernet1/0
00:12:35: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:DF93 aut:0 auk: from FastEthernet1/0
00:12:35: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:12:35: OSPF: End of hello processing
00:12:45: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:DF93 aut:0 auk: from FastEthernet1/0
00:12:45: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:12:45: OSPF: End of hello processing
00:12:55: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.2
aid:0.0.0.0 chk:DF93 aut:0 auk: from FastEthernet1/0
00:12:55: OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet1/0 10.1.1.2
00:12:55: OSPF: End of hello processing
RA(config)#end
RA#unde
00:12:59: %SYS-5-CONFIG_I: Configured from console by consolebug all
All possible debugging has been turned off
RA#