1:Hub-and-spoke上的NBMA模式(也是默认模式)
总结:HUB-AND-SPOKE上NBMA模式特点:
(1) 帧中继接口IP地址都在同一子网上;
(2) 要手动配置OSPF邻居;
(3) 需要选举DR,需要手动控制DR在HUB端;
(4) 需要手工进行帧中继映射。
验证:
1:验证拓扑:
2:配置过程:
(1) FR交换机的配置.
frame-relay switching
int s0/0
en fr ietf
frame-relay intf-type dce
clock rate 64000
frame-relay lmi-type ansi
frame-relay route 102 interface s0/1 201
frame-relay route 103 interface s0/2 301
frame-relay route 104 interface s0/3 401
no sh
int s0/1
en fr ietf
frame-relay intf-type dce
clock rate 64000
frame-relay lmi-type ansi
frame-relay route 201 interface s0/0 102
frame-relay route 203 interface s0/2 302
frame-relay route 204 interface s0/3 402
no sh
int s0/2
en fr ietf
frame-relay intf-type dce
clock rate 64000
frame-relay lmi-type ansi
frame-relay route 301 interface s0/0 103
frame-relay route 302 interface s0/1 203
frame-relay route 304 interface s0/3 403
no sh
int s0/3
en fr ietf
frame-relay intf-type dce
clock rate 64000
frame-relay lmi-type ansi
frame-relay route 401 interface s0/0 104
frame-relay route 402 interface s0/1 204
frame-relay route 403 interface s0/2 304
no sh
R1(config)#int s0/0
R1(config-if)#encapsulation frame-relay
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
interface Serial0/0
ip address 192.168.1.1 255.255.255.0
encapsulation frame-relay
no frame-relay inverse-arp
frame-relay map ip 192.168.1.1 102 broadcast
frame-relay map ip 192.168.1.2 102 broadcast
frame-relay map ip 192.168.1.3 103 broadcast
frame-relay map ip 192.168.1.4 104 broadcast
R2(config)#int s0/0
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#encapsulation frame-relay
R2(config-if)#no frame-relay inverse-arp
2(config-if)#frame-relay map ip 192.168.1.1 201 broadcast
R2(config-if)#frame-relay map ip 192.168.1.2 201 broadcast
R2(config-if)#frame-relay map ip 192.168.1.3 201 broadcast
R2(config-if)#frame-relay map ip 192.168.1.4 201 broadcast
R2(config-if)#no sh
R2(config-if)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R3(config)#int s0/0
R3(config-if)#encapsulation frame-relay
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#ip add 192.168.1.3 255.255.255.0
R3(config-if)#frame-relay map ip 192.168.1.1 301 br
R3(config-if)#frame-relay map ip 192.168.1.1 301 broadcast
R3(config-if)#frame-relay map ip 192.168.1.2 301 broadcast
R3(config-if)#frame-relay map ip 192.168.1.3 301 broadcast
R3(config-if)#frame-relay map ip 192.168.1.4 301 broadcast
R3(config-if)#no sh
R3(config-if)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R4(config)#int s0/0
R4(config-if)#encapsulation frame-relay
R4(config-if)#no frame-relay inverse-arp
R4(config-if)#ip add 192.168.1.4 255.255.255.0
R4(config-if)#frame-relay map ip 192.168.1.1 401 broadcast
R4(config-if)#frame-relay map ip 192.168.1.2 401 broadcast
R4(config-if)#frame-relay map ip 192.168.1.3 401 broadcast
R4(config-if)#frame-relay map ip 192.168.1.4 401 broadcast
R4(config-if)#no sh
R4(config-if)#int lo 0
R4(config-if)#ip add 4.4.4.4 255.255.255.0
(2) 配置OSPF路由
R1(config)#router os 1
R1(config-router)#network 0.0.0.0 255.255.255.255 a 0
R2(config)#router os 1
R2(config-router)#network 0.0.0.0 255.255.255.255 a 0
R3(config)#router os 1
R3(config-router)#net 0.0.0.0 255.255.255.255 a 0
R3(config-router)#no au
R4(config)#router os 1
R4(config-router)#net 0.0.0.0 255.255.255.255 a 0
R1#sh ip os nei //发现没有任何邻居
R1#sho ip os interface s0/0
Serial0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
No backup designated router on this network
Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
oob-resync timeout 120
Hello due in 00:00:08
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 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
//发现帧中继缺省情况下是NBMA网络,所以需要手动指邻居.
R1(config)#router os 1
R1(config-router)#neighbor 192.168.1.2
R1(config-router)#neighbor 192.168.1.3
R1(config-router)#neighbor 192.168.1.4
R1#sho ip os nei
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DROTHER 00:01:58 192.168.1.2 Serial0/0
3.3.3.3 1 FULL/DROTHER 00:01:58 192.168.1.3 Serial0/0
4.4.4.4 1 FULL/DR 00:01:58 192.168.1.4 Serial0/0
R2#sho ip os nei
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DROTHER 00:01:41 192.168.1.1 Serial0/0
Hub端和所有的Spoke端都建立了邻居,Spoke端之间没能建邻居,而且发现路由也没能全部学习到。解决方法是保证Hub端成为DR。
R1(config)#int s0/0
R1(config-if)#ip ospf priority 255
R2(config)#int s0/0
R2(config-if)#ip ospf priority 0
R3(config)#int s0/0
R3(config-if)#ip ospf priority 0
R4(config)#int s0/0
R4(config-if)#ip ospf priority 0
//发现R1已经成为了DR,现在发现路由已经学全了。
R4#sho ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 192.168.1.1, 00:00:32, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 192.168.1.2, 00:00:32, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 192.168.1.3, 00:00:32, Serial0/0
2:HUB-and-spoke上的广播模式
总结:HUB-AND-SPOKE广播模式特点:
(1) 帧中继接口IP地址都在同一子网上;
(2) HELLO包组播发送,无需手工配OSPF邻居;
(3) 需选举DR,要手工控制DR在HUB端;
(4) 要手工进行帧中继的映射。
继续沿用上边的拓扑,将网络类型改为广播型网络,配置完毕后跟上边唯一的区别就是Hello可以在广播网络上传送,无需手动指定邻居,但也要确保Hub端是DR。
R1(config)#int s0/0
R1(config-if)#ip ospf network ?
broadcast Specify OSPF broadcast multi-access network
non-broadcast Specify OSPF NBMA network
point-to-multipoint Specify OSPF point-to-multipoint network
point-to-point Specify OSPF point-to-point network
R1(config-if)#ip ospf network broadcast
R2,R3,R4一次执行此命令并确保Hub端是DR就OK了。
3:FULL Mesh上的广播模式:
总结:FULL-Mesh上的广播模式特点:
(1) 帧中继接口IP地址都在同一子网上;
(2) Hello包组播发送,无需手工配OSPF邻居;
(3) 需选举DR,无需手工控制DR;
(4) 不需手工进行帧中继映射。
R1(config)#default interface s0/0 //同样恢复R2,R3,R4上的配置
R2(config-if)#frame-relay map ip 192.168.1.1 201 b
R2(config-if)#frame-relay map ip 192.168.1.2 201 b
R2(config-if)#frame-relay map ip 192.168.1.3 203 b
R2(config-if)#frame-relay map ip 192.168.1.4 204 b
R3(config-if)#frame-relay map ip 192.168.1.1 301 b
R3(config-if)#frame-relay map ip 192.168.1.2 302 b
R3(config-if)#frame-relay map ip 192.168.1.3 302 b
R3(config-if)#frame-relay map ip 192.168.1.4 304 b
R4(config-if)#frame-relay map ip 192.168.1.1 401 b
R4(config-if)#frame-relay map ip 192.168.1.2 402 b
R4(config-if)#frame-relay map ip 192.168.1.3 403 b
R4(config-if)#frame-relay map ip 192.168.1.4 403 b
R1(config)#int s0/0
R1(config-if)#ip ospf network broadcast
R2(config)#int s0/0
R2(config-if)#ip ospf network broadcast
R3(config)#int s0/0
R3(config-if)#ip ospf network broadcast
R4(config)#int s0/0
R4(config-if)#ip ospf network broadcast
4:点到点模式
总结:点到点模式特点:
(1) 帧中继接口在不同子网;
(2) Hello包组播发送,无需手工配OSPF邻居;
(3) 不选举DR;
(4) 需要手工进行帧中继映射。
R1(config)#int s0/0
R1(config-if)#encapsulation frame-relay
R1(config-if)#no sh
R1(config)#int s0/0.1 point-to-point
R1(config-subif)#ip add 192.168.1.1 255.255.255.0
R1(config-subif)#frame-relay interface-dlci 102
R1(config-fr-dlci)#int s0/0.2 p
R1(config-subif)#ip add 192.168.2.1 255.255.255.0
R1(config-subif)#frame-relay interface-dlci 103
R1(config-fr-dlci)#int s0/0.3 p
R1(config-subif)#ip add 192.168.3.1 255.255.255.0
R1(config-subif)#frame-relay interface-dlci 104
R2(config)#int s0/0
R2(config-if)#encapsulation frame-relay
R2(config-if)#ip add 192.168.1.2 255.255.255.0
R2(config-if)#frame-relay map ip 192.168.1.1 201 broadcast
R2(config-if)#no sh
R3(config)#int s0/0
R3(config-if)#encapsulation frame-relay
R3(config-if)#ip add 192.168.2.2 255.255.255.0
R3(config-if)#no sh
R3(config-if)#frame-relay map ip 192.168.2.1 301 b
R4(config)#int s0/0
R4(config-if)#encapsulation frame-relay
R4(config-if)#ip add 192.168.3.2 255.255.255.0
R4(config-if)#no sh
R4(config-if)#frame-relay map ip 192.168.3.1 401 b
默认接口还是NBMA模式,需要手动改为点到点模式
R2(config)#int s0/0
R2(config-if)#ip ospf network point-to-point
R3(config)#int s0/0
R3(config-if)#ip ospf network point-to-point
R4(config)#int s0/0
R4(config-if)#ip ospf network point-to-point
R3#sho ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/5209] via 192.168.2.1, 00:01:38, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/6771] via 192.168.2.1, 00:01:38, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/6771] via 192.168.2.1, 00:01:38, Serial0/0
O 192.168.1.0/24 [110/6770] via 192.168.2.1, 00:01:38, Serial0/0
O 192.168.3.0/24 [110/6770] via 192.168.2.1, 00:01:38, Serial0/0
//已经学习到了所有的路由信息。
5:点到多点广播模式
总结:点到多点广播模式特点:
(1) 帧中继接口在同一个子网;
(2) Hello包组播发送,无需手工配OSPF邻居;
(3) 不选举DR;
(4) 不需要手工进行帧中继映射。
配置完后默认是NBMA,需要手动更改为点到多点广播模式:
R1(config)#int s0/0
R1(config-if)#ip ospf network point-to-multipoint
R2(config)#int s0/0
R2(config-if)#ip ospf network point-to-multipoint
R3(config)#int s0/0
R3(config-if)#ip ospf network point-to-multipoint
R4(config)#int s0/0
R4(config-if)#ip ospf network point-to-multipoint
6:点到多点非广播模式
总结:点到多点非广播模式特点:
(1) 帧中继接口在同一子网;
(2) 需要手工配置OSPF邻居;
(3) 不选举DR;
(4) 不需要手工进行帧中继映射。
//再将上边的配置改为点到多点非广播模式,跟点到多点广播模式的区别是需要手动指邻居,原因是Hello的组播包无法穿越FR环境。
R1(config)#int s0/0
R1(config-if)#ip ospf network point-to-multipoint non-broadcast
R2(config)#int s0/0
R2(config-if)#ip ospf network point-to-multipoint non-broadcast
R3(config)#int s0/0
R3(config-if)#ip ospf network point-to-multipoint non-broadcast
R4(config)#int s0/0
R4(config-if)#ip ospf network point-to-multipoint non-broadcast
//发现更改完后邻居很快没有了,我们在R1上手动指邻居。
R1(config)#router os 1
R1(config-router)#neighbor 192.168.1.2
R1(config-router)#neighbor 192.168.1.3
R1(config-router)#neighbor 192.168.1.4
R2(config)#router os 1
R2(config-router)#neighbor 192.168.1.1
R2(config-router)#neighbor 192.168.1.3
R2(config-router)#neighbor 192.168.1.4
R3(config)#router os 1
R3(config-router)#neighbor 192.168.1.1
R3(config-router)#neighbor 192.168.1.2
R3(config-router)#neighbor 192.168.1.4
R4(config)#router os 1
R4(config-router)#neighbor 192.168.1.1
R4(config-router)#neighbor 192.168.1.2
R4(config-router)#neighbor 192.168.1.3
R2#sho ip os neighbor
Neighbor ID Pri State Dead Time Address Interface
4.4.4.4 0 FULL/ - 00:01:44 192.168.1.4 Serial0/0
3.3.3.3 0 FULL/ - 00:01:44 192.168.1.3 Serial0/0
1.1.1.1 0 FULL/ - 00:01:51 192.168.1.1 Serial0/0
R2#sho ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/5209] via 192.168.1.1, 00:00:49, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/5209] via 192.168.1.3, 00:00:49, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/5209] via 192.168.1.4, 00:00:49, Serial0/0
192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks
O 192.168.1.1/32 [110/5208] via 192.168.1.1, 00:00:49, Serial0/0
O 192.168.1.3/32 [110/5208] via 192.168.1.3, 00:00:49, Serial0/0
O 192.168.1.4/32 [110/5208] via 192.168.1.4, 00:00:49, Serial0/0
//已经建立全部的邻接关系,并且学到了路由表,在点到多点非广播模式中会产生32位的主机路由。
再次总结:
1:Hub-and-spoke上的NBMA模式
总结:HUB-AND-SPOKE上NBMA模式特点:
(5) 帧中继接口IP地址都在同一子网上;
(6) 要手动配置OSPF邻居;
(7) 需要选举DR,需要手动控制DR在HUB端;
(8) 需要手工进行帧中继映射。
2:HUB-and-spoke上的广播模式
总结:HUB-AND-SPOKE广播模式特点:
(5) 帧中继接口IP地址都在同一子网上;
(6) HELLO包组播发送,无需手工配OSPF邻居;
(7) 需选举DR,要手工控制DR在HUB端;
(8) 要手工进行帧中继的映射。
3:FULL Mesh上的广播模式:
总结:FULL-Mesh上的广播模式特点:
(5) 帧中继接口IP地址都在同一子网上;
(6) Hello包组播发送,无需手工配OSPF邻居;
(7) 需选举DR,无需手工控制DR;
(8) 不需手工进行帧中继映射。
4:点到点模式
总结:点到点模式特点:
(5) 帧中继接口在不同子网;
(6) Hello包组播发送,无需手工配OSPF邻居;
(7) 不选举DR;
(8) 需要手工进行帧中继映射。
5:点到多点广播模式
总结:点到多点广播模式特点:
(5) 帧中继接口在同一个子网;
(6) Hello包组播发送,无需手工配OSPF邻居;
(7) 不选举DR;
(8) 不需要手工进行帧中继映射。
6:点到多点非广播模式
总结:点到多点非广播模式特点:
(5) 帧中继接口在同一子网;
(6) 需要手工配置OSPF邻居;
(7) 不选举DR;
(8) 不需要手工进行帧中继映射。