1,OSPF模仿广播网络上运行方式;
2,所有的接口都在同一子网;
3,通常全互联拓扑,或手工选择DR和BDR,确保DR/BDR与所有路由器都直接相连;
4,通过非广播接口扩散时,复制LSA,为每条PVC提供一个拷贝。更新被发送到邻居表中列出的每台路邻接由器。
5,手工指定邻居;
Router(config-router)#
neighbor ip-address [priority number] [poll-interval number] [cost number] [database-filter all]
*在non-broadcast模式中,只需在DR和BDR上配置命令neighbor。在中央-分支拓扑中,必须在中央路由器上配置命令neighbor,还必须将其优先级调高,使其成为DR;在分支路由器上,可以不配置neighbor,因为邻居自动发现。
在全互联NBMA拓扑,除非使用命令ip ospf priority 静态地指定了DR和BDR,否则需要在所有路由器上配置命令neighbor
实验:
采用中央-分支的拓扑结构,将中央路由器设置为DR,在中央路由器上指定邻居。non-broadcast模式是Cisco在多点子接口和帧中继主接口上的默认模式。
配置:
FR:
FR(config)#no ip routing
FR(config)#frame-relay switching
FR(config)#int s0/0
FR(config-if)#no ip add
FR(config-if)#no sh
FR(config-if)#en fr
FR(config-if)#frame-relay intf-ty dce
FR(config-if)#clock rate 64000
FR(config-if)#frame-relay lmi-type cisco
FR(config-if)#frame-relay route 102 int s0/1 201
FR(config-if)#frame-relay route 103 int s0/2 301
FR(config-if)#exit
FR(config)#int s0/1
FR(config-if)#no sh
FR(config-if)#no ip add
FR(config-if)#en fr
FR(config-if)#frame-relay intf-type dce
FR(config-if)#clock rate 64000
FR(config-if)#frame-relay lmi-type cisco
FR(config-if)#frame-relay route 201 int s0/0 102
FR(config-if)#exit
FR(config)#int s0/2
FR(config-if)#no ip add
FR(config-if)#no sh
FR(config-if)#en fr
FR(config-if)#frame-relay intf-ty dce
FR(config-if)#clock rate 64000
FR(config-if)#frame-relay lmi-type cisco
FR(config-if)#frame-relay route 301 int s0/0 103
FR(config-if)#exit
R1:
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#ip ospf net point-to-point
R1(config-if)#exit
R1(config)#int s0/0
R1(config-if)#no ip add
R1(config-if)#no sh
R1(config-if)#en fra
R1(config)#int s0/0.1 multipoint
R1(config-subif)#ip add 10.10.10.1 255.255.255.0
R1(config-subif)#frame-relay map ip 10.10.10.2 102 br
R1(config-subif)#frame-relay map ip 10.10.10.3 103 br
R1(config-subif)#no ip ospf net non-broadcast
//指定为non-broadcast模式
R1(config-subif)#ip ospf priority 255
//修改接口优先级,使中央路由器成为DR
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#net 1.1.1.0 0.0.0.255 area 0
R1(config-router)#net 10.10.10.0 0.0.0.255 area 0
R1(config-router)#neighbor 10.10.10.2
//手工指定邻居,在中央-分支拓扑中,只需将中央路由器设定为DR,并在中央路由器上指定邻居即可,分支路由器不需要再指定。
R1(config-router)#neighbor 10.10.10.3
R1(config-router)#exit
R2:
R2(config)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#ip ospf net point-to-point
R2(config-if)#exit
R2(config)#int s0/0
R2(config-if)#ip add 10.10.10.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#encapsulation frame-relay
R2(config-if)#frame-relay map ip 10.10.10.1 201 br
R2(config-if)#ip ospf network non-broadcast
R2(config-if)#ip ospf priority 0
//将分支路由器接口优先级调为0,不参与选举,为DROTHER
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net 2.2.2.0 0.0.0.255 area 0
R2(config-router)#net 10.10.10.0 0.0.0.255 area 0
R2(config-router)#exit
R3:
R2(config)#int lo 0
R2(config-if)#ip add 3.3.3.3 255.255.255.0
R2(config-if)#ip ospf net point-to-point
R2(config-if)#exit
R3(config)#int s0/0
R3(config-if)#ip add 10.10.10.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#encapsulation frame-relay
R3(config-if)#frame-relay map ip 10.10.10.1 301 br
R3(config-if)#ip ospf network non-broadcast
R3(config-if)#ip ospf priority 0
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 3.3.3.0 0.0.0.255 area 0
R3(config-router)#net 10.10.10.0 0.0.0.255 area 0
R3(config-router)#exit
验证:
R1#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/DROTHER 00:01:56 10.10.10.3 Serial0/0.1
2.2.2.2 0 FULL/DROTHER 00:01:48 10.10.10.2 Serial0/0.1
R2#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 255 FULL/DR 00:01:56 10.10.10.1 Serial0/0
R3#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 255 FULL/DR 00:01:42 10.10.10.1 Serial0/0
R1#sh ip ospf int s0/0.1
Serial0/0.1 is up, line protocol is up
Internet Address 10.10.10.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 255
Designated Router (ID) 1.1.1.1, Interface address 10.10.10.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:24
Supports Link-local Signaling (LLS)
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 2
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 3.3.3.3
Adjacent with neighbor 2.2.2.2
Suppress hello for 0 neighbor(s)
R1#sh ip ro os
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/65] via 10.10.10.2, 00:05:33, Serial0/0.1
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/65] via 10.10.10.3, 00:05:33, Serial0/0.1