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. You can assign an IP 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 you use the
loopback address on all key routers in your OSPF-based network. To avoid
routing problems, it is good practice to use a 32-bit subnet mask when
configuring a loopback IP address, as shown:
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 routes, OSPF always advertises
loopback addresses as host routes, with a 32-bit mask.
Modifying OSPF Router Priority
You can manipulate DR/BDR elections by configuring the priority value to
a number other than the default value, which is 1. A value of 0
guarantees that the router will not be elected as a DR or BDR. Each OSPF
interface can announce a different priority. You can 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 a router's E0 with a priority of 0
(so that it can not win DR/BDR elections on that network), you would use
the commands shown here:
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. An interface's
priority value and other key information can be displayed with the show
ip ospf interface command as
shown in the figure.
The output in this example tells which routers have been elected the DR
and BDR, the network type (in this case, broadcast multiaccess), the
cost of the link (10), and the timer intervals specific to this
interface. The timer intervals configured are Hello (10), Dead (40),
Wait (40), Retransmit (5).
|