R1#//调试ip ospf 数据包。输出的只是收到的包的信息,不涉及发送的包,不涉及其他信息
R1#debug ip ospf packet
OSPF packet debugging is on
R1#//ospf 每隔10秒发送一次hello包
*Mar 1 01:08:04.463: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED412 from FastEthernet0/0
R1#
*Mar 1 01:08:14.467: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED41B from FastEthernet0/0
R1#
*Mar 1 01:08:24.455: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED425 from FastEthernet0/0
R1#
*Mar 1 01:08:34.487: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED42F from FastEthernet0/0
R1#
R1#//此为控制台信息,不开启debug 照样出现。显示邻居关系断开(把R2的认证密钥去掉了)
*Mar 1 01:09:14.491: %OSPF-5-ADJCHG: Process 1, Nbr 22.2.2.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
R1#
R1#
R1#//之后很久没有弹出信息了,把R2的认证密钥加上之后,瞬间弹出弹出好多通信的数据包,借此建立邻接关系。
(发送hello包,进入2 way模式,选取DR,确定主备,发送接收DBD,LS REQ,UPD,同步信息)
*Mar 1 01:10:44.475: OSPF: rcv. v:2 t:1 l:44 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:44.571: OSPF: rcv. v:2 t:2 l:32 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:44.579: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:44.615: OSPF: rcv. v:2 t:2 l:212 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:44.651: OSPF: rcv. v:2 t:2 l:32 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:44.655: OSPF: rcv. v:2 t:3 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:44.679: OSPF: rcv. v:2 t:4 l:88 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
//邻接关系已建立,建立邻居数据库,生成路由表
*Mar 1 01:10:44.687: %OSPF-5-ADJCHG: Process 1, Nbr 22.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
*Mar 1 01:10:44.695: OSPF: rcv. v:2 t:4 l:88 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:44.759: OSPF: rcv. v:2 t:4 l:60 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:45.087: OSPF: rcv. v:2 t:4 l:88 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
*Mar 1 01:10:45.131: OSPF: rcv. v:2 t:4 l:88 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4AE from FastEthernet0/0
R1#
R1#//又开始每隔10秒周期性发送hello包
*Mar 1 01:10:49.735: OSPF: rcv. v:2 t:4 l:60 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4B3 from FastEthernet0/0
R1#
*Mar 1 01:10:54.459: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4B8 from FastEthernet0/0
R1#
*Mar 1 01:11:04.463: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4C1 from FastEthernet0/0
R1#
*Mar 1 01:11:14.475: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4CB from FastEthernet0/0
R1#
*Mar 1 01:11:24.475: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4D5 from FastEthernet0/0
R1#
*Mar 1 01:11:34.475: OSPF: rcv. v:2 t:1 l:48 rid:22.2.2.2
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x3C7ED4DF from FastEthernet0/0
这三条debug命令区别
debug ip ospf packet
调试ip ospf 数据包。输出的只是收到的包的信息,不涉及发送的包,只列出包头的各字段,并没有解读,不涉及其他信息,一般不用打开。
debug ip ospf events
调试ospf事件,显示发送,接受hello(已解读),邻居改变事件,DR选取,
显示建立邻接关系的过程,比debug ip ospf adj,多了显示 发送接收hello数据包
debug ip ospf adj
调试OSPF邻接信息
显示邻接关系的建立过程。比debug ip ospf events 更加简洁,只显示邻接建立。
显示,发送认证密钥的情况(每隔10S,hello包),如果(收到的数据包)密钥不匹配 ,会提示;
没有配置认证的话,无输出。一般只用这个就可以了。
此为本人总结,如有错误,请指正