IP OSPF Priority Command on CISCO Router/Switch

Command

IP OSPF Priority

Use

This command is used to manually set the DR election priority of a link. By default all links are equal with a priority of 1. Higher is better. A priority of 0 is used to prevent a router from ever becoming DR which is useful in hub and spoke topologies where the hub must be the DR.
Note: OSPF does not support preemption, meaning that if a router with a higher priority joins the network it will not become DR unless the elected DR goes down.

Syntax

Router(config-if)#ip ospf priority <number>

Example

In this example, we will use priority to make sure R4 is elected DR for the frame-relay network..

First, we will configure R4 with the highest priority to ensure it will always win an election.

R4(config)#int s0/0
R4(config-if)#ip ospf priority 255

Next, we will set R1 to have a priority of 0 so it can never win.

R1(config)#int s1/0
R1(config-if)#ip ospf priority 0

We then do the same with R3.

R3(config)#int s1/0
R3(config-if)#ip ospf priority 0

Since frame-relay has a default non-broadcast network type, we will either need to add neighbor statements or use a broadcast network type.
We can see that R4 is indeed the DR.

R4(config-if)#ip ospf network broadcast

*Mar 1 01:57:23.803: %OSPF-5-ADJCHG: Process 1, Nbr 111.111.111.111 on Serial0/0 from LOADING to FULL, Loading Done
*Mar 1 01:57:23.807: %OSPF-5-ADJCHG: Process 1, Nbr 133.133.133.133 on Serial0/0 from LOADING to FULL, Loading Done

R4(config-if)#do show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
111.111.111.111 0 FULL/DROTHER 00:00:34 10.4.4.1 Serial0/0
133.133.133.133 0 FULL/DROTHER 00:00:34 10.4.4.3 Serial0/0
R4(config-if)#

Related Articles

Leave a Reply

avatar