Loopback Interfaces

OSPF uses the highest IP address configured on an active interface as its RID. If the interface associated with this IP address is ever unavailable, or if the address is removed, the OSPF process must recalculate a new RID and flood all its routing information out its interfaces.

The highest IP address on a router would be the largest numerical IP address assigned to an active interface.

If a loopback interface is configured with an IP address, OSPF defaults to using this IP address as its RID, even if other interfaces have higher IP addresses. Because loopback interfaces never go down, greater stability throughout your OSPF network is achieved.

TIP You cannot tell OSPF to use a particular interface as its RID. It has built-in defaults that force it to accept a loopback interface first and then accept the highest IP address on any interface.

Configuring a Loopback Interface

As previously discussed, the use of a loopback interface forces the selection by OSPF of its RID. The default method to determine the OSPF RID for Cisco routers is loopback interface and then the highest IP address assigned to an interface. The use of a loopback interface enables you to assign the RID. This can be very beneficial. Because a loopback interface is not a physical interface, like Ethernet, you must create it.

You can configure a loopback interface by executing the interface loopback 0 command in the router configuration mode. Example 5-2 demonstrates the process.

Example 5-2 Configuring a Loopback Interface

Trinity# config terminal

Enter configuration commands, one per line. End with CNTL/Z. Trinity(config)# interface loopback 0

Trinity(config-if)# ip address 10.251.11.1 255.255.255.255 Trinity(config-if)# description Configured to be OSPF Router ID

Routing Loopback Interfaces

Loopback interfaces have a unique characteristic about them when used in OSPF. In accordance with RFC 2328 (page 129, third bullet), loopback interfaces are advertised as /32 host routes. This is an interesting aspect of what you find in a routing table. Consider the routing table in Example 5-3, where the /32 is preserved throughout the network, regardless of the mask that is assigned to the loopback interfaces.

Example 5-3 Loopback Advertised in a Routing Table as a /32

HAL9000#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR

Gateway of last resort is 192.168.254.1 to network 0.0.0.0

continues

Gateway of last resort is 192.168.254.1 to network 0.0.0.0

continues

266 Chapter 5: Routing Concepts and Configuration

Example 5-3 Loopback Advertised in a Routing Table as a /32 (Continued)

51

.0.1

9.0/32 is subnetted,

5 subnets

O

IA

51

0.16.1

110/77] via

192.168.254

71,

00

00

09,

Ethernet0

O

IA

51

0.17.1

110/77] via

192.168.254

71,

00

00

09,

Ethernet0

O

IA

51

0.18.1

110/77] via

192.168.254

71,

00

00

09,

Ethernet0

O

IA

51

0.19.1

110/77] via

192.168.254

71,

00

00

09,

Ethernet0

O

IA

51

0.20.1

110/77] via

192.168.254

71,

00

00

09,

Ethernet0

1.

0.0

0/32 is

subnetted, 1

subnets

O

.0/32

10/11] via 192.168.254.71 is subnetted, 5 subnets

00

00

10

Ethernet0

<s

1

[110/75] via 192.168.254

71,

00

00

10, Ethernet0

O

100

0.21.

1

[110/75] via 192.168.254

71,

00

00

10, Ethernet0

O

100

0.22.

1

[110/75] via 192.168.254

71,

00

00

10, Ethernet0

O

100

0.23.

1

[110/75] via 192.168.254

71,

00

00

10, Ethernet0

O

100

2 0.

1

[110/75] via 192.168.254

71,

00

00

10, Ethernet0

Was this article helpful?

0 0

Post a comment