1、帧中继上的OSPF第 17 章帧中继上的 OSPF帧中继是典型的 NBMA(NonBroadcast Multiple Access)网络,其拓扑结构通常有两种:Full Mesh(全互联)和 Hub-and-Spoke(中心分支)。由于 Hub-and-Spoke 结构具有节约费用、简化配置等优点,在实际网络工程中有着广泛的应用。本章重点讨论的就是在Hub-and-Spoke 结构上,网络类型为 NBMA 模式、广播模式、点到点模式和点到多点模式的OSPF 配置。17.1实验 1: 帧中继环境下 NBMA 模式1.实验目的通过本实验可以掌握:(1)帧中继静态映射及 broadcast 参数的
2、含义(2)NBMA 模式下的 DR 选举(3)手工配置 OSPF 邻居(4)NBMA 模式下 OSPF 的配置和调试2.拓扑结构实验拓扑如图 17-1 所示。图 17-1 帧中继环境下 NBMA 模式3.实验步骤(1)步骤 1:配置路由器 R1R1(config)#interface Loopback0R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config-if)#ip ospf network point-to-pointR1(config-if)#interface Serial0/0/0R1(config-if)#ip addres
3、s 134.1.1.1 255.255.255.0R1(config-if)#encapsulation frame-relayR1(config-if)#frame-relay map ip 134.1.1.3 103 broadcast/帧中继静态映射R1(config-if)#frame-relay map ip 134.1.1.4 104 broadcastR1(config-if)#frame-relay map ip 134.1.1.1 103 /使得可以 PING 通自己R1(config-if)#no frame-relay inverse-arp/关闭帧中继动态 ARP 解析
4、R1(config-if)#no shutdownR1(config)#router ospf 1R1(config-router)#router-id 1.1.1.1R1(config-router)#network 1.1.1.0 0.0.0.255 area 0R1(config-router)#network 134.1.1.0 0.0.0.255 area 0R1(config-router)#neighbor 134.1.1.3/手工指 OSPF 邻居R1(config-router)#neighbor 134.1.1.4(2)步骤 2:配置路由器 R3R3(config)#int
5、erface Loopback0R3(config-if)#ip address 3.3.3.3 255.255.255.0R3(config-if)#ip ospf network point-to-pointR3(config-if)#interface Serial0/0/1R3(config-if)#ip address 134.1.1.3 255.255.255.0R3(config-if)#encapsulation frame-relayR3(config-if)#ip ospf priority 0/ 配置 spoke 端 OSPF 接口优先级为 0R3(config-if)#
6、frame-relay map ip 134.1.1.1 301 broadcastR3(config-if)#frame-relay map ip 134.1.1.4 301 broadcastR3(config-if)#frame-relay map ip 134.1.1.3 301R3(config-if)#no frame-relay inverse-arpR3(config-if)#no shutdownR3(config)#router ospf 1R3(config-router)#router-id 3.3.3.3R3(config-router)#network 3.3.3.
7、0 0.0.0.255 area 0R3(config-router)#network 134.1.1.0 0.0.0.255 area 0(3)步骤 3:配置路由器 R4R4(config)#interface Loopback0R4(config-if)#ip address 4.4.4.4 255.255.255.0R4(config-if)#ip ospf network point-to-pointR4(config-if)#interface Serial0/0/1R4(config-if)#ip address 134.1.1.4 255.255.255.0R4(config-i
8、f)#encapsulation frame-relayR4(config-if)#ip ospf priority 0R4(config-if)#frame-relay map ip 134.1.1.1 401 broadcastR4(config-if)#frame-relay map ip 134.1.1.3 401 broadcastR4(config-if)#frame-relay map ip 134.1.1.4 401R4(config-if)#no frame-relay inverse-arpR4(config-if)#no shutdownR4(config)#router
9、 ospf 1R4(config-router)#router-id 4.4.4.4R4(config-router)#network 4.4.4.0 0.0.0.255 area 0R4(config-router)#network 134.1.1.0 0.0.0.255 area 0【技术要点】(1)在帧中继网络上,OSPF 接口缺省的网络类型为 NON_BROADCAST。在这种模式下,OSPF 不会在帧中继接口上发送 Hello 包,因此无法建立最基本的邻接关系。可以手工使用“neighbor”命令来指定邻居,这时 Hello 包以单播形式传送;(2)NBMA 属于多路访问网络,所以要
10、进行 DR 选举。由于 Hello 包只能传 1 跳,所以在 Hub-and-Spoke 结构中,必须控制处于“Hub”端的路由器为 DR,最保险的办法就是将“Spoke”端接口优先级配置为 0,使之不参与 DR 选举,“Hub”端的路由器自然就成为 DR。否则,可能会导致路由学习不正常。4.实验调试(1)show ip ospf interfaceR1#show ip ospf interface s0/0/0Serial0/0/0 is up, line protocol is upInternet Address 134.1.1.1/24, Area 0Process ID 1, Rou
11、ter ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64/接口网络类型为 NBMA 模式Transmit Delay is 1 sec, State DR, Priority 1/自己是 DR,接口优先级为 1Designated Router (ID) 1.1.1.1, Interface address 134.1.1.1/DR 的 ID 和接口地址No backup designated router on this network/没有 BDRTimer intervals configured, Hello 30, Dead 120,
12、Wait 120, Retransmit 5/NBMA 模式下,Hello 周期为 30 秒oob-resync timeout 120Hello due in 00:00:22Index 2/2, flood queue length 0Next 0x0(0)/0x0(0)Last flood scan length is 1, maximum is 1Last flood scan time is 0 msec, maximum is 4 msecNeighbor Count is 2, Adjacent neighbor count is 2Adjacent with neighbor
13、3.3.3.3Adjacent with neighbor 4.4.4.4/与路由器 R3 和 R4 形成邻接关系Suppress hello for 0 neighbor(s)(2)show ip routeR3#show ip route ospf1.0.0.0/24 is subnetted, 1 subnetsOO1.1.1.0 110/65 via 134.1.1.1, 00:01:47, Serial0/0/04.0.0.0/24 is subnetted, 1 subnets4.4.4.0 110/65 via 134.1.1.4, 00:01:47, Serial0/0/0从以
14、上输出表明,到达网络“4.4.4.0/24”的路由条目的下一跳地址为“134.1.1.4”,而不是“134.1.1.1”,所以,在 R3 的 s0/0/1 的接口上必须有到 134.1.1.4 的映射“frame-relay map ip 134.1.1.4 301 broadcast”。(3)show ip ospf neighbor detailR1#show ip ospf neighbor detailNeighbor 3.3.3.3, interface address 134.1.1.3In the area 0 via interface Serial0/0/0Neighbor
15、priority is 0, State is FULL, 9 state changesDR is 134.1.1.1 BDR is 0.0.0.0Poll interval 120Options is 0x52LLS Options is 0x1 (LR)Dead timer due in 00:01:53Neighbor is up for 00:06:54Index 1/1, retransmission queue length 0, number of retransmission 1First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)Last retran
16、smission scan length is 1, maximum is 1Last retransmission scan time is 0 msec, maximum is 0 msecNeighbor 4.4.4.4, interface address 134.1.1.4In the area 0 via interface Serial0/0/0Neighbor priority is 0, State is FULL, 9 state changesDR is 134.1.1.1 BDR is 0.0.0.0Poll interval 120Options is 0x52LLS
17、 Options is 0x1 (LR)Dead timer due in 00:01:43Neighbor is up for 00:06:54Index 2/2, retransmission queue length 0, number of retransmission 1First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)Last retransmission scan length is 1, maximum is 1Last retransmission scan time is 0 msec, maximum is 0 msec以上输出表明 R1 的两个
18、邻居的接口优先级为 0。同时本网络的 BDR 为 0.0.0.0,这是可以的。17.2 实验 2:帧中继环境下 BMA 模式1.实验目的通过本实验可以掌握:(1)帧中继静态映射及 broadcast 参数的含义(2)BMA 模式下的 DR 选举(3)BMA 模式下 OSPF 的配置和调试2.拓扑结构实验拓扑如图 17-1 所示。3.实验步骤(1)步骤 1:配置路由器 R1R1(config)#interface Loopback0R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config-if)#ip ospf network point-t
19、o-pointR1(config-if)#interface Serial0/0/0R1(config-if)#ip address 134.1.1.1 255.255.255.0R1(config-if)#encapsulation frame-relayR1(config-if)#frame-relay map ip 134.1.1.3 103 broadcastR1(config-if)#frame-relay map ip 134.1.1.4 104 broadcastR1(config-if)#frame-relay map ip 134.1.1.1 103R1(config-if)
20、#no frame-relay inverse-arpR1(config-if)#ip ospf network broadcastR1(config-if)#no shutdownR1(config)#router ospf 1R1(config-router)#router-id 1.1.1.1R1(config-router)#network 1.1.1.0 0.0.0.255 area 0R1(config-router)#network 134.1.1.0 0.0.0.255 area 0(2)步骤 2:配置路由器 R3R3(config)#interface Loopback0R3
21、(config-if)#ip address 3.3.3.3 255.255.255.0R3(config-if)#ip ospf network point-to-pointR3(config-if)#interface Serial0/0/1R3(config-if)#ip address 134.1.1.3 255.255.255.0R3(config-if)#encapsulation frame-relayR3(config-if)#ip ospf priority 0R3(config-if)#frame-relay map ip 134.1.1.1 301 broadcastR3
22、(config-if)#frame-relay map ip 134.1.1.4 301 broadcastR3(config-if)#frame-relay map ip 134.1.1.3 301R3(config-if)#no frame-relay inverse-arpR3(config-if)#ip ospf network broadcastR3(config-if)#no shutdownR3(config)#router ospf 1R3(config-router)#router-id 3.3.3.3R3(config-router)#network 3.3.3.0 0.0
23、.0.255 area 0R3(config-router)#network 134.1.1.0 0.0.0.255 area 0(3)步骤 3:配置路由器 R4R4(config)#interface Loopback0R4(config-if)#ip address 4.4.4.4 255.255.255.0R4(config-if)#ip ospf network point-to-pointR4(config-if)#interface Serial0/0/1R4(config-if)#ip address 134.1.1.4 255.255.255.0R4(config-if)#en
24、capsulation frame-relayR4(config-if)#ip ospf priority 0R4(config-if)#frame-relay map ip 134.1.1.1 401 broadcastR4(config-if)#frame-relay map ip 134.1.1.3 401 broadcastR4(config-if)#frame-relay map ip 134.1.1.4 401R4(config-if)#no frame-relay inverse-arpR4(config-if)#ip ospf network broadcastR4(confi
25、g-if)#no shutdownR4(config)#router ospf 1R4(config-router)#router-id 4.4.4.4R4(config-router)#network 4.4.4.0 0.0.0.255 area 0R4(config-router)#network 134.1.1.0 0.0.0.255 area 0【技术要点】(1)在 Hub-and-Spoke 结构中,BMA 也要控制 DR 选举,确保处于“Hub”端的路由器为 DR,实施方法和实验 1 一样;(2)BMA 模式下,邻居关系自动通过 Hello 包建立和维持。4.实验调试(1)show
26、 ip ospf interfaceR1#show ip ospf interface s0/0/0Serial0/0/0 is up, line protocol is upInternet Address 134.1.1.1/24, Area 0Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 64/网络类型为 BROADCASTTransmit Delay is 1 sec, State DR, Priority 1Designated Router (ID) 1.1.1.1, Interface address
27、 134.1.1.1No backup designated router on this networkTimer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5/BMA 模式下,Hello 周期为 10 秒oob-resync timeout 40Hello due in 00:00:07Index 2/2, flood queue length 0Next 0x0(0)/0x0(0)Last flood scan length is 1, maximum is 1Last flood scan time is
28、0 msec, maximum is 4 msecNeighbor Count is 2, Adjacent neighbor count is 2Adjacent with neighbor 3.3.3.3Adjacent with neighbor 4.4.4.4Suppress hello for 0 neighbor(s)(2)show ip routeR4#show ip route ospf1.0.0.0/24 is subnetted, 1 subnetsOO1.1.1.0 110/65 via 134.1.1.1, 00:03:19, Serial0/0/13.0.0.0/24
29、 is subnetted, 1 subnets3.3.3.0 110/65 via 134.1.1.3, 00:03:19, Serial0/0/117.3 实验 3:帧中继环境下点到点模式1.实验目的(1)帧中继子接口下静态映射(2)点到点模式的特征(2)点到点模式下 OSPF 的配置和调试2.拓扑结构实验拓扑如图 17-2 所示。图 17-2 帧中继环境下点到点模式3.实验步骤(1)步骤 1:配置路由器 R1R1(config)#interface Loopback0R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config-if)#i
30、p ospf network point-to-pointR1(config)#interface Serial0/0/0R1(config-if)#no ip addressR1(config-if)#encapsulation frame-relayR1(config-if)#no frame-relay inverse-arpR1(config-if)#no shutdownR1(config)#interface Serial0/0/0.1 point-to-pointR1(config-subif)#ip address 13.1.1.1 255.255.255.0R1(config
31、-subif)#frame-relay interface-dlci 103R1(config)#interface Serial0/0/0.2 point-to-pointR1(config-subif)#ip address 14.1.1.1 255.255.255.0R1(config-subif)#frame-relay interface-dlci 104R1(config)#router ospf 1R1(config-router)#router-id 1.1.1.1R1(config-router)#network 1.1.1.0 0.0.0.255 area 0R1(config-router)#network 13.1.1.0 0.0.0.255 area 0R1(config-router)#ne
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1