Assigning loopback addresses to an area
Optional: After you define the OSPF areas to which the switch belongs, you can assign a user-defined loopback address to an OSPF area. A loopback interface is a virtual interface configured with an IP address and is always reachable as long as at least one of the IP interfaces on the switch is operational. Because the loopback interface is always up, you ensure that the switch's router ID remains constant and that an OSPF network is protected from changes caused by downed interfaces.
For more information, see the management and configuration guide for your switch.
Syntax:
interface loopback 0-7 ip ospf lo-ipaddress area ospf-area-id
Executed in a specific loopback context to assign a loopback interface to the specified OSPF area. Requires that the specified loopback interface is already configured with an IP address on the switch.
interface loopback 0-7
Defines the loopback context for executing the area assignment.
ip ospf lo-ipaddress
Specifies the loopback interface by its IP address to assign to a configured OSPF area.
area ospf-area-id
Identifies the OSPF area to which the loopback interface is assigned.
You can enter a value for the OSPF area in the format of an IP address or a number in the range 0 to 4,294,967,295.
Example:
To assign user-defined loopback interface 3 on the switch to area 192.5.0.0 and include the loopback IP address 172.16.112.2 in the OSPF broadcast area, enter the following commands:
switch(config)# interface loopback 3 switch(lo-3)# ip ospf 172.16.112.2 area 192.5.0.0
Syntax:
interface loopback 0-7# ip ospf lo-ip-address cost number
Executed in a specific loopback context to modify the cost used to advertise the loopback address (and subnet) to the area border router (ABR.) Requires that the specified loopback interface is already configured with an IP address on the switch.
loopback interface 0-7
Defines the loopback context for executing the cost assignment.
ip ospf lo-ip-address
Specifies the loopback interface by its IP address.
cost number
Specifies a number that represents the administrative metric associated with the loopback interface. Valid values are from 1 to 65535.
Default: 1.
Example
To configure a cost of 10 for advertising the IP address 172.16.112.2 configured for loopback interface 3 in an OSPF area 192.5.0.0, enter the following commands:
switch(config)# interface loopback 3 switch(lo-3)# ip ospf 172.16.112.2 area 192.5.0.0 switch(lo-3)# ip ospf 172.16.112.2 cost 10