使用广播模式可以避免静态地列出所有的邻接路由器。接口被设置为Broadcast模式后,其行为就像LAN一样,将选举DR和BDR。因此,需确保使用全互联或部分互联拓扑,或者根据接口优先级静态地选择DR。
Router(config)#interface serial 0/0/0
Router(config-if)#encapsulation frame-relay
Router(config-if)#ip ospf network broadcast
实验:
采用全互联拓扑,R1,R2,R3上分别设置Lo0,ip地址分别为1.1.1.1 2.2.2.2 3.3.3.3 ,默认情况下,R3将成为DR。手工指定R1为DR,且R2和R3不参与选举,设置其接口优先级为0。
配置:
FR:
frame-relay switching
int s0/0
no ip add
no sh
bandwidth xxxx
encapsulation frame-relay
frame-relay lmi-type cisco
frame-relay intf-type dce
clockrate 56000 !
frame-relay route 102 int s0/1 201
frame-relay route 103 int s0/2 301
int s0/1
no ip add
no sh
encapsulation frame-relay
frame-relay intf-type dce
clockrate 56000
frame-relay route 201 int s0/0 102
frame-relay route 203 int s0/2 302
int s0/2
no ip add
no sh
encapsulation frame-relay
frame-relay intf-type dce
clockrate 56000
frame-relay route 301 int s0/0 103
frame-relay route 302 int s0/1 203
R1:
interface Serial0/0
ip address 192.168.1.1 255.255.255.0
encapsulation frame-relay
serial restart-delay 0
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
ip ospf priority 255 //指定接口优先级为255,使之成为DR
ip ospf network broadcast //指定OSPF网络类型为Broadcast
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
R2:(接口配置)
interface Serial0/1
ip address 192.168.1.2 255.255.255.0
encapsulation frame-relay
ip ospf network broadcast
ip ospf priority 0
serial restart-delay 0
frame-relay map ip 192.168.1.1 201 broadcast
frame-relay map ip 192.168.1.2 201 broadcast
frame-relay map ip 192.168.1.3 203 broadcast
R3:(接口配置)
interface Serial0/2
ip address 192.168.1.3 255.255.255.0
encapsulation frame-relay
ip ospf network broadcast
ip ospf priority 0
serial restart-delay 0
frame-relay map ip 192.168.1.1 301 broadcast
frame-relay map ip 192.168.1.2 302 broadcast
frame-relay map ip 192.169.1.3 301 broadcast
验证:
R1#sh ip ospf int 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 BROADCAST, Cost: 64
Transmit Delay is 1 sec, State DR, Priority 255
Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
No backup designated router on this network
Old designated Router (ID) 3.3.3.3, Interface address 192.168.1.3
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
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 1
Last flood scan time is 4 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 2.2.2.2
Adjacent with neighbor 3.3.3.3
Suppress hello for 0 neighbor(s)
R1#sh ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/DROTHER 00:00:39 192.168.1.2 Serial0/0
3.3.3.3 0 FULL/DROTHER 00:00:30 192.168.1.3 Serial0/0
R1#sh ip ro os
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/65] via 192.168.1.2, 00:00:05, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/65] via 192.168.1.3, 00:00:05, Serial0/0