Friday, December 17, 2010

Redistribution into OSPF ccna coaching in delhi

Network Bulls
www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192

As you might expect, OSPF redistribution has several similarities and differences as compared
to redistribution into EIGRP. Unlike EIGRP, OSPF does have useful default metrics
for redistributed routes, but OSPF does use the same general methods to configure metrics
for redistributed routes. Like EIGRP, OSPF flags redistributed routes as being external. Unlike
EIGRP, OSPF creates LSAs to represent each external route, and OSPF must then apply
some much different logic than EIGRP to calculate the best route to each external subnet.
This section examines the OSPF redistribution process and configuration. It also discusses
background on three OSPF LSA Types—Types 4, 5, and 7—all created to help OSPF distribute
information so that routers can calculate the best route to each external subnet.
OSPF redistribute Command Reference
First, for reference, the following lines show the generic syntax of the redistribute command
when used as a router ospf subcommand. Note that the syntax differs slightly depending
on the routing protocol into which routes will be redistributed. Following that,
Table 9-4 lists the options on the command with a brief description:
redistribute protocol [process-id | as-number] [metric metric-value] [metric-type
type-value] [match {internal | external 1 | external 2 | nssa-external}] [tag
tag-value] [route-map map-tag] [subnets]
Table 9-4 Parameters on the OSPF redistribute Command
Option Description
protocol The source of routing information. Includes RIP, OSPF, EIGRP, IS-IS,
BGP, connected, and static.
process-id, as-number If redistributing a routing protocol that uses a process-id or ASN on
the router global config command, use this parameter to refer to that
process or ASN value.
Key
Topic
www.CareerCert.info
Configuring OSPF Redistribution with Minimal Parameters
The redistribute subcommand under router ospf has many optional settings. To better
appreciate some of these settings, this section first examines the results when using all
defaults, using as few parameters as possible. Following the discussion of the behavior
with defaults, the next examples add the parameters that complete the redistribution
configuration.
Redistribution into OSPF uses the following defaults:
■ When taking from BGP, use a default metric of 1.
■ When taking from another OSPF process, take the source route’s metric.
■ When taking from all other sources, use a default metric of 20.
■ Create a Type 5 LSA for each redistributed route (external) if not inside an NSSA
area; create a Type 7 LSA if inside an NSSA area.
■ Use external metric type 2.
■ Redistribute only routes of classful (class A, B, and C) networks, and not routes for
subnets.
306 CCNP ROUTE 642-902 Official Certification Guide
Key
Topic
Table 9-4 Parameters on the OSPF redistribute Command
Option Description
metric Defines the cost metric assigned to routes redistributed by this
command, unless overridden by a referenced route map.
metric-type {1 | 2} Defines the external metric type for the routes redistributed by this
command: 1 (E1 routes) or 2 (E2 routes).
match If redistributing from another OSPF process, this keyword lets you
match internal OSPF routes, external (by type), and NSSA external
routes, essentially filtering which routes are redistributed.
tag Assigns a unitless integer value to the routes redistributed by this
command—a tag that can be later matched by other routers using a
route-map.
route-map Apply the logic in the referenced route-map to filter routes, set
metrics, and set route tags.
subnets Redistribute subnets of classful networks. Without this parameter,
only routes for classful networks are redistributed. (This behavior is
unique to the OSPF redistribute command.)
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 307
To demonstrate OSPF redistribution, this section uses an example that uses the same internetwork
shown in Figure 9-6, including the baseline configuration shown in Example 9-1,
and the EIGRP redistribution configuration shown in Examples 9-2 and 9-4. Essentially,
the upcoming OSPF examples begin with Router RD1 including all the configurations seen
in all the earlier examples in this chapter. According to those examples, OSPF has been
correctly configured on the routers on the right side of Figure 9-6, EIGRP has been configured
on the left, and the configuration of redistribution of OSPF routes into EIGRP has
been completed. However, no redistribution into OSPF has been configured yet.
For perspective, before showing the redistribution into OSPF, Example 9-7 reviews the
OSPF configuration before adding the redistribution configuration, along with show commands
listing RD1’s IP routing table entries and its OSPF LSDB.
Example 9-7 Router RD1 Routing Protocol Configuration, Before Redistribution into
OSPF
RD1#show run
! lines omitted for brevity
router eigrp 1
redistribute ospf 2
network 172.30.0.0
default-metric 1000 33 255 1 1500
no auto-summary
!
router ospf 2
router-id 1.1.1.1
log-adjacency-changes
network 172.16.0.0 0.0.255.255 area 0
RD1#show ip route 172.30.0.0
Routing entry for 172.30.0.0/16, 5 known subnets
Attached (2 connections)
Variably subnetted with 2 masks
Redistributing via eigrp 1
C 172.30.17.0/30 is directly connected, Serial0/1/1
D 172.30.26.0/23 [90/2172416] via 172.30.17.2, 01:08:50, Serial0/1/1
[90/2172416] via 172.30.12.2, 01:08:50, Serial0/0/0
D 172.30.2.0/23 [90/2172416] via 172.30.12.2, 01:08:50, Serial0/0/0
D 172.30.6.0/23 [90/2172416] via 172.30.17.2, 01:08:50, Serial0/1/1
C 172.30.12.0/30 is directly connected, Serial0/0/0
RD1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 2)
Router Link States (Area 0)
www.CareerCert.info
308 CCNP ROUTE 642-902 Official Certification Guide
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1425 0x80000007 0x007622 4
4.4.4.4 4.4.4.4 1442 0x8000000D 0x00B1E9 4
8.8.8.8 8.8.8.8 1466 0x80000006 0x00640E 4
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.48.4 4.4.4.4 1442 0x80000004 0x007E07
! The following occurs on OSPF internal router R4
R4#show ip route 172.30.0.0
% Network not in table
The output in Example 9-7 shows several important points relative to the upcoming redistribution
configuration. First, by design, the EIGRP domain contains subnets of network
172.30.0.0; router RD1 knows routes for five subnets in this range. RD1 has four LSAs:
three Type 1 Router LSAs (one each for routers RD1, R4, and R8), plus one Type 2 network
LSAs (because only one subnet, 172.16.48.0/25, has elected a DR). Because the design
for this internetwork puts all OSPF routers in area 0, no Type 3 summary LSAs exist
in RD1’s LSDB. Also, because no routers have redistributed external routes into OSPF yet,
no Type 5 external nor Type 7 NSSA external routes are listed, either.
By adding the redistribute eigrp 1 command in OSPF configuration mode, OSPF tries to
redistribute routes from EIGRP–but with no success. The reason is that by omitting the
subnets parameter, OSPF will only redistribute routes for entire classful subnets, and only
if such a route is listed in the IP routing table. Example 9-8 shows the results.
Example 9-8 Redistributing into OSPF from EIGRP 1, all Default Settings
RD1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RD1(config)#router ospf 2
RD1(config-router)#redistribute eigrp 1
% Only classful networks will be redistributed
RD1(config-router)#^Z
RD1#
RD1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 2)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 6 0x80000008 0x007A1B 4
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 309
4.4.4.4 4.4.4.4 1782 0x8000000D 0x00B1E9 4
8.8.8.8 8.8.8.8 1806 0x80000006 0x00640E 4
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.48.4 4.4.4.4 1782 0x80000004 0x007E07
IOS even mentions that only classful routes will be redistributed. As seen in Example 9-7,
no route exists for the exact class B network prefix of 172.30.0.0/16, and by default, OSPF
does not redistribute any subnets inside that range, as noted in the informational message
in Example 9-8. So, the OSPF database on Router RD1 remains unchanged.
By changing the configuration to use the redistribute eigrp 1 subnets command, OSPF
indeed redistributes the routes, as shown in Example 9-9.
Example 9-9 Redistributing from EIGRP into OSPF, with Subnets
RD1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RD1(config)#router ospf 2
RD1(config-router)#redistribute eigrp 1 subnets
RD1(config-router)#^Z
RD1#
May 12 12:49:48.735: %SYS-5-CONFIG_I: Configured from console by console
RD1#show ip ospf database
! omitting the Type 1 and 2 LSA output for brevity
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.30.2.0 1.1.1.1 3 0x80000001 0x008050 0
172.30.6.0 1.1.1.1 3 0x80000001 0x005478 0
172.30.12.0 1.1.1.1 3 0x80000001 0x0005C3 0
172.30.17.0 1.1.1.1 3 0x80000001 0x00CDF5 0
172.30.26.0 1.1.1.1 3 0x80000001 0x007741 0
! The following occurs on router R4
R4#show ip route 172.30.0.0
Routing entry for 172.30.0.0/16, 5 known subnets
Variably subnetted with 2 masks
O E2 172.30.17.0/30 [110/20] via 172.16.14.1, 00:01:10, Serial0/0/0
O E2 172.30.26.0/23 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
O E2 172.30.2.0/23 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
O E2 172.30.6.0/23 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
O E2 172.30.12.0/30 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
www.CareerCert.info
310 CCNP ROUTE 642-902 Official Certification Guide
Table 9-5 Summary of Metric Values When Redistributing into OSPF
Function Command or Metric Values
Default if no metric configuration exists Cost 1 for routes learned from BGP.
If redistributed from another OSPF process, use
the source route’s OSPF cost.
Cost 20 for all other route sources.
Setting the default for all redistribute
commands
The default-metric cost OSPF subcommand.
Key
Topic
After adding the subnets option, router RD1 redistributes the five routes from the EIGRP
domain. Of particular interest:
■ If you look back to Example 9-7’s show ip route command output from Router RD1,
you see three EIGRP-learned routes, plus two connected routes, inside the EIGRP domain.
Example 9-9’s two show commands in Example 9-9 confirm that OSPF redistributes
the three EIGRP-learned routes, plus the two connected subnets on which
EIGRP is enabled (172.30.12.0/30 and 172.30.17.0/30).
■ The show ip ospf database command in Example 9-9 lists R1 (RID 1.1.1.1) as the advertising
router of the five new Type 5 LSAs, because RD1 (with RID 1.1.1.1) created
each Type 5 LSA.
■ Per OSPF internal router R4’s show ip route 172.30.0.0 command at the end of
Example 9-9, the external metric type is indeed E2, meaning external type 2.
■ Per that same command on router R4, the metric for each route is 20. The reasoning is
that the default metric is 20 when redistributing from EIGRP into OSPF, and with an
E2 route, internal OSPF costs are not added to the cost of the route.
That last point regarding the external route type requires a little more discussion. OSPF
defines external routes as either an external type 1 (E1) or external type 2 (E2) route. By
default, the OSPF redistribute command creates Type 2 routes, noting this external route
type in the Type 5 LSA. The difference between the two lies in how OSPF calculates the
metrics for E1 and E2 routes.
The next section completes the discussion of how OSPF can set the metrics when redistributing
routes–or more specifically, the metric as listed in the Type 5 LSA created for
that subnet. Following that, the text takes a detailed look at how OSPF calculates the best
route for E2 routes. Later, a different section titled “Redistributing into OSPF as E1
Routes” discusses the same subject, but for E1 routes.
Setting OSPF Metrics on Redistributed Routes
As mentioned earlier, no matter the source of the redistributed route, OSPF has a default
metric to use. However, OSPF can set the metrics for redistributed routes using the same
options used for EIGRP. Table 9-5 summarizes the defaults and metric setting options for
redistribution into OSPF.
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 311
LSAs and Metrics for External Type 2 Routes
To appreciate how OSPF calculates the possible routes for each E2 route, you need to take
a moment to think about the Type 5 LSA in more detail. First, by definition, the router
that performs the redistribution into OSPF becomes an autonomous system border router
(ASBR) because it injects external routes into OSPF. For each such route, that ASBR creates
a Type 5 LSA for that subnet. The Type 5 LSA includes the following fields:
■ LSID: The subnet number
■ Mask: The subnet mask
■ Advertising router: The RID of the ASBR injecting the route
■ Metric: The metric as set by the ASBR
■ External Metric Type: The external metric type, either 1 or 2
When created, the ASBR floods the Type 5 LSA throughout the area. Then, if any ABRs
exist, the ABRs flood the Type 5 LSAs into any normal (nonstubby) areas. (Note that
ABRs must not forward Type 5 LSAs into any type of stubby area, instead relying on default
routes.) Figure 9-7 shows a sample flooding of the Type 5 LSA for EIGRP subnet
172.30.27.0/23 as an E2 route.
When flooded, OSPF has little work to do to calculate the metric for an E2 route, because
by definition, the E2 route’s metric is simply the metric listed in the Type 5 LSA. In other
words, the OSPF routers do not add any internal OSPF cost to the metric for an E2 route.
Because routers ignore internal cost when calculating E2 external route metrics, whenever
an alternative route can be calculated, the metrics tie. For example, in Figure 9-7, Router R4
has two possible physical routes to ASBR RD1–one directly to RD1, and one through R8.
The cost for both routes to external subnet 172.30.26.0/23 will be 20, because that is the
cost RD1 assigned to the route (actually, the Type 5 LSA) when redistributing the route.
To avoid loops, OSPF routers use a tiebreaker system to allow a router to choose a best
external route. The logic differs slightly depending on whether the router in question resides
in the same area as the ASBR (intra-area), or in a different area (interarea), as discussed
in under the next two headings.
Determining the Next-Hop for Type 2 External Routes–Intra-area
When a router finds multiple routes for the same E2 destination subnet, it chooses the best
route based on the lowest cost to reach any ASBR(s) that advertised the lowest E2 metric.
For example, if five ASBRs all advertised the same subnet as an E2 route, and two ASBRs
Table 9-5 Summary of Metric Values When Redistributing into OSPF
Function Command or Metric Values
Setting the metric for one route source The metric cost parameters on the redistribute
command.
Setting different metrics for routes
learned from a single source
Use the route-map parameter on the redistribute
command.
www.CareerCert.info
312 CCNP ROUTE 642-902 Official Certification Guide
RD1
EIGRP OSPF
R2
R7 R8
Fa0/0
48.4
Fa0/1
4.4
S0/0/0
14.2
172.30.26.0/23
R3 R4
R5
Fa0/0
S0/0/0
35.3
S0/0
35.5
S0/0/0
45.5
S0/0/1
45.4
Area 1
RID
1.1.1.1
Figure 9-7 Flooding of Type 5 LSAs
advertised a metric of 10, and the other three advertised a metric of 20, either of the first
two ASBRs could be used. Then, the router calculates its lowest cost route to reach the
ASBR and uses the next-hop IP address and outgoing interface listed in that route.
The following list spells out the mechanics of the calculation used to break the tie when
multiple equal-cost E2 routes exist for a particular subnet:
Step 1. Find the advertising ASBR(s) as listed in the Type 5 LSA(s) for Type 5 LSAs.
Step 2. Calculate the lowest cost route to reach any of the ASBR(s) based on the intraarea
LSDB topology.
Step 3. Use the outgoing interface and next hop based on the best route to reach the
ASBR (as chosen at Step 2).
Step 4. The route’s metric is unchanged–it is still simply the value listed in the Type 5
LSA.
For example, use Router R4 in Figure 9-7 as an example and the E2 route for
172.30.26.0/23. Before using these four steps, R4 calculated two possible routes for
172.16.26.0/23: an E2 route directly to RD1, and another route through R8. Both routes
use metric 20 in this case, so the routes tie. Because of the tie, R4 proceeds with these
steps as follows:
Step 1. R4 looks in the Type 5 LSA, and sees RID 1.1.1.1 (RD1) is the advertising ASBR.
Key
Topic
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 313
Step 2. R4 then looks at its area 0 LSDB entries, including the Type 1 LSA for RID
1.1.1.1, and calculates all possible area 0 routes to reach 1.1.1.1.
Step 3. R4’s best route to reach RID 1.1.1.1 happens to be through its S0/0/0 interface,
to next-hop RD1 (172.16.14.1), so R4’s route to 172.16.26.0/23 uses
these details.
Step 4. The route lists metric 20, as listed in the Type 5 LSA.
Figure 9-8 shows the interface costs Router R4 will use, based on its LSDB, to calculate
the cost for two possible routes to reach ASBR RD1. Again using subnet 172.30.26.0/23 as
an example, RD1 first looks at the Type 5 external LSA and sees RID 1.1.1.1 as the advertising
ASBR. R4 then calculates the costs based on its intra-area LSDB–but we can perform
the equivalent by adding the interface costs seen in Figure 9-8. Example 9-10 lists the
external Type 5 LSAs, highlighting subnet 172.30.26.0/23, and the interface costs on both
R4 and R8 as seen in the figure.
As you might expect, OSPF redistribution has several similarities and differences as compared
to redistribution into EIGRP. Unlike EIGRP, OSPF does have useful default metrics
for redistributed routes, but OSPF does use the same general methods to configure metrics
for redistributed routes. Like EIGRP, OSPF flags redistributed routes as being external. Unlike
EIGRP, OSPF creates LSAs to represent each external route, and OSPF must then apply
some much different logic than EIGRP to calculate the best route to each external subnet.
This section examines the OSPF redistribution process and configuration. It also discusses
background on three OSPF LSA Types—Types 4, 5, and 7—all created to help OSPF distribute
information so that routers can calculate the best route to each external subnet.
OSPF redistribute Command Reference
First, for reference, the following lines show the generic syntax of the redistribute command
when used as a router ospf subcommand. Note that the syntax differs slightly depending
on the routing protocol into which routes will be redistributed. Following that,
Table 9-4 lists the options on the command with a brief description:
redistribute protocol [process-id | as-number] [metric metric-value] [metric-type
type-value] [match {internal | external 1 | external 2 | nssa-external}] [tag
tag-value] [route-map map-tag] [subnets]
Table 9-4 Parameters on the OSPF redistribute Command
Option Description
protocol The source of routing information. Includes RIP, OSPF, EIGRP, IS-IS,
BGP, connected, and static.
process-id, as-number If redistributing a routing protocol that uses a process-id or ASN on
the router global config command, use this parameter to refer to that
process or ASN value.
Key
Topic
www.CareerCert.info
Configuring OSPF Redistribution with Minimal Parameters
The redistribute subcommand under router ospf has many optional settings. To better
appreciate some of these settings, this section first examines the results when using all
defaults, using as few parameters as possible. Following the discussion of the behavior
with defaults, the next examples add the parameters that complete the redistribution
configuration.
Redistribution into OSPF uses the following defaults:
■ When taking from BGP, use a default metric of 1.
■ When taking from another OSPF process, take the source route’s metric.
■ When taking from all other sources, use a default metric of 20.
■ Create a Type 5 LSA for each redistributed route (external) if not inside an NSSA
area; create a Type 7 LSA if inside an NSSA area.
■ Use external metric type 2.
■ Redistribute only routes of classful (class A, B, and C) networks, and not routes for
subnets.
306 CCNP ROUTE 642-902 Official Certification Guide
Key
Topic
Table 9-4 Parameters on the OSPF redistribute Command
Option Description
metric Defines the cost metric assigned to routes redistributed by this
command, unless overridden by a referenced route map.
metric-type {1 | 2} Defines the external metric type for the routes redistributed by this
command: 1 (E1 routes) or 2 (E2 routes).
match If redistributing from another OSPF process, this keyword lets you
match internal OSPF routes, external (by type), and NSSA external
routes, essentially filtering which routes are redistributed.
tag Assigns a unitless integer value to the routes redistributed by this
command—a tag that can be later matched by other routers using a
route-map.
route-map Apply the logic in the referenced route-map to filter routes, set
metrics, and set route tags.
subnets Redistribute subnets of classful networks. Without this parameter,
only routes for classful networks are redistributed. (This behavior is
unique to the OSPF redistribute command.)
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 307
To demonstrate OSPF redistribution, this section uses an example that uses the same internetwork
shown in Figure 9-6, including the baseline configuration shown in Example 9-1,
and the EIGRP redistribution configuration shown in Examples 9-2 and 9-4. Essentially,
the upcoming OSPF examples begin with Router RD1 including all the configurations seen
in all the earlier examples in this chapter. According to those examples, OSPF has been
correctly configured on the routers on the right side of Figure 9-6, EIGRP has been configured
on the left, and the configuration of redistribution of OSPF routes into EIGRP has
been completed. However, no redistribution into OSPF has been configured yet.
For perspective, before showing the redistribution into OSPF, Example 9-7 reviews the
OSPF configuration before adding the redistribution configuration, along with show commands
listing RD1’s IP routing table entries and its OSPF LSDB.
Example 9-7 Router RD1 Routing Protocol Configuration, Before Redistribution into
OSPF
RD1#show run
! lines omitted for brevity
router eigrp 1
redistribute ospf 2
network 172.30.0.0
default-metric 1000 33 255 1 1500
no auto-summary
!
router ospf 2
router-id 1.1.1.1
log-adjacency-changes
network 172.16.0.0 0.0.255.255 area 0
RD1#show ip route 172.30.0.0
Routing entry for 172.30.0.0/16, 5 known subnets
Attached (2 connections)
Variably subnetted with 2 masks
Redistributing via eigrp 1
C 172.30.17.0/30 is directly connected, Serial0/1/1
D 172.30.26.0/23 [90/2172416] via 172.30.17.2, 01:08:50, Serial0/1/1
[90/2172416] via 172.30.12.2, 01:08:50, Serial0/0/0
D 172.30.2.0/23 [90/2172416] via 172.30.12.2, 01:08:50, Serial0/0/0
D 172.30.6.0/23 [90/2172416] via 172.30.17.2, 01:08:50, Serial0/1/1
C 172.30.12.0/30 is directly connected, Serial0/0/0
RD1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 2)
Router Link States (Area 0)
www.CareerCert.info
308 CCNP ROUTE 642-902 Official Certification Guide
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1425 0x80000007 0x007622 4
4.4.4.4 4.4.4.4 1442 0x8000000D 0x00B1E9 4
8.8.8.8 8.8.8.8 1466 0x80000006 0x00640E 4
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.48.4 4.4.4.4 1442 0x80000004 0x007E07
! The following occurs on OSPF internal router R4
R4#show ip route 172.30.0.0
% Network not in table
The output in Example 9-7 shows several important points relative to the upcoming redistribution
configuration. First, by design, the EIGRP domain contains subnets of network
172.30.0.0; router RD1 knows routes for five subnets in this range. RD1 has four LSAs:
three Type 1 Router LSAs (one each for routers RD1, R4, and R8), plus one Type 2 network
LSAs (because only one subnet, 172.16.48.0/25, has elected a DR). Because the design
for this internetwork puts all OSPF routers in area 0, no Type 3 summary LSAs exist
in RD1’s LSDB. Also, because no routers have redistributed external routes into OSPF yet,
no Type 5 external nor Type 7 NSSA external routes are listed, either.
By adding the redistribute eigrp 1 command in OSPF configuration mode, OSPF tries to
redistribute routes from EIGRP–but with no success. The reason is that by omitting the
subnets parameter, OSPF will only redistribute routes for entire classful subnets, and only
if such a route is listed in the IP routing table. Example 9-8 shows the results.
Example 9-8 Redistributing into OSPF from EIGRP 1, all Default Settings
RD1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RD1(config)#router ospf 2
RD1(config-router)#redistribute eigrp 1
% Only classful networks will be redistributed
RD1(config-router)#^Z
RD1#
RD1#show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 2)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 6 0x80000008 0x007A1B 4
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 309
4.4.4.4 4.4.4.4 1782 0x8000000D 0x00B1E9 4
8.8.8.8 8.8.8.8 1806 0x80000006 0x00640E 4
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.48.4 4.4.4.4 1782 0x80000004 0x007E07
IOS even mentions that only classful routes will be redistributed. As seen in Example 9-7,
no route exists for the exact class B network prefix of 172.30.0.0/16, and by default, OSPF
does not redistribute any subnets inside that range, as noted in the informational message
in Example 9-8. So, the OSPF database on Router RD1 remains unchanged.
By changing the configuration to use the redistribute eigrp 1 subnets command, OSPF
indeed redistributes the routes, as shown in Example 9-9.
Example 9-9 Redistributing from EIGRP into OSPF, with Subnets
RD1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
RD1(config)#router ospf 2
RD1(config-router)#redistribute eigrp 1 subnets
RD1(config-router)#^Z
RD1#
May 12 12:49:48.735: %SYS-5-CONFIG_I: Configured from console by console
RD1#show ip ospf database
! omitting the Type 1 and 2 LSA output for brevity
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.30.2.0 1.1.1.1 3 0x80000001 0x008050 0
172.30.6.0 1.1.1.1 3 0x80000001 0x005478 0
172.30.12.0 1.1.1.1 3 0x80000001 0x0005C3 0
172.30.17.0 1.1.1.1 3 0x80000001 0x00CDF5 0
172.30.26.0 1.1.1.1 3 0x80000001 0x007741 0
! The following occurs on router R4
R4#show ip route 172.30.0.0
Routing entry for 172.30.0.0/16, 5 known subnets
Variably subnetted with 2 masks
O E2 172.30.17.0/30 [110/20] via 172.16.14.1, 00:01:10, Serial0/0/0
O E2 172.30.26.0/23 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
O E2 172.30.2.0/23 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
O E2 172.30.6.0/23 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
O E2 172.30.12.0/30 [110/20] via 172.16.14.1, 00:01:11, Serial0/0/0
www.CareerCert.info
310 CCNP ROUTE 642-902 Official Certification Guide
Table 9-5 Summary of Metric Values When Redistributing into OSPF
Function Command or Metric Values
Default if no metric configuration exists Cost 1 for routes learned from BGP.
If redistributed from another OSPF process, use
the source route’s OSPF cost.
Cost 20 for all other route sources.
Setting the default for all redistribute
commands
The default-metric cost OSPF subcommand.
Key
Topic
After adding the subnets option, router RD1 redistributes the five routes from the EIGRP
domain. Of particular interest:
■ If you look back to Example 9-7’s show ip route command output from Router RD1,
you see three EIGRP-learned routes, plus two connected routes, inside the EIGRP domain.
Example 9-9’s two show commands in Example 9-9 confirm that OSPF redistributes
the three EIGRP-learned routes, plus the two connected subnets on which
EIGRP is enabled (172.30.12.0/30 and 172.30.17.0/30).
■ The show ip ospf database command in Example 9-9 lists R1 (RID 1.1.1.1) as the advertising
router of the five new Type 5 LSAs, because RD1 (with RID 1.1.1.1) created
each Type 5 LSA.
■ Per OSPF internal router R4’s show ip route 172.30.0.0 command at the end of
Example 9-9, the external metric type is indeed E2, meaning external type 2.
■ Per that same command on router R4, the metric for each route is 20. The reasoning is
that the default metric is 20 when redistributing from EIGRP into OSPF, and with an
E2 route, internal OSPF costs are not added to the cost of the route.
That last point regarding the external route type requires a little more discussion. OSPF
defines external routes as either an external type 1 (E1) or external type 2 (E2) route. By
default, the OSPF redistribute command creates Type 2 routes, noting this external route
type in the Type 5 LSA. The difference between the two lies in how OSPF calculates the
metrics for E1 and E2 routes.
The next section completes the discussion of how OSPF can set the metrics when redistributing
routes–or more specifically, the metric as listed in the Type 5 LSA created for
that subnet. Following that, the text takes a detailed look at how OSPF calculates the best
route for E2 routes. Later, a different section titled “Redistributing into OSPF as E1
Routes” discusses the same subject, but for E1 routes.
Setting OSPF Metrics on Redistributed Routes
As mentioned earlier, no matter the source of the redistributed route, OSPF has a default
metric to use. However, OSPF can set the metrics for redistributed routes using the same
options used for EIGRP. Table 9-5 summarizes the defaults and metric setting options for
redistribution into OSPF.
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 311
LSAs and Metrics for External Type 2 Routes
To appreciate how OSPF calculates the possible routes for each E2 route, you need to take
a moment to think about the Type 5 LSA in more detail. First, by definition, the router
that performs the redistribution into OSPF becomes an autonomous system border router
(ASBR) because it injects external routes into OSPF. For each such route, that ASBR creates
a Type 5 LSA for that subnet. The Type 5 LSA includes the following fields:
■ LSID: The subnet number
■ Mask: The subnet mask
■ Advertising router: The RID of the ASBR injecting the route
■ Metric: The metric as set by the ASBR
■ External Metric Type: The external metric type, either 1 or 2
When created, the ASBR floods the Type 5 LSA throughout the area. Then, if any ABRs
exist, the ABRs flood the Type 5 LSAs into any normal (nonstubby) areas. (Note that
ABRs must not forward Type 5 LSAs into any type of stubby area, instead relying on default
routes.) Figure 9-7 shows a sample flooding of the Type 5 LSA for EIGRP subnet
172.30.27.0/23 as an E2 route.
When flooded, OSPF has little work to do to calculate the metric for an E2 route, because
by definition, the E2 route’s metric is simply the metric listed in the Type 5 LSA. In other
words, the OSPF routers do not add any internal OSPF cost to the metric for an E2 route.
Because routers ignore internal cost when calculating E2 external route metrics, whenever
an alternative route can be calculated, the metrics tie. For example, in Figure 9-7, Router R4
has two possible physical routes to ASBR RD1–one directly to RD1, and one through R8.
The cost for both routes to external subnet 172.30.26.0/23 will be 20, because that is the
cost RD1 assigned to the route (actually, the Type 5 LSA) when redistributing the route.
To avoid loops, OSPF routers use a tiebreaker system to allow a router to choose a best
external route. The logic differs slightly depending on whether the router in question resides
in the same area as the ASBR (intra-area), or in a different area (interarea), as discussed
in under the next two headings.
Determining the Next-Hop for Type 2 External Routes–Intra-area
When a router finds multiple routes for the same E2 destination subnet, it chooses the best
route based on the lowest cost to reach any ASBR(s) that advertised the lowest E2 metric.
For example, if five ASBRs all advertised the same subnet as an E2 route, and two ASBRs
Table 9-5 Summary of Metric Values When Redistributing into OSPF
Function Command or Metric Values
Setting the metric for one route source The metric cost parameters on the redistribute
command.
Setting different metrics for routes
learned from a single source
Use the route-map parameter on the redistribute
command.
www.CareerCert.info
312 CCNP ROUTE 642-902 Official Certification Guide
RD1
EIGRP OSPF
R2
R7 R8
Fa0/0
48.4
Fa0/1
4.4
S0/0/0
14.2
172.30.26.0/23
R3 R4
R5
Fa0/0
S0/0/0
35.3
S0/0
35.5
S0/0/0
45.5
S0/0/1
45.4
Area 1
RID
1.1.1.1
Figure 9-7 Flooding of Type 5 LSAs
advertised a metric of 10, and the other three advertised a metric of 20, either of the first
two ASBRs could be used. Then, the router calculates its lowest cost route to reach the
ASBR and uses the next-hop IP address and outgoing interface listed in that route.
The following list spells out the mechanics of the calculation used to break the tie when
multiple equal-cost E2 routes exist for a particular subnet:
Step 1. Find the advertising ASBR(s) as listed in the Type 5 LSA(s) for Type 5 LSAs.
Step 2. Calculate the lowest cost route to reach any of the ASBR(s) based on the intraarea
LSDB topology.
Step 3. Use the outgoing interface and next hop based on the best route to reach the
ASBR (as chosen at Step 2).
Step 4. The route’s metric is unchanged–it is still simply the value listed in the Type 5
LSA.
For example, use Router R4 in Figure 9-7 as an example and the E2 route for
172.30.26.0/23. Before using these four steps, R4 calculated two possible routes for
172.16.26.0/23: an E2 route directly to RD1, and another route through R8. Both routes
use metric 20 in this case, so the routes tie. Because of the tie, R4 proceeds with these
steps as follows:
Step 1. R4 looks in the Type 5 LSA, and sees RID 1.1.1.1 (RD1) is the advertising ASBR.
Key
Topic
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 313
Step 2. R4 then looks at its area 0 LSDB entries, including the Type 1 LSA for RID
1.1.1.1, and calculates all possible area 0 routes to reach 1.1.1.1.
Step 3. R4’s best route to reach RID 1.1.1.1 happens to be through its S0/0/0 interface,
to next-hop RD1 (172.16.14.1), so R4’s route to 172.16.26.0/23 uses
these details.
Step 4. The route lists metric 20, as listed in the Type 5 LSA.
Figure 9-8 shows the interface costs Router R4 will use, based on its LSDB, to calculate
the cost for two possible routes to reach ASBR RD1. Again using subnet 172.30.26.0/23 as
an example, RD1 first looks at the Type 5 external LSA and sees RID 1.1.1.1 as the advertising
ASBR. R4 then calculates the costs based on its intra-area LSDB–but we can perform
the equivalent by adding the interface costs seen in Figure 9-8. Example 9-10 lists the
external Type 5 LSAs, highlighting subnet 172.30.26.0/23, and the interface costs on both
R4 and R8 as seen in the figure.
Step 4. ABR2, connected to another normal area, forwards the Type 5 LSA for subnet
1 into normal area 2.
Example 9-13 demonstrates the concept using area 1 from Figures 9-7 and 9-9. Area 1 has
been converted to be an NSSA area. R5 has been configured to redistribute connected
routes. This feature allows a router to inject connect routes into a routing domain without
having to enable the routing protocol on the corresponding interfaces. In this case, R5 will
redistribute subnet 10.1.1.0/24, a connected route added by R5 using interface loopback0.
Example 9-13 Redistributing from EIGRP into OSPF, with Subnets
! R5’s new configuration here:
interface loopback0
ip address 10.1.1.1 255.255.255.0
router ospf 5
redistribute connected subnets
R5#show ip ospf database | begin Type-7
Type-7 AS External Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Tag
10.1.1.0 5.5.5.5 26 0x80000001 0x00E0A6 0
R5#show ip ospf database nssa-external
OSPF Router with ID (5.5.5.5) (Process ID 5)
Type-7 AS External Link States (Area 1)
LS age: 69
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 10.1.1.0 (External Network Number )
Advertising Router: 5.5.5.5
LS Seq Number: 80000001
Checksum: 0xE0A6
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 172.16.45.5
External Route Tag: 0
! Moving to router R8
R8#show ip ospf database | begin Type-7
R8#show ip ospf database | begin External
www.CareerCert.info
322 CCNP ROUTE 642-902 Official Certification Guide
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.1.1.0 4.4.4.4 263 0x80000001 0x009302 0
172.30.2.0 1.1.1.1 1655 0x8000000E 0x00665D 0
172.30.6.0 1.1.1.1 1655 0x8000000E 0x003A85 0
172.30.12.0 1.1.1.1 1655 0x8000000E 0x00EAD0 0
172.30.17.0 1.1.1.1 1655 0x8000000E 0x00B303 0
172.30.26.0 1.1.1.1 1655 0x8000000E 0x005D4E 0
The example begins with configuration on R5, followed by show commands on both
Router R5 and R4. In particular, the show ip ospf database | begin Type-7 command on
R5 skips output until the heading for Type 7 LSAs, listing one such LSA. The LSA lists the
subnet number (10.1.1.0) as the LSID, and the ASBR’s RID (5.5.5.5, or R5). The next command,
show detailed output from the show ip ospf database nssa-external command on
R5 shows the details in the Type 7 LSA, including the LSA cost of 20–the same default
used when injecting routes as Type 5 LSAs.
The second half of the output, on Router R8, starts with another show ip ospf database |
begin Type-7 command—the same exact command seen earlier in the example on R5. The
null output in this command confirms that R8 has no Type 7 LSAs. However, the final command
in the example confirms that R8 does have a Type 5 external LSA for subnet 10.1.1.0,
with a listing of R4 (4.4.4.4) as the advertising router. This LSA does not list R5’s RID of
5.5.5.5 as the advertising router, because R5 did not create this Type 5 LSA. Instead, R4
created this Type 5 LSA when R4 reacted to learning the Type 7 LSA inside area 1.
Finally, Example 9-14 shows a few interesting items about the IP routing table with NSSA
areas. Routers inside the NSSA area use a different code in the output of show ip route to
denote NSSA external routes as compared with normal external routes. The example
shows R4’s IP routing table, which lists an N2 route. This means that it is external Type 2,
but inside an NSSA area, and using a Type 7 AS external LSA. The second part of the example
shows R8’s route for the same subnet. Because R8 is inside a non-NSSA area, R8
knows of subnet 10.1.1.0/24 because of a type 5 LSA, so R8 lists the route as an E2 route.
Example 9-14 Redistributing from EIGRP into OSPF, with Subnets
! R4’s output here:
R4#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
www.CareerCert.info
Chapter 9: Basic IGP Redistribution 323
! lines omitted for brevity
10.0.0.0/24 is subnetted, 1 subnets
O N2 10.1.1.0 [110/20] via 172.16.45.5, 00:10:54, Serial0/0/1
! R8, in area 0, next
R8#show ip route | begin 10.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [110/20] via 172.16.48.4, 00:10:24, FastEthernet0/0

No comments:

Post a Comment