1. 程式人生 > 實用技巧 >配置 OSPF 的 DR 選擇示例

配置 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的不參與選舉。


讀書和健身總有一個在路上