When two routers attached to a network both attempt to become the designated router, the one with the highest router priority takes precedence. A router whose router priority is set to 0 is ineligible to become the designated router on the attached network. Router priority is specified per router interface and is advertised in hello packets sent out by the interface.
Use the ip ospf priority command in interface configuration command mode to specify the router priority that will be specified for LSAs going out this interface. See Configuring the Designated Router for a router priority configuration example.
OSPF Designated Router Topology displays a designated router topology example. The example will configure the four displayed routers with the following priorities:
Router 4 will not take part in the election process at all. Router 3 has the highest priority and therefore will be elected DR. Router 1 has the second highest priority and will be elected BDR.
The following example provides the input required to configure the designated router topology as displayed in OSPF Designated Router Topology:
Router 1(rw)->configure Router 1(rw-config)->interface vlan 1 Router 1(rw-config-intf-vlan.0.1)->ip ospf priority 25 Router 1(rw-config-intf-vlan.0.1)->exit Router 1(rw-config)->
Router 2(rw)->configure Router 2(rw-config)->interface vlan 1 Router 2(rw-config-intf-vlan.0.1)->ip ospf priority 10 Router 2(rw-config-intf-vlan.0.1)->exit Router 2(rw-config)->
Router 3(rw)->configure Router 3(rw-config)->interface vlan 1 Router 3(rw-config-intf-vlan.0.1)->ip ospf priority 30 Router 3(rw-config-intf-vlan.0.1)->exit Router 3(rw-config)->
Router 4(rw)->configure Router 4(rw-config)->interface vlan 1 Router 4(rw-config-intf-vlan.0.1)->ip ospf priority 0 Router 4(rw-config-intf-vlan.0.1)->exit Router 4(rw-config)->