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

    external

    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

    internal

    route.

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

Example

Assigning loopback IP addresses to OSPF areas

The loopback IP address 13.3.4.5 of loopback 2 is advertised only in OSPF area 0.0.0.111. The IP addresses 14.2.3.4 and 15.2.3.4 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 14.2.3.4
switch(lo-1)# ip address 15.2.3.4
switch(lo-1)# exit
switch(config)# interface loopback 2
switch(lo-2)# ip address 13.3.4.5
switch(lo-2)# ip ospf 15.2.3.4 area 0.0.0.111
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
-----------     -------      ----  ----  --------   ------   ----
20.0.15.1/32   25.0.67.131   25    ospf  external2   10      110
20.0.16.2/32   25.0.67.131   25    ospf  intra-area  2       110