監(jiān)測清單11-3監(jiān)測Router們和鄰接關(guān)系的建立 R2(config)#int loop0 R2(config-if)#ip addr 10.1.1.1 255.255.255.0 R2(config-if)#int loop1 R2(config-if)#ip addr 10.1.2.1 255.255.255.0 R2(config-if)#exit R2(config)#logg console R2(config)#no router ospf 100 R2#debug ip ospf adj OSPF adjacency events debugging is on R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 100 R2(config-router)#netw 192@168.1.2 0.0.0.0 area 0 R2(config-router)#^Z R2# 01:05:32: OSPF:Interface Serial1 going UP 01:05:33: OSPF:Build router LSA for area 0,router ID 10.1.2.1,seq 0x80000001 01:05:33: OSPF:2 Way Communication to 192.168.1.1 on Serial1,state 2WAY 01:05:33: OSPF:Send DBD to 192.168.1.1 on Serial1 seq OxIOA opt 0x42 flag 0x7 len 32 ' 01:05:33: OSPF:Rcv DBD from 192.168.1.1 on Serial1 seq Ox23F4 opt 0x42 flag 0x7 len 32 mtu 1500 EXSTART 01:05:33: OSPF: NBR Negotiation Done. We are the SLAVE 01:05:33: OSPF: Send DBD to 192.168.1.1 on Seriall seq Ox23F4 opt 0x42 flag 0x2 len 52 01:05:33: OSPF: Rev DBD from 192.168.1.1 on Seriall seq Ox23F5 opt 0x42 flag 0x3 len 72 mtu 1500 state EXCHANGE 01:05:33: OSPF: Send DBD to 192.168.1.1 on Seriall seq Ox23F5 opt 0x42 flag 0x0 len 32 01:05:33: OSPF: Database request to 192.168.1.1 01:05:33: OSPF: sent LS REQ packet to 192.168.1.1,length 24 01:05:34: OSPF: Rev DBD from 192.168.1.1 on Seriall seq Ox23F6 opt 0x42 flag 0x1 len 32 mtu 1500 state EXCHANGE 01:05:34: OSPF:Exchange Done with 192.168.1.1 on Serial1 01:05:34: OSPF: Send DBD to 192.168.1.1 on Seriall seq Ox23F6 opt 0x42 flag 0x0 len 32 01:05:34: OSPF:Synchronized with 192.168.1.1 on Serial1,state FULL 01:05:34: %OSPF-5-ADJCHG: PRocess 100,Nbr 192.168.1.1 on Serial1 from LOADING to FULL, Loading Done R2# R2#sh ip ospf 100 Routing Process "ospf 100" with ID 10.1.2.1 and Domain ID 0.0.0.100 Supports only single TOS(TOSO) routes Supports opaque LSA ... (此處省略)
R2# Term_Server>1 [Resuming connection 1 to r1 ... ] R1#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 10.1.2.1 1 FULL/- 00:.00:29 192.168.1.2 Serial1 R1#
以下使用debug ip ospf events和debug ip ospf packet命令監(jiān)測OSPF相關(guān)事件和相關(guān)數(shù)據(jù)包的傳輸。 監(jiān)測清單11-4記錄了有關(guān)操作及監(jiān)測結(jié)果。
監(jiān)測清單11-4監(jiān)測OSPF事件和數(shù)據(jù)包 R1(config)#logg console R1(config)#^Z R1#debug ip ospf events OSPF events debuggmg is on R1# 02:08:50: OSPF: Rev hello from 10,1.2.1 area 0 from Serial1 192.168.1.2 02:08:50: OSPF: End of hello processing 02:09:00: OSPF: Rev hello from 10.1.2.1 area 0 from Serial1 192.168.1.2 02:09:00: OSPF: End of hello processing 02:09:10: OSPF: Rcv hello from 10.1.2.1 area 0 from Serial1 192.168.1.2 02:09:10: OSPF: End of hello processing 02:09:20:'OSPF: Rcv hello from 10.1.2.1 area 0 from Serial1 192.168.1.2 02:09:20: OSPF: End of hello processing R1#undebug all All possible debugging has been turned off R1#debug ip ospf packet OSPF packet debugging is on R1# 02:11:40: OSPF: rev. v:21:1 1:48 rid: 10.1.2.1 aid:0.0.0.0.chk:2DF3 aut:0 auk: from Serial1 02:11:50: OSPF: rev. v:21:1 1:48 rid: 10.1.2.1 aid:0.0.0.0 chk:2DF3 aut:0 auk: from Serial 1 02:12:00: OSPF: rev. v:2 t:1 1:48 rid: 10.1.2.1 aid:0.0.0.0 chk:2DF3 aut:0 auk: from Serial 1 02:12:10: OSPF: rev. v:2 t:1 1:48 rid:10.1.2.1 aid:0.0.0.0 ehk:2DF3 aut:0 auk: from Serial 1 02:12:20: OSPF: rev. v:2 t:1 1:48 rid: 10.1.2.1 aid:0.0.0.0 ehk:2DF3 aut:0 auk: from Serial 1 RS#undebug all All possible debugging has been turned off (1)在R1路由器上,首先打開對OSPF事件的Debug,監(jiān)測結(jié)果顯示了接收一系列的Hello包,其源地址是192.168.1.2,即R2的IP地址。 注重到Hello包之間的時間間隔是10秒,這是因為在點到點鏈路中,Hello包每隔10秒發(fā)送一次。 (2)關(guān)閉Debug。然后打開對OSPF包的監(jiān)測,其命令是debug ip ospf packet。 R1路由器監(jiān)測到從R2傳來的一系列的OSPF包,這些包實際上就是每10秒接收1個的Hello包。
第1段:查看接口帶寬與鏈路Cost R2#conft Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 100 R2(config-router)#netw 192.168.1.5 0.0.0.0 area 0 R2(config"router)#^Z R2# R2#sh ip route ospf 172.16.0.0/24 is subnetted, 2 subnets O 172.16.1.0 [110/11] via 192.168.1.1, 00:00:33, Serial1 O 172.16.3.0 [110/11 via 192.168.1.6, 00:00:33, Serial0 R2#sh int s0 Serial0 is up, line protocol is up Hardware is HD64570 Internet address is 192.168.1.5/30 MTU 1500 DLY 20000 usec, reliability 255/255, txioad 1/255, rxioad 1/255 ... (此處刪節(jié)) R2#sh int s1 Serial 1 is up, line protocol is up Hardware is HD64570 Internet address is 192.168.1.2/30 MTU 1500 bytes,BW 1544 Kbit,DLY 20000 usec, reliability 255/255,