调试OSPF邻接信息
显示,发送认证密钥的情况(每隔10S,hello包),如果(收到的数据包)密钥不匹配 ,会提示;没有配置认证的话,无输出。
显示邻接关系的建立过程。
R1#debug ip ospf adj
OSPF adjacency events debugging is on
R1#
邻接关系建立好的情况(配置认证的情况)
*Mar 1 01:36:32.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:36:42.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:36:52.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:37:02.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:37:12.367: OSPF: Send with youngest Key 1
R1#//将R2的认证密钥删除后,提示不匹配。
*Mar 1 01:37:14.471: OSPF: Rcv pkt from 12.1.1.2, FastEthernet0/0 : Mismatch Authentication Key - No message digest key 0 on interface
R1#
*Mar 1 01:37:22.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:37:24.463: OSPF: Rcv pkt from 12.1.1.2, FastEthernet0/0 : Mismatch Authentication Key - No message digest key 0 on interface
R1#
*Mar 1 01:37:32.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:37:34.447: OSPF: Rcv pkt from 12.1.1.2, FastEthernet0/0 : Mismatch Authentication Key - No message digest key 0 on interface
R1#
*Mar 1 01:37:42.367: OSPF: Send with youngest Key 1
R1#//dead定时器过后,邻接关系断开,重新选举DR,建立路由器LSA,显示没有任何邻居。。
*Mar 1 01:37:44.479: OSPF: Rcv pkt from 12.1.1.2, FastEthernet0/0 : Mismatch Authentication Key - No message digest key 0 on interface
*Mar 1 01:37:44.483: OSPF: 22.2.2.2 address 12.1.1.2 on FastEthernet0/0 is dead
*Mar 1 01:37:44.487: OSPF: 22.2.2.2 address 12.1.1.2 on FastEthernet0/0 is dead, state DOWN
*Mar 1 01:37:44.491: %OSPF-5-ADJCHG: Process 1, Nbr 22.2.2.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
*Mar 1 01:37:44.495: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 01:37:44.495: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 01:37:44.499: OSPF: Elect BDR 1.1.1.1
*Mar 1 01:37:44.499: OSPF: Elect DR 1.1.1.1
*Mar 1 01:37:44.503: OSPF: Elect BDR 0.0.0.0
*Mar 1 01:37:44.503: OSPF: Elect DR 1.1.1.1
*Mar 1 01:37:44.507: DR: 1.1.1.1 (Id) BDR: none
*Mar 1 01:37:44.507: OSPF: Remember old DR 22.2.2.2 (id) //有没有特殊意义?
*Mar 1 01:37:44.995: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x8000000D
*Mar 1 01:37:45.007: OSPF: No full nbrs to build Net Lsa for interface FastEthernet0/0
R1#
R1#
R1#
*Mar 1 01:37:52.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:37:54.463: OSPF: Rcv pkt from 12.1.1.2, FastEthernet0/0 : Mismatch Authentication Key - No message digest key 0 on interface
R1#
*Mar 1 01:38:02.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:38:04.463: OSPF: Rcv pkt from 12.1.1.2, FastEthernet0/0 : Mismatch Authentication Key - No message digest key 0 on interface
R1#
*Mar 1 01:38:12.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:38:14.463: OSPF: Rcv pkt from 12.1.1.2, FastEthernet0/0 : Mismatch Authentication Key - No message digest key 0 on interface
R1#
R1#
R1#//配置R2的认证密钥,密钥匹配开始建立邻居关系
*Mar 1 01:38:22.367: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.391: OSPF: 2 Way Communication to 22.2.2.2 on FastEthernet0/0, state 2WAY
*Mar 1 01:38:22.391: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 01:38:22.395: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 01:38:22.395: OSPF: Elect BDR 0.0.0.0
*Mar 1 01:38:22.399: OSPF: Elect DR 22.2.2.2
*Mar 1 01:38:22.399: OSPF: Elect BDR 1.1.1.1
*Mar 1 01:38:22.403: OSPF: Elect DR 22.2.2.2
*Mar 1 01:38:22.403: DR: 22.2.2.2 (Id) BDR: 1.1.1.1 (Id)
*Mar 1 01:38:22.407: OSPF: Send DBD to 22.2.2.2 on FastEthernet0/0 seq 0xF36 opt 0x52 flag 0x7 len 32
*Mar 1 01:38:22.411: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.415: OSPF: Set FastEthernet0/0 flush timer
*Mar 1 01:38:22.415: OSPF: Remember old DR 1.1.1.1 (id)
*Mar 1 01:38:22.415: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 01:38:22.415: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 01:38:22.419: OSPF: Elect BDR 1.1.1.1
*Mar 1 01:38:22.419: OSPF: Elect DR 22.2.2.2
*Mar 1 01:38:22.423: DR: 22.2.2.2 (Id) BDR: 1.1.1.1 (Id)
*Mar 1 01:38:22.423: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.451: OSPF: Rcv DBD from 22.2.2.2 on FastEthernet0/0 seq 0x201 opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 01:38:22.455: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar 1 01:38:22.459: OSPF: Send DBD to 22.2.2.2 on FastEthernet0/0 seq 0x201 opt 0x52 flag 0x2 len 232
*Mar 1 01:38:22.463: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.483: OSPF: Rcv DBD from 22.2.2.2 on FastEthernet0/0 seq 0x202 opt 0x52 flag 0x3 len 212 mtu 1500 state EXCHANGE
*Mar 1 01:38:22.487: OSPF: Send DBD to 22.2.2.2 on FastEthernet0/0 seq 0x202 opt 0x52 flag 0x0 len 32
*Mar 1 01:38:22.491: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.519: OSPF: Rcv DBD from 22.2.2.2 on FastEthernet0/0 seq 0x203 opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE
*Mar 1 01:38:22.523: OSPF: Exchange Done with 22.2.2.2 on FastEthernet0/0
*Mar 1 01:38:22.523: OSPF: Send LS REQ to 22.2.2.2 length 12 LSA count 1
*Mar 1 01:38:22.523: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.523: OSPF: Send DBD to 22.2.2.2 on FastEthernet0/0 seq 0x203 opt 0x52 flag 0x0 len 32
*Mar 1 01:38:22.523: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.523: OSPF: Rcv LS REQ from 22.2.2.2 on FastEthernet0/0 length 48 LSA count 2
*Mar 1 01:38:22.523: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.523: OSPF: Send UPD to 12.1.1.2 on FastEthernet0/0 length 96 LSA count 2
*Mar 1 01:38:22.543: OSPF: Rcv LS UPD from 22.2.2.2 on FastEthernet0/0 length 88 LSA count 1
*Mar 1 01:38:22.547: OSPF: Synchronized with 22.2.2.2 on FastEthernet0/0, state FULL
*Mar 1 01:38:22.551: %OSPF-5-ADJCHG: Process 1, Nbr 22.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
*Mar 1 01:38:22.575: OSPF: Rcv LS UPD from 22.2.2.2 on FastEthernet0/0 length 60 LSA count 1
*Mar 1 01:38:22.915: OSPF: Reset old DR on FastEthernet0/0
*Mar 1 01:38:22.915: OSPF: Send with youngest Key 1
*Mar 1 01:38:22.919: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x8000000E
*Mar 1 01:38:22.923: OSPF: Rcv LS UPD from 22.2.2.2 on FastEthernet0/0 length 88 LSA count 1
*Mar 1 01:38:24.443: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 01:38:24.447: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 01:38:24.447: OSPF: Elect BDR 1.1.1.1
*Mar 1 01:38:24.451: OSPF: Elect DR 22.2.2.2
*Mar 1 01:38:24.451: DR: 22.2.2.2 (Id) BDR: 1.1.1.1 (Id)
*Mar 1 01:38:25.055: OSPF: Send with youngest Key 1
*Mar 1 01:38:27.579: OSPF: Rcv LS UPD from 22.2.2.2 on FastEthernet0/0 length 60 LSA count 1
R1#
R1#//重新恢复正常。
*Mar 1 01:38:30.083: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:38:32.367: OSPF: Send with youngest Key 1
R1#
*Mar 1 01:38:42.367: OSPF: Send with youngest Key 1
R1#
R1#
没有配置认证的输出(将R2上,R1-R2之间的端口断开)。
R1#debug ip ospf adj
OSPF adjacency events debugging is on
R1#
R1#
R1#
R1#
R1#
R1#
*Mar 1 02:06:35.979: OSPF: 22.2.2.2 address 12.1.1.2 on FastEthernet0/0 is dead
*Mar 1 02:06:35.979: OSPF: 22.2.2.2 address 12.1.1.2 on FastEthernet0/0 is dead, state DOWN
*Mar 1 02:06:35.983: %OSPF-5-ADJCHG: Process 1, Nbr 22.2.2.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
R1#
*Mar 1 02:06:35.987: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 02:06:35.991: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 02:06:35.991: OSPF: Elect BDR 1.1.1.1
*Mar 1 02:06:35.995: OSPF: Elect DR 1.1.1.1
*Mar 1 02:06:35.995: OSPF: Elect BDR 0.0.0.0
*Mar 1 02:06:35.999: OSPF: Elect DR 1.1.1.1
*Mar 1 02:06:35.999: DR: 1.1.1.1 (Id) BDR: none
*Mar 1 02:06:36.003: OSPF: Remember old DR 22.2.2.2 (id)
*Mar 1 02:06:36.487: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x80000011
*Mar 1 02:06:36.503: OSPF: No full nbrs to build Net Lsa for interface FastEthernet0/0
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#
R1#
*Mar 1 02:07:18.059: OSPF: Rcv DBD from 22.2.2.2 on FastEthernet0/0 seq 0xBF2 opt 0x52 flag 0x7 len 32 mtu 1500 state INIT
*Mar 1 02:07:18.063: OSPF: 2 Way Communication to 22.2.2.2 on FastEthernet0/0, state 2WAY
*Mar 1 02:07:18.067: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 02:07:18.071: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 02:07:18.071: OSPF: Elect BDR 22.2.2.2
*Mar 1 02:07:18.071: OSPF: Elect DR 1.1.1.1
*Mar 1 02:07:18.075: DR: 1.1.1.1 (Id) BDR: 22.2.2.2 (Id)
*Mar 1 02:07:18.079: OSPF: Send DBD to 22.2.2.2 on FastEthernet0/0 seq 0x1F5B opt 0x52 flag 0x7 len 32
*Mar 1 02:07:18.083: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar 1 02:07:18.083: OSPF: Send DBD to 22.2.2.2 on FastEthernet0/0 seq 0xBF2 opt 0x52 flag 0x2 len 232
*Mar 1 02:07:18.103: OSPF: Rcv DBD from 22.2.2.2 on FastEthernet0/0 seq 0xBF3 opt 0x52 flag 0x3 len 212 mtu 1500 state EXCHANGE
*Mar 1 02:07:18.107: OSPF: Send DBD to 22.2.2.2 on FastEtherne
R1#t0/0 seq 0xBF3 opt 0x52 flag 0x0 len 32
*Mar 1 02:07:18.187: OSPF: Rcv DBD from 22.2.2.2 on FastEthernet0/0 seq 0xBF4 opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE
*Mar 1 02:07:18.191: OSPF: Exchange Done with 22.2.2.2 on FastEthernet0/0
*Mar 1 02:07:18.191: OSPF: Send LS REQ to 22.2.2.2 length 12 LSA count 1
*Mar 1 02:07:18.195: OSPF: Send DBD to 22.2.2.2 on FastEthernet0/0 seq 0xBF4 opt 0x52 flag 0x0 len 32
*Mar 1 02:07:18.195: OSPF: Rcv LS REQ from 22.2.2.2 on FastEthernet0/0 length 48 LSA count 2
*Mar 1 02:07:18.195: OSPF: Send UPD to 12.1.1.2 on FastEthernet0/0 length 96 LSA count 2
*Mar 1 02:07:18.219: OSPF: Rcv LS UPD from 22.2.2.2 on FastEthernet0/0 length 88 LSA count 1
*Mar 1 02:07:18.223: OSPF: Synchronized with 22.2.2.2 on FastEthernet0/0, state FULL
*Mar 1 02:07:18.223: %OSPF-5-ADJCHG: Process 1, Nbr 22.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
*Mar 1 02:07:18.231: OSPF: Rcv LS UPD from 22.2.2.2 on FastEthernet0/0 length 60 LSA count 1
*Mar 1 02:07:18.583: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x80000012
*Mar 1 02:07:18.727: OSPF: Build network LSA for FastEthernet0/0, router ID 1.1.1.1
*Mar 1 02:07:18.731: OSPF: Build network LSA for FastEthernet0/0, router ID 1.1.1.1
*Mar 1 02:07:18.747: OSPF: Rcv LS UPD from 22.2.2.2 on FastEthernet0/0 length 88 LSA count 1
R1#
R1#
*Mar 1 02:07:23.003: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 02:07:23.007: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 02:07:23.007: OSPF: Elect BDR 22.2.2.2
*Mar 1 02:07:23.011: OSPF: Elect DR 1.1.1.1
*Mar 1 02:07:23.011: DR: 1.1.1.1 (Id) BDR: 22.2.2.2 (Id)
*Mar 1 02:07:23.015: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 02:07:23.015: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 02:07:23.019: OSPF: Elect BDR 22.2.2.2
*Mar 1 02:07:23.019: OSPF: Elect DR 1.1.1.1
*Mar 1 02:07:23.023: DR: 1.1.1.1 (Id) BDR: 22.2.2.2 (Id)
R1#
R1#
R1#
R1#
这三条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包),如果(收到的数据包)密钥不匹配 ,会提示;
没有配置认证的话,无输出。一般只用这个就可以了。
转载于:https://blog.51cto.com/xueyue8/1610600