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:点到点模式
总结:点到点模式特点: