2 配置和查看 OSPF协议( 二 )


Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is-: 1,Adjacent neighbor count is 1
Adjacent with neighbor 192.168.1.6
Suppress hello for 0 neighbor(s)
R2#sh ip ospf database
 OSPF Router with ID (192.168.1.5) (Process ID 100)
 Router Link States(Area 0)
Link ID ADV Router Age Seq# Checksum Link count
192.168.1.1 192.168.1.1832 0x800000050xF6B8 3
192.168.1.5 192.168,1.5820 0x800000060xF6B8 4
192.168.1.6 192.168.1.6806 0x800000050xF6B8 3
R2#
Term_Server>1
[Resuming connection 1 to r1 ... ]
R1#sh ip ospf neighbor
Neighbor IDPri State Dead TimeAddressInterface
192.168.1.51FULL/- 00:00:36192.168.1.2Serial1
R1#
Term_Server>3
[Resuming connection 3 to r3...]
R3#sh ip ospf neighbor
Neighbor IDPri StateDead TimeAddress Interface
192.168.1.51FULL/-00:00:35192.168.1.5 Serial0
R3#sh ip route ospf
172.16.0.0/24 is subnetted,2 subnets
O 172.16.1.0[110/138]via 192.168.1.5,00:12:12,Serial0
192.168.1.0/30 is subnetted,2 subnets
O 192.168.1.0[110/128]via 192.168.1.5,00:12:12,Serial0
R3#sh ip route 172.16.1.0
Routing entry for 172.16.1./24
Known via"ospf 100",distance 110,metric 138,type intra area
Last update from 192.168.1.5 on Serial0,00:12:20 ago
Routing Descriptor Blocks:
* 192J68.1.5, from 192.168.1.1, 00:12:20 ago, via Serial0
 Route metric is 138, traffic share count is 1
(1)在R2路由器上,使用show ip protocol命令,可以列出OSPF协议的主要配置信息 。其中所路由的网络中列出的是接口地址"掩码为32位,这是和网络声明配置语句相对应的 。
命令同时列出了2个路由信息源,它们是R1和R3路由器,相应的IP地址即为R1和R3的RouterID 。
OSPF协议的缺省治理距离为110 。
(2)show ip ospf neighbor命令列出了当前路由器的邻居,其中各项的含义如下:
NeighborID:邻居路由器的ID号;
Pri:即Priority,邻居路由器的优先级,缺省情况下是1;
State:邻居路由器的状态,"Full"表明形成的完全的邻接关系;
Dead Time:为终结时间,假如在此计数器计数到0之前,没有接收到由对应的邻居路由器发来的Hello包,则邻接关系将被清除;
Address:是邻居路由器的IP地址;
Interface:是与邻居路由器相连的本路由器的接口 。
(3)使用show ip ospf neghbor detail命令列出了与R2路由器相邻的路由器的具体信息 。
(4)show ip ospf interface命令可以列出相应接口的OSPF信息 。以R2路由器S0接口为例,列出了以下重要信息:
OSPF进程ID为100;
RouterID为192.168.1.5;
OSPF网络类型为点到点;
此链路的Cost值为64;
Hello计时器为10秒;
终结计时器为40秒;
等待计时器为40秒;
与一个邻居路由器形成邻接关系,它的ID是192.168.1.6,即R3路由器 。
(5)查看OSPF数据库的命令是show ip ospf database,此命令列出了3条链路信息,分别是由R1、R2和R3产生的 。
(6)在R1和R3路由器上查看OSPF邻居信息,可以看到它们的邻居都是R2 。
(7)使用show ip route ospf命令可以查看由OSPF协议所得到的路由项,便我们在众多路由项中找到想看的OSPF路由项 。
(8)使用带有网段参数的show ip route命令可以查看相应的网段(如实验中的172.16.1.0)的具体信息,包括由什么协议获取、度量值、路由源及更新时间等信息 。

推荐阅读