配置 OSPF 的 DR 选择示例
组网需求
RouterA 的优先级为 100,它是网络上的最高优先级,所以 RouterA 被选为 DR;RouterC 是优先级第二高的,被选为 BDR;
RouterB 的优先级为 0,这意味着它将无法成为 DR 或 BDR; RouterD 没有配置优先级,取缺省值 1。
1、拓扑图
配置思路
OSPF 的 DR 选择:
1. 配置各路由器上 router id,使能 OSPF,指定网段。
2. 在缺省优先级情况下,查看各路由器 DR/BDR 状态。
3. 配置接口上的 DR 优先级,查看 DR/BDR 状态。
1. 配置各路由器上 router id,使能 OSPF,指定网段。 (本配置省略)
2. 在缺省优先级情况下,查看各路由器 DR/BDR 状态。
[AR1]dis 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: 1 DR: 192.168.1.4 BDR: 192.168.1.3 MTU: 0 Dead timer due in 35 sec Retrans timer interval: 5 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: 1 DR: 192.168.1.4 BDR: 192.168.1.3 MTU: 0 Dead timer due in 39 sec Retrans timer interval: 5 Neighbor is up for 00:05:48 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.4 BDR: 192.168.1.3 MTU: 0 Dead timer due in 36 sec Retrans timer interval: 0 Neighbor is up for 00:09:40 Authentication Sequence: [ 0 ] [AR1]
优先级相同时,router id 高的被选举为DR,第二高的选举为BDR.
D为DR,C为BDR.
3. 配置接口上的 DR 优先级,查看 DR/BDR 状态。
路由器A
[AR1]int g0/0/0 [AR1-GigabitEthernet0/0/0]ospf dr-priority 100 [AR1-GigabitEthernet0/0/0]quit
路由器B
[AR2]int g0/0/0 [AR2-GigabitEthernet0/0/0]ospf dr-priority 0
路由器C
[AR3]int g0/0/0 [AR3-GigabitEthernet0/0/0]ospf dr [AR3-GigabitEthernet0/0/0]ospf dr-priority 2
重启OSPF进程,用户视图下:reset ospf 1 process
路由器A查看各节点身份
[AR1]dis 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: 0 DR: 192.168.1.1 BDR: 192.168.1.3 MTU: 0 Dead timer due in 37 sec Retrans timer interval: 4 Neighbor is up for 00:00:55 Authentication Sequence: [ 0 ] Router ID: 3.3.3.3 Address: 192.168.1.3 State: Full Mode:Nbr is Master Priority: 2 DR: 192.168.1.1 BDR: 192.168.1.3 MTU: 0 Dead timer due in 38 sec Retrans timer interval: 5 Neighbor is up for 00:00:47 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.3 MTU: 0 Dead timer due in 36 sec Retrans timer interval: 5 Neighbor is up for 00:00:03 Authentication Sequence: [ 0 ] [AR1]
路由器A优先级为100的变成了DR,优先级为2的变成了BDR。优先级为0的不参与选举。
读书和健身总有一个在路上