OSPF redistribution of loopback addresses

When you assign a loopback address to an OSPF area, the route redistribution of the loopback address is limited to the specified area.

When route redistribution is enabled:
  • The switch advertises a loopback IP address that is not assigned to an OSPF area as an OSPF


    route to its OSPF neighbors, and handles it as a connected route.

  • The switch advertises a loopback address that is assigned to an OSPF area as an OSPF



To enable redistribution of loopback IP addresses in OSPF, enter the redistribution connected command as described in Enabling route redistribution.


Assigning loopback IP addresses to OSPF areas

The loopback IP address of loopback 2 is advertised only in OSPF area The IP addresses and of loopback 1 are advertised in all OSPF areas. The lines in bold below show that the IP address of loopback interface 2 is assigned to OSPF area 111.

switch(config)# interface loopback 1
switch(lo-1)# ip address
switch(lo-1)# ip address
switch(lo-1)# exit
switch(config)# interface loopback 2
switch(lo-2)# ip address
switch(lo-2)# ip ospf area
switch(lo-2)# exit

Verifying OSPF redistribution of loopback interfaces

To verify the OSPF redistribution of loopback interfaces, enter the show ip routecommand from any context level to display IP route table entries.

In this example, a loopback address assigned to an area is displayed as an ospf intra-area (internal) route to its neighbor; a loopback address not assigned to a specific area is displayed as an ospf external route:

switch(config)# show ip route

                 IP Route Entries
Destination     Gateway      VLAN  Type  Sub-Type   Metric   Dist
-----------     -------      ----  ----  --------   ------   ----   25    ospf  external2   10      110   25    ospf  intra-area  2       110