配置 OSPF 的 DR 選擇示例


組網需求

RouterA 的優先級為 100,它是網絡上的最高優先級,所以 RouterA 被選為 DR;RouterC 是優先級第二高的,被選為 BDR;

RouterB 的優先級為 0,這意味着它將無法成為 DR 或 BDR; RouterD 沒有配置優先級,取缺省值 1。

1、拓撲圖

image

配置思路

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


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM