Introduction
This document describes the Open Shortest Path First (OSPF) Link State Advertisement (LSA) Type 5 External Route Selection mechanism. It presents a network scenario with the configuration for how to select the route received from one Autonomous System Boundary Router (ASBR) over another.
Prerequisites
Requirements
Cisco recommends that you have knowledge of OSPF and IP Routing.
Components Used
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Background Information
If you redistribute routes into OSPF from other routing protocols or from static, it causes these routes to become OSPF-external routes. External routes fall under two categories, external type 1 (O E1) and external type 2 (O E2).
The difference between the two is in the way the cost (metric) of the route is calculated. The cost of a Type 2 route is always the external cost, irrespective of the interior cost to reach that route. A Type 1 cost is the addition of the external cost and the internal cost used to reach that route. A Type 1 route is always preferred over a Type 2 route for the same destination.
Configure
Network Diagram
Consider this network topology to check the LSA Type 5 received on R4 in Area 0 that originated from ASBRs in Area 1. R2 and R3 are Area Border Routers (ABRs).
Configurations
For simplicity, this configuration redistributes the static route on ASBRs in Area 1 Router R5 and R1.
R5# ip route 192.168.1.1 255.255.255.255 Null0 router ospf 1 redistribute static subnets network 10.5.5.5 0.0.0.0 area 1 network 10.10.25.5 0.0.0.0 area 1 |
R1# ip route 192.168.1.1 255.255.255.255 Null0
router ospf 1 redistribute static subnets network 10.1.1.1 0.0.0.0 area 1 network 10.10.13.1 0.0.0.0 area 1 |
Note: If a metric is not specified, OSPF puts a default value of 20 when it redistributes routes from all protocols except Border Gateway Protocol (BGP) routes, which receive a metric of 1. When there is a major net that is subnetted, you must use the keyword subnet in order to redistribute protocols into OSPF. Without this keyword, OSPF only redistributes major nets that are not subnetted.
Verify
You can use these commands in order to verify the redistribution:
R5#show ip ospf
Routing Process "ospf 1" with ID 10.5.5.5
Start time: 00:06:18.188, Time elapsed: 00:26:04.176
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
It is an autonomous system boundary router
Redistributing External Routes from,
static, includes subnets in redistribution
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 2. Checksum Sum 0x010F34
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area 1
Number of interfaces in this area is 2 (1 loopback)
Area has no authentication
SPF algorithm last executed 00:22:45.848 ago
SPF algorithm executed 2 times
Area ranges are
Number of LSA 11. Checksum Sum 0x03C19D
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
R1#show ip ospf
Routing Process "ospf 1" with ID 10.1.1.1
Start time: 00:07:09.376, Time elapsed: 00:27:30.368
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
It is an autonomous system boundary router
Redistributing External Routes from,
static, includes subnets in redistribution
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 2. Checksum Sum 0x010F34
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area 1
Number of interfaces in this area is 2 (1 loopback)
Area has no authentication
SPF algorithm last executed 00:24:42.268 ago
SPF algorithm executed 2 times
Area ranges are
Number of LSA 11. Checksum Sum 0x076A33
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
So from both the ASBR Routers, R5 and R1 redistribute the static routes. In order to check the redistributed route on Router R4 for prefix 192.168.1.1/32, enter this command:
R4#show ip route 192.168.1.1 255.255.255.255
Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 2
Last update from 10.10.24.2 on FastEthernet0/0, 00:25:43 ago
Routing Descriptor Blocks:
* 10.10.34.3, from 10.1.1.1, 00:26:44 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
10.10.24.2, from 10.5.5.5, 00:25:43 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
This shows that both of the routes originated from 10.1.1.1 (R1) and that 10.5.5.5 (R5) is installed in the routing table with the metric 20.
This can also be checked in the OSPF Database:
As mentioned earlier, the metric value is set by default to 20 when the routes are redistributed into OSPF. Next, define the value 10 while you redistribute on ASBR 10.1.1.1 (R1) and check the output on Router 4.
Here are the changes implemented on R1:
R1(config)#router ospf 1
R1(config-router)#redistribute static subnets metric 10
Here is the Routing Table on R4:
R4#show ip route 192.168.1.1 255.255.255.255
Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 10, type extern 2, forward metric 2
Last update from 10.10.34.3 on FastEthernet0/1, 00:00:09 ago
Routing Descriptor Blocks:
* 10.10.34.3, from 10.1.1.1, 00:00:09 ago, via FastEthernet0/1
Route metric is 10, traffic share count is 1
There is only one entry in the Routing Table. Check the OSPF database further for this External LSA.
Forward Metric
The Forward Metric is the cost to reach ASBR from the router. This can be checked with these commands:
R4#show ip ospf border-routers
OSPF Router with ID (10.4.4.4) (Process ID 1)
Base Topology (MTID 0)
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 10.3.3.3 [1] via 10.10.34.3, FastEthernet0/1, ABR, Area 0, SPF 3
I 10.1.1.1 [2] via 10.10.34.3, FastEthernet0/1, ASBR, Area 0, SPF 3
i 10.2.2.2 [1] via 10.10.24.2, FastEthernet0/0, ABR, Area 0, SPF 3
I 10.5.5.5 [2] via 10.10.24.2, FastEthernet0/0, ASBR, Area 0, SPF 3
In this output, the cost to reach ASBRs (R1 and R5) is 2 from Router R4. By default, the cost for FastEthernet Interface in OSPF is 1. So in this case, the cost is 2 from R4 to reach R1 or R5: Forward Metric = Router cost to reach ABR (1) + ABR cost to reach the ASBR (1) = 2.
Change the redistribution metric to 10 on R5 as well, so both of the routes are installed again on the Routing Table.
Here are the changes implemented on R1:
R5(config)#router ospf 1
R5(config-router)#redistribute static subnets metric 10
Here is the Routing Table on R4:
R4#show ip route 192.168.1.1 255.255.255.255
Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 10, type extern 2, forward metric 2
Last update from 10.10.24.2 on FastEthernet0/0, 00:00:12 ago
Routing Descriptor Blocks:
* 10.10.34.3, from 10.1.1.1, 00:12:05 ago, via FastEthernet0/1
Route metric is 10, traffic share count is 1
10.10.24.2, from 10.5.5.5, 00:00:12 ago, via FastEthernet0/0
Route metric is 10, traffic share count is 1
Change the cost to reach one of the ASBRs but with same redistribution metric and check the same output.
Increase the OSPF Cost on fa0/1 for Router R4:
R4(config)#int fa0/1
R4(config-if)#ip ospf cost 10
Check the Forward Metric. It shows that now the cost to reach ASBR R1 is 11:
R4#show ip ospf border-routers
OSPF Router with ID (10.4.4.4) (Process ID 1)
Base Topology (MTID 0)
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 10.3.3.3 [10] via 10.10.34.3, FastEthernet0/1, ABR, Area 0, SPF 7
I 10.1.1.1 [11] via 10.10.34.3, FastEthernet0/1, ASBR, Area 0, SPF 7
i 10.2.2.2 [1] via 10.10.24.2, FastEthernet0/0, ABR, Area 0, SPF 7
I 10.5.5.5 [2] via 10.10.24.2, FastEthernet0/0, ASBR, Area 0, SPF 7
Here is the Routing Table on R4:
R4#show ip route 192.168.1.1 255.255.255.255
Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 10, type extern 2, forward metric 2
Last update from 10.10.24.2 on FastEthernet0/0, 00:02:17 ago
Routing Descriptor Blocks:
10.10.24.2, from 10.5.5.5, 00:07:11 ago, via FastEthernet0/0
Route metric is 10, traffic share count is 1
So the route with the lower Forward Metric is installed in the Routing Table.
In summary, when you have multiple entries for Type 5 LSA, the first preference is given to the metric (Redistributed metric). The route with the lower metric is installed in the Routing Table. The second preference is given to the Forward Metric, if the redistributed metric is same. The route with the lower Forward Metric is installed in the Routing Table.
Troubleshoot
There is currently no specific troubleshooting information available for this configuration.