实验要求:
R4作为DR;
R3作为BDR;
R2不参与选举 。
实验步骤:
①划分网段
②配环回口,配接口ip
③配置ospf进程
[r1]
ospf 1
area 0
network 192.168.1.0 0.0.0.255
查看ospf进程状态:
display ospf peer
<r1>display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 192.168.1.1(GigabitEthernet0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 192.168.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.1.1 BDR: 192.168.1.2 MTU: 0
Dead timer due in 32 sec
Retrans timer interval: 5
Neighbor is up for 00:07:37
Authentication Sequence: [ 0 ]
Router ID: 3.3.3.3 Address: 192.168.1.3
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.1.1 BDR: 192.168.1.2 MTU: 0
Dead timer due in 32 sec
Retrans timer interval: 5
Neighbor is up for 00:07:15
Authentication Sequence: [ 0 ]
Router ID: 4.4.4.4 Address: 192.168.1.4
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.1.1 BDR: 192.168.1.2 MTU: 0
Dead timer due in 34 sec
Retrans timer interval: 5
Neighbor is up for 00:06:39
Authentication Sequence: [ 0 ]
可以看到现在的状态不满足实验要求
④修改接口优先级
[r4-GigabitEthernet0/0/0]ospf dr-priority 100
[r3-GigabitEthernet0/0/0]ospf dr-priority 50
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
DR和BDR的选举规则:
1>先比较接口优先级,优先级大的为DR,次大的为BDR。
华为设备默认优先级为1,如果优先级为0,则代表该接口放弃选举
2>若人为不干预,优先级相同都为1,则比较RID,大的为DR,次大的为BDR。
⑤重启ospf进程(<>模式下):一定要全部路由器同时进行
reset ospf 1 process
再次查看状态:
<r1>display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 192.168.1.1(GigabitEthernet0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 192.168.1.2
State: 2-Way Mode:Nbr is Master Priority: 0
DR: 192.168.1.4 BDR: 192.168.1.3 MTU: 0
Dead timer due in 36 sec
Retrans timer interval: 0
Neighbor is up for 00:00:00
Authentication Sequence: [ 0 ]
Router ID: 3.3.3.3 Address: 192.168.1.3
State: Full Mode:Nbr is Master Priority: 50
DR: 192.168.1.4 BDR: 192.168.1.3 MTU: 0
Dead timer due in 36 sec
Retrans timer interval: 4
Neighbor is up for 00:00:37
Authentication Sequence: [ 0 ]
Router ID: 4.4.4.4 Address: 192.168.1.4
State: Full Mode:Nbr is Master Priority: 100
DR: 192.168.1.4 BDR: 192.168.1.3 MTU: 0
Dead timer due in 33 sec
Retrans timer interval: 5
Neighbor is up for 00:00:40
Authentication Sequence: [ 0 ]
已满足实验要求,实验结束。