Content

| 6.3 |  | OSPF Configuration and Verification |
| 6.3.2 |  | Optional configuration commands |

Configuring a Loopback Address
When the OSPF process starts, the Cisco IOS uses the highest local IP address as its OSPF router ID. If a loopback interface is configured, that address is used, regardless of its value. An IP can be assigned to a loopback interface with the following commands:

> Router(config)#interface loopback number
> Router(config-if)#ip address ip-address subnet-mask

A loopback derived router ID ensures stability because that interface is immune to link failure. The loopback interface must be configured before the OSPF process starts, to override the highest interface IP address.

It is recommended that the loopback address be used on all key routers in the OSPF based network. To avoid routing problems, it is good practice to use a 32-bit subnet mask when configuring a loopback IP address, shown as follows:

> Router(config)#interface loopback0
> Router(config-if)#ip address 192.168.1.1 255.255.255.255

A 32-bit mask is sometimes called a host mask, because it specifies a single host and not a network or subnetwork.

> Note: To prevent propagation of bogus or fake routes, OSPF always advertises loopback addresses as host routes, with a 32-bit mask.

Modifying OSPF Router Priority
The DR or BDR elections can be manipulated by configuring the priority value to a number other than the default value, which is one (1). A value of zero (0) guarantees that the router will not be elected as a DR or BDR. Each OSPF interface can announce a different priority. Configure the priority value, a number from 0 to 255, with the ip ospf priority command, which has the following syntax:

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

To set the E0 FastEthernet interface on a router with a priority of zero (0) use the commands that follow:

> Note: Set zero priority so it cannot win DR/BDR elections on that network.

> RTB(config)#interface e0
> RTB(config-if)#ip ospf priority 0

For the priority value to figure into the election, it must be set before the election takes place. The priority value and other key information on the interface can be displayed with the show ip ospf interface command. The output in this example tells which routers have been elected the DR and BDR, the network type, the cost of the link (10), and the timer intervals specific to this interface. In this case, the network type is broadcast multiaccess. The timer intervals configured are Hello (10), Dead (40), Wait (40), and Retransmit (5).

| Lab Activity e-Lab Activity: Optional Configuration Commands The purpose of this lab is to use some optional OSPF commands, specifically on modifying and manipulating OSPF router IDs.