监测清单11-3监测Router们和邻接关系的建立 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命令监测OSPF相关事件和相关数据包的传输。 监测清单11-4记录了有关操作及监测结果。
监测清单11-4监测OSPF事件和数据包 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,监测结果显示了接收一系列的Hello包,其源地址是192.168.1.2,即R2的IP地址。 注重到Hello包之间的时间间隔是10秒,这是因为在点到点链路中,Hello包每隔10秒发送一次。 (2)关闭Debug。然后打开对OSPF包的监测,其命令是debug ip ospf packet。 R1路由器监测到从R2传来的一系列的OSPF包,这些包实际上就是每10秒接收1个的Hello包。
第3部分:调整带宽参数更改cost值
路由器接口的带宽参数对链路cost有直接的影响。 监测清单11-5是有关操作及监测结果的记录。
监测清单11-5更改带宽参数以影响cost值
让我们用实验来进行演示。
第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 ... (此处删节) 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,