转自于 http://xuzhiming302.blog.51cto.com/2377258/530859
按照上图中给出的参数,在此广播多路访问链路上的各个设备上开启OSPF进程。
在此我也只拿R1作为例子说一下开启OSPF进程的配置:
1》router(config)#router ospf 1
router(config-router)#router-id 1.1.1.1
router(config-router)#network 1.1.1.0 0.0.0.255 area 0
router(config-router)#network 192.168.1.0 0.0.0.255 area 0
然后再采用同样的方法依次开启R2、R3、R4上的OSPF进程。
2》实验调试
● Router#show ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet address is 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
上面这一行给出了此路由器上开启OSPF进程号为1,此路由器的ID为1.1.1.1,F0/0所连接的网络类型为广播多路访问类型,且此端口的COST值为1.
Transmit Delay is 1 sec, State DROTHER, Priority 1(F0/0的接口优先级,接口优先级的范围是0-255)
Designated Router (ID) 4.4.4.4, Interface address 192.168.1.4(此广播多路访问链路上DR为R4)
Backup Designated Router (ID) 3.3.3.3, Interface address 192.168.1.3(此广播多路访问链路上BDR为R3)
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:08
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 3, Adjacent neighbor count is 2
上面这一行显示了R1的邻居呢有3个,而建立邻接关系的有2个,很明显这两个分别是R4(DR)和R3(BDR)。邻居和邻接是两个不同的概念,邻居关系是指达到2way状态,而邻接关系是指达到FULL状态。
Adjacent with neighbor 4.4.4.4 (Designated Router)
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
◆ Router#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
4.4.4.4 1 FULL/DR 00:00:31 192.168.1.4 FastEthernet0/0
3.3.3.3 1 FULL/BDR 00:00:31 192.168.1.3 FastEthernet0/0
2.2.2.2 1 2WAY/DROTHER 00:00:31 192.168.1.2 FastEthernet0/0
以上结果表明,R1有3个邻居,其中3.3.3.3和4.4.4.4是BDR和DR,可以看出来建立邻居关系的路由器的STATE是2WAY,而建立邻接关系的路由器的STATE是FULL。
注意:为什么DR是4.4.4.4 BDR是3.3.3.3 这跟我在OSPF工作过程详细图解中提及到的DR的选举原则是一致的。、
实验结束!