CCNP-5 OSPF试验1
试验拓扑: 试验要求:模拟在广播环境下,OSPF的配置与调试。 试验目的:掌握OSPF的基本配置,并且能够分析得到OSPF在广播环境下邻居发现过程,DR/BDR选举过程,定时器的时间间隔。 实验配置: R1: R1(config)#int f0/0 R1(config-if)#ip add 199.99.1.1 255.255.255.0 R1(config-if)#no shu R1(config-if)#exit R1(config)#int loop0 R1(config-if)#ip add R1(config-if)#ip ospf network point-to-point R1(config-if)#exit R1(config)#router ospf 100 R1(config-router)#router-id R1(config-router)#network 199.99.1.0 R2: R2(config)#int f0/0 R2(config-if)#ip add 199.99.1.2 255.255.255.0 R2(config-if)#no shu R2(config-if)#exit R2(config)#int loop0 R2(config-if)#ip add R2(config-if)#ip ospf network point-to-point R2(config-if)#exit R2(config)#router ospf 100 R2(config-router)#router-id R2(config-router)#network 199.99.1.0 R3: R3(config)#int f0/0 R3(config-if)#ip add 199.99.1.3 255.255.255.0 R3(config-if)#no shu R3(config-if)#exit R3(config)#int loop0 R3(config-if)#ip add R3(config-if)#ip ospf network point-to-point R3(config-if)#exit R3(config)#router ospf 100 R3(config-router)#router-id R3(config-router)#network 199.99.1.0 配置完成后,使用show ip ospf interface命令查看端口类型: R1#show ip ospf interface f0/0 FastEthernet0/0 is up, line protocol is up Internet Address 199.99.1.1/24, Area 0 Process ID 100, Router ID Transmit Delay is 1 sec, State DROTHER, Priority 1 Designated Router (ID) Backup Designated router (ID) Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:01 Supports Link-local Signaling (LLS) Index 1/1, 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 2, Adjacent neighbor count is 2 Adjacent with neighbor Adjacent with neighbor Suppress hello for 0 neighbor(s) R2#show ip ospf interface f0/0 FastEthernet0/0 is up, line protocol is up Internet Address 199.99.1.2/24, Area 0 Process ID 100, Router ID Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) Backup Designated router (ID) Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:06 Supports Link-local Signaling (LLS) Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 2, Adjacent neighbor count is 2 Adjacent with neighbor Adjacent with neighbor Suppress hello for 0 neighbor(s) R3#show ip ospf interface f0/0 FastEthernet0/0 is up, line protocol is up Internet Address 199.99.1.3/24, Area 0 Process ID 100, Router ID Transmit Delay is 1 sec, Designated Router (ID) Backup Designated router (ID) Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:07 Supports Link-local Signaling (LLS) Index 1/1, 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 2, Adjacent neighbor count is 2 Adjacent with neighbor Adjacent with neighbor Suppress hello for 0 neighbor(s) 不仅可以看到网络类型是BROADCAST,还可以知道端口属于哪个AREA,ROUTER ID是多少,优先级都是默认值1DR,BDR是谁,HELLO/DEAD/WAIT计时器为多少等等。 使用show ip ospf neiighbore命令查看OSPF邻居表: R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 通过上面的输出可以知道R3是DR,R2是BDR,R1为DROther,这是因为R3的router-id最大,R2的次之,R1最小。再使用show ip ospf database查看都有哪些LSA类型: R1#show ip ospf database OSPF Router with ID ( Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 199.99.1.3 R2#show ip ospf database OSPF Router with ID ( Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 199.99.1.3 R3#show ip ospf database OSPF Router with ID ( Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 199.99.1.3 可以看到只有1类和2类LSA。 然后我们抓取一下R1的debug信息看看: R1#debug ip ospf adj OSPF adjacency events debugging is on R1# R1#clear ip ospf p R1#clear ip ospf process Reset ALL OSPF processes? [no]: y R1# *Mar 1 00:13:57.483: OSPF: Interface FastEthernet0/0 going Down *Mar 1 00:13:57.483: OSPF: *Mar 1 00:13:57.483: OSPF: Neighbor change Event on interface FastEthernet0/0 *Mar 1 00:13:57.483: OSPF: DR/BDR election on FastEthernet0/0 *Mar 1 00:13:57.487: OSPF: Elect BDR *Mar 1 00:13:57.487: OSPF: Elect DR *Mar 1 00:13:57.487: DR: *Mar 1 00:13:57.487: OSPF: *Mar 1 00:13:57.487: %OSPF-5-ADJCHG: Process 100, Nbr *Mar 1 00:13:57.491: OSPF: Neighbor change Event on interface FastEthernet0/0 *Mar 1 00:13:57.491: OSPF: DR/BDR election on FastEthernet0/0 *Mar 1 00:13:57.491: OSPF: Elect BDR *Mar 1 00:13:57.491: OSPF: Elect DR *Mar 1 00:13:57.495: DR: *Mar 1 00:13:57.495: OSPF: *Mar 1 00:13:57.495: %OSPF-5-ADJCHG: Process 100, Nbr *Mar 1 00:13:57.499: OSPF: Neighbor change Event on interface FastEthernet0/0 *Mar 1 00:13:57.499: OSPF: DR/BDR election on FastEthernet0/0 *Mar 1 00:13:57.499: OSPF: Elect BDR *Mar 1 00:13:57.499: OSPF: Elect DR *Mar 1 00:13:57.499: DR: none BDR: none *Mar 1 00:13:57.503: OSPF: Remember old DR *Mar 1 00:13:57.587: OSPF: Interface FastEthernet0/0 going Up *Mar 1 00:13:57.639: OSPF: 2 Way Communication to *Mar 1 00:13:57.639: OSPF: Backup seen Event before WAIT timer on FastEthernet0/0 *Mar 1 00:13:57.639: OSPF: DR/BDR election on FastEthernet0/0 \\与R2比较,选取DR/BDR *Mar 1 00:13:57.643: OSPF: Elect BDR *Mar 1 00:13:57.643: OSPF: Elect DR *Mar 1 00:13:57.643: DR: *Mar 1 00:13:57.643: OSPF: Send DBD to *Mar 1 00:13:57.663: OSPF: 2 Way Communication to *Mar 1 00:13:57.663: OSPF: Neighbor change Event on interface FastEthernet0/0 *Mar 1 00:13:57.663: OSPF: DR/BDR election on FastEthernet0/0 \\与R2和R3比较,选取DR/BDR *Mar 1 00:13:57.667: OSPF: Elect BDR *Mar 1 00:13:57.667: OSPF: Elect DR *Mar 1 00:13:57.667: OSPF: Send DBD to *Mar 1 00:13:57.671: OSPF: Remember old DR *Mar 1 00:13:57.671: OSPF: Neighbor change Event on interface FastEthernet0/0 *Mar 1 00:13:57.671: OSPF: DR/BDR election on FastEthernet0/0 *Mar 1 00:13:57.671: OSPF: Elect BDR *Mar 1 00:13:57.671: OSPF: Elect DR *Mar 1 00:13:57.675: DR: *Mar 1 00:13:57.711: OSPF: Rcv DBD from |

