CCNP-6 OSPF试验2
实验要求:分别在 R1 R2 R3
上起 OSPF
,注意观察他们的网络类型,邻居关系的建立过程,各种定时器的默认设置,有无 DR/BDR
的选举等等的一些特点。 试验目的:掌握并会熟练配置和验证点对点类型的 OSPF
。 R1(config-if)#ip add 199.99.1.1 255.255.255.0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config)#router ospf 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 199.99.1.0 0.0.0.255 area 0
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#ip add 199.99.2.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#ip ospf network point-to-point
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 199.99.1.0 0.0.0.255 area 0
R2(config-router)#network 199.99.2.0 0.0.0.255 area 0
R3(config-if)#ip add 199.99.2.2 255.255.255.0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#ip ospf network point-to-point
R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 199.99.2.0 0.0.0.255 area 0
以上为基本配置,下面用 show ip route
查看一下路由表,看是否有“ O
”路由存在: Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external,
O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
O 199.99.2.0/24 [110/128] via 199.99.1.2, 00:00:20, Serial1/0 C 199.99.1.0/24 is directly connected, Serial1/0
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external,
O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
C 199.99.2.0/24 is directly connected, Serial1/0
O 199.99.1.0/24 [110/128] via 199.99.2.1, 00:00:44, Serial1/0 OK
,在 R1 R3
上都看到了 ”O”
路由,表示这条路由是从 OSPF
学到的。下面用 show ip protocols
验证 OSPF
协议: Routing Protocol is "ospf 100" \\ 启用 OSPF 路由协议,进程号为 100 Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
\\ 没有设置分布列表 Router ID 1.1.1.1 \\ 本台路由器的路由 ID Number of areas in this router is 1. 1 normal 0 stub 0 nssa
\\ 本台路由器加入的区域数目为 1 199.99.1.0 0.0.0.255 area 0
\\ 路由的网络 Reference bandwidth unit is 100 mbps
\\ 花费计算参考带宽为 100M Routing Information Sources:
\\ 邻居路由器 Gateway Distance Last Update
Distance: (default is 110)
\\ 管理距离 Routing Protocol is "ospf 100"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
199.99.1.0 0.0.0.255 area 0
199.99.2.0 0.0.0.255 area 0
Reference bandwidth unit is 100 mbps
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 110)
Routing Protocol is "ospf 100"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
199.99.2.0 0.0.0.255 area 0
Reference bandwidth unit is 100 mbps
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 110)
通过上面的输出和后面红色标记的注释可以很清楚的知道本台路由器的路由协议的配置情况,下面再用 show ip ospf interface
查看接口路由协议的运行状况: R1#show ip ospf interface
Serial1/0 is up, line protocol is up
Internet Address 199.99.1.1/24, Area 0
Process ID 100, Router ID 1.1.1.1,
Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec,
State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 Suppress hello for 0 neighbor(s)
R2#show ip ospf interface
Serial1/1 is up, line protocol is up
Internet Address 199.99.2.1/24, Area 0
Process ID 100, Router ID 2.2.2.2,
Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec,
State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Supports Link-local Signaling (LLS)
Index 2/2, flood queue length 0
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 3.3.3.3 Suppress hello for 0 neighbor(s)
Serial1/0 is up, line protocol is up
Internet Address 199.99.1.2/24, Area 0
Process ID 100, Router ID 2.2.2.2,
Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec,
State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 1.1.1.1 Suppress hello for 0 neighbor(s)
R3#show ip ospf interface
Serial1/0 is up, line protocol is up
Internet Address 199.99.2.2/24, Area 0
Process ID 100, Router ID 3.3.3.3,
Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec,
State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 Suppress hello for 0 neighbor(s)
通过上面的输出可以看到 OSPF
路由协议在路由器的接口上正确的配置和运行,网络类型为点对点,默认 HELLO
时间间隔为 10
秒,等待时间和死亡时间为 HELLO
时间间隔的四倍,也就是 40
秒。 Neighbor ID Pri State Dead Time Address Interface
2.2.2 .2 0 FULL/ - 00:00:34 199.99.1.2 Serial1/0
Neighbor ID Pri State Dead Time Address Interface
3.3.3 .3 0 FULL/ - 00:00:36 199.99.2.2 Serial1/1
1.1.1 .1 0 FULL/ - 00:00:35 199.99.1.1 Serial1/0
Neighbor ID Pri State Dead Time Address Interface
2.2.2 .2 0 FULL/ - 00:00:38 199.99.2.1 Serial1/0
发现在点对点环境下,邻居关系是自动建立,并且没有选举 DR/BDR , 再看一下 LSDB : OSPF Router with ID (1.1.1.1) (Process ID 100) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1 .1 1.1.1.1 66 0x80000002 0x0042F7 2 2.2.2 .2 2.2.2.2 29 0x80000004 0x005AD2 4 3.3.3 .3 3.3.3.3 30 0x80000001 0x00DB4C 2 OSPF Router with ID (2.2.2.2) (Process ID 100) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1 .1 1.1.1.1 82 0x80000002 0x0042F7 2 2.2.2 .2 2.2.2.2 43 0x80000004 0x005AD2 4 3.3.3 .3 3.3.3.3 44 0x80000001 0x00DB4C 2 OSPF Router with ID (3.3.3.3) (Process ID 100) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1 .1 1.1.1.1 91 0x80000002 0x0042F7 2 2.2.2 .2 2.2.2.2 52 0x80000004 0x005AD2 4 3.3.3 .3 3.3.3.3 51 0x80000001 0x00DB4C 2 三台路由器的 LSDB 完全一样,说明了在同一个区域内的所有 OSPF 路由器的 LSDB 需要同步! 最后我们在 R1 上 debug ip ospf adj ,看一下它与 R2 的邻居建立过程是怎么样的? OSPF adjacency events debugging is on *Mar 1 00:01:31.295: %SYS-5-CONFIG_I: Configured from console by console *Mar 1 00:01:42.171: OSPF: Rcv DBD from 2.2.2.2 on Serial1/0 seq 0x1CEA opt 0x52 flag 0x7 len 32 mtu 1500 state INIT *Mar 1 00:01:42.175: OSPF: 2 Way Communication to 2.2.2.2 on Serial1/0, state 2WAY *Mar 1 00:01:42.175: OSPF: Send DBD to 2.2.2.2 on Serial1/0 seq 0x188B opt 0x52 flag 0x7 len 32 *Mar 1 00:01:42.175: OSPF: NBR Negotiation Done. We are the SLAVE *Mar 1 00:01:42.175: OSPF: Send DBD to 2.2.2.2 on Serial1/0 seq 0x1CEA opt 0x52 flag 0x2 len 52 *Mar 1 00:01:42.315: OSPF: Rcv DBD from 2.2.2.2 on Serial1/0 seq 0x1CEB opt 0x52 flag 0x1 len 32 mtu 1500 state EXCHANGE *Mar 1 00:01:42.315: OSPF: Exchange Done with 2.2.2.2 on Serial1/0 *Mar 1 00:01:42.319: OSPF: Synchronized with 2.2.2.2 on Serial1/0, state FULL *Mar 1 00:01:42.319: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on Serial1/0 from LOADING to FULL, Loading Done *Mar 1 00:01:42.319: OSPF: Send DBD to 2.2.2.2 on Serial1/0 seq 0x1CEB opt 0x52 flag 0x0 len 32 *Mar 1 00:01:42.411: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 64 LSA count 1 *Mar 1 00:01:42.483: OSPF: Rcv LS REQ from 2.2.2.2 on Serial1/0 length 36 LSA count 1 *Mar 1 00:01:42.483: OSPF: Send UPD to 199.99.1.2 on Serial1/0 length 40 LSA count 1 *Mar 1 00:01:42.819: OSPF: Build router LSA for area 0, router ID 1.1.1.1, seq 0x80000002 *Mar 1 00:01:48.075: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 76 LSA count 1 *Mar 1 00:02:10.395: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 88 LSA count 1 *Mar 1 00:02:20.499: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 76 LSA count 1 *Mar 1 00:02:20.715: OSPF: Rcv LS UPD from 2.2.2.2 on Serial1/0 length 100 LSA count 1 实验总结:在点对点环境下, OSPF 的邻居关系为自动发现,没有 DR/BDR 的选举,默认的 HELLO 时间间隔为 10 秒,等待时间和死亡时间为 HELLO 时间间隔的四倍,也就是 40 秒。 本文转自loveme2351CTO博客,原文链接: http://blog.51cto.com/loveme23/46042 ,如需转载请自行联系原作者