Social Icons

Saturday, April 12, 2014

CCNP ROUTE: 2. Basic redistribution into OSPF

- Unlike EIGRP, OSPF does have useful default metrics for redistributed routes.
- 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.

General syntax:
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]

Parameters:
-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.
-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.)

Note:
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.

Consider router R4, which is sitting between an EIGRP and an OSPF domain. Both protocols have been configured, but no redistribution yet:

R4#show run
...
!
router eigrp 1
 network 172.16.0.2 0.0.0.0
 network 172.16.0.12 0.0.0.3
 network 192.168.44.0
 no auto-summary
!
router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 network 192.168.0.12 0.0.0.3 area 0
!
R4#show run | i redistribute
R4#

Rule 1: 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.

First, let's check the OSPF database on R4 and the routing table on a router inside the OSPF domain, like R1.
As expected, only directly connected and OSPF routes are in its table:

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

C    192.168.44.0/24 is directly connected, Loopback44
     172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
C       172.16.0.12/30 is directly connected, Serial0/2
D       172.16.0.8/30 [90/2681856] via 172.16.0.1, 00:00:54, Serial0/0
D       172.16.0.4/30 [90/2195456] via 172.16.0.14, 00:00:56, Serial0/2
                      [90/2195456] via 172.16.0.1, 00:00:56, Serial0/0
C       172.16.0.0/30 is directly connected, Serial0/0
D       172.16.111.0/24 [90/2297856] via 172.16.0.1, 00:00:54, Serial0/0
D    192.168.55.0/24 [90/2297856] via 172.16.0.14, 00:00:55, Serial0/2
     10.0.0.0/32 is subnetted, 3 subnets
O IA    10.0.1.3 [110/192] via 192.168.0.13, 00:00:00, Serial0/1
O IA    10.0.11.11 [110/193] via 192.168.0.13, 00:00:00, Serial0/1
O IA    10.0.1.1 [110/128] via 192.168.0.13, 00:00:00, Serial0/1
     192.168.0.0/24 is variably subnetted, 4 subnets, 2 masks
C       192.168.0.12/30 is directly connected, Serial0/1
O       192.168.0.0/29 [110/74] via 192.168.0.13, 00:00:01, Serial0/1
O       192.168.0.16/30 [110/128] via 192.168.0.13, 00:00:01, Serial0/1
O       192.168.0.20/30 [110/128] via 192.168.0.13, 00:00:01, Serial0/1
     192.168.100.0/32 is subnetted, 1 subnets
O       192.168.100.100 [110/65] via 192.168.0.13, 00:00:01, Serial0/1
     192.168.3.0/30 is subnetted, 1 subnets
O IA    192.168.3.0 [110/138] via 192.168.0.13, 00:00:01, Serial0/1

R4#show ip ospf database 

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         75          0x80000004 0x00AE5F 8
2.2.2.2         2.2.2.2         76          0x80000002 0x00EB54 1
3.3.3.3         3.3.3.3         75          0x80000002 0x00455E 2
4.4.4.4         4.4.4.4         116         0x80000002 0x006035 2
5.5.5.5         5.5.5.5         117         0x80000002 0x00A4E0 2
9.9.9.9         9.9.9.9         110         0x80000001 0x000F4C 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.3     3.3.3.3         76          0x80000001 0x00703C

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.1        9.9.9.9         50          0x80000001 0x00E22A
10.0.1.2        9.9.9.9         18          0x80000001 0x005B70
10.0.1.3        9.9.9.9         50          0x80000001 0x005179
10.0.10.10      9.9.9.9         20          0x80000001 0x00B108
10.0.11.11      9.9.9.9         52          0x80000001 0x009C1B
192.168.3.0     9.9.9.9         107         0x80000001 0x00F9AB
192.168.33.33   9.9.9.9         62          0x80000001 0x007FE2
192.168.168.0   2.2.2.2         118         0x80000001 0x00AE6D
192.168.169.170 2.2.2.2         63          0x80000001 0x001557

R1#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

     192.168.13.0/32 is subnetted, 1 subnets
O       192.168.13.13 [110/11] via 192.168.0.3, 00:24:15, FastEthernet0/0
     10.0.0.0/32 is subnetted, 5 subnets
O IA    10.0.1.3 [110/128] via 192.168.0.22, 00:23:49, Serial0/0
O IA    10.0.1.2 [110/128] via 192.168.0.22, 00:23:19, Serial0/0
O IA    10.0.11.11 [110/129] via 192.168.0.22, 00:23:49, Serial0/0
O IA    10.0.10.10 [110/129] via 192.168.0.22, 00:23:19, Serial0/0
O IA    10.0.1.1 [110/64] via 192.168.0.22, 00:23:49, Serial0/0
     192.168.0.0/24 is variably subnetted, 4 subnets, 2 masks
C       192.168.0.12/30 is directly connected, Serial0/1
C       192.168.0.0/29 is directly connected, FastEthernet0/0
C       192.168.0.16/30 is directly connected, Serial0/2
C       192.168.0.20/30 is directly connected, Serial0/0
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.2, 00:24:17, FastEthernet0/0
C    192.168.100.0/24 is directly connected, Loopback0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.2, 00:24:04, FastEthernet0/0
     192.168.3.0/30 is subnetted, 1 subnets
O IA    192.168.3.0 [110/74] via 192.168.0.22, 00:24:17, Serial0/0
     192.168.33.0/32 is subnetted, 1 subnets
O IA    192.168.33.33 [110/75] via 192.168.0.22, 00:24:02, Serial0/0

Now, let's add the redistribute eigrp 1 command in OSPF configuration mode:

R4(config)#router ospf 1
R4(config-router)#redistribute eigrp 1
% Only classful networks will be redistributed

According to Rule 1 from above, not using the "subnets" keyword within the command redistributes only entire classful subnets listed in the routing table of R4.
Now, we can check again the OSPF database on R4 and routing table on R1:

R4#show ip ospf database 

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         481         0x80000004 0x00AE5F 8
2.2.2.2         2.2.2.2         482         0x80000002 0x00EB54 1
3.3.3.3         3.3.3.3         481         0x80000002 0x00455E 2
4.4.4.4         4.4.4.4         351         0x80000003 0x00642E 2
5.5.5.5         5.5.5.5         523         0x80000002 0x00A4E0 2
9.9.9.9         9.9.9.9         516         0x80000001 0x000F4C 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.3     3.3.3.3         482         0x80000001 0x00703C

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.1        9.9.9.9         456         0x80000001 0x00E22A
10.0.1.2        9.9.9.9         425         0x80000001 0x005B70
10.0.1.3        9.9.9.9         456         0x80000001 0x005179
10.0.10.10      9.9.9.9         426         0x80000001 0x00B108
10.0.11.11      9.9.9.9         458         0x80000001 0x009C1B
192.168.3.0     9.9.9.9         513         0x80000001 0x00F9AB
192.168.33.33   9.9.9.9         468         0x80000001 0x007FE2
192.168.168.0   2.2.2.2         524         0x80000001 0x00AE6D
192.168.169.170 2.2.2.2         469         0x80000001 0x001557

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.44.0    4.4.4.4         352         0x80000001 0x00D723 0
192.168.55.0    4.4.4.4         352         0x80000001 0x005E91 0

R1#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

     192.168.13.0/32 is subnetted, 1 subnets
O       192.168.13.13 [110/11] via 192.168.0.3, 00:06:03, FastEthernet0/0
O E2 192.168.44.0/24 [110/20] via 192.168.0.14, 00:06:03, Serial0/1
O E2 192.168.55.0/24 [110/20] via 192.168.0.14, 00:06:03, Serial0/1
     10.0.0.0/32 is subnetted, 5 subnets
O IA    10.0.1.3 [110/128] via 192.168.0.22, 00:06:03, Serial0/0
O IA    10.0.1.2 [110/128] via 192.168.0.22, 00:06:03, Serial0/0
O IA    10.0.11.11 [110/129] via 192.168.0.22, 00:06:03, Serial0/0
O IA    10.0.10.10 [110/129] via 192.168.0.22, 00:06:05, Serial0/0
O IA    10.0.1.1 [110/64] via 192.168.0.22, 00:06:05, Serial0/0
     192.168.0.0/24 is variably subnetted, 4 subnets, 2 masks
C       192.168.0.12/30 is directly connected, Serial0/1
C       192.168.0.0/29 is directly connected, FastEthernet0/0
C       192.168.0.16/30 is directly connected, Serial0/2
C       192.168.0.20/30 is directly connected, Serial0/0
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.2, 00:06:06, FastEthernet0/0
C    192.168.100.0/24 is directly connected, Loopback0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.2, 00:06:06, FastEthernet0/0
     192.168.3.0/30 is subnetted, 1 subnets
O IA    192.168.3.0 [110/74] via 192.168.0.22, 00:06:06, Serial0/0
     192.168.33.0/32 is subnetted, 1 subnets
O IA    192.168.33.33 [110/75] via 192.168.0.22, 00:06:06, Serial0/0

As seen above, the only external OSPF routes on R1 are the ones which represent classful subnets in R4's routing table.

By changing the configuration to use the redistribute eigrp 1 subnets command, OSPF indeed redistributes the expected routes:

R4(config)#router ospf 1
R4(config-router)#redistribute eigrp 1 subnets 

Now, let's check the tables again and see if the EIGRP subnets have been redistributed into the OSPF domain - and indeed they have been:

R4#show ip ospf database    

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         732         0x80000004 0x00AE5F 8
2.2.2.2         2.2.2.2         733         0x80000002 0x00EB54 1
3.3.3.3         3.3.3.3         732         0x80000002 0x00455E 2
4.4.4.4         4.4.4.4         602         0x80000003 0x00642E 2
5.5.5.5         5.5.5.5         774         0x80000002 0x00A4E0 2
9.9.9.9         9.9.9.9         767         0x80000001 0x000F4C 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.0.3     3.3.3.3         733         0x80000001 0x00703C

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.1        9.9.9.9         707         0x80000001 0x00E22A
10.0.1.2        9.9.9.9         675         0x80000001 0x005B70
10.0.1.3        9.9.9.9         707         0x80000001 0x005179
10.0.10.10      9.9.9.9         677         0x80000001 0x00B108
10.0.11.11      9.9.9.9         709         0x80000001 0x009C1B
192.168.3.0     9.9.9.9         764         0x80000001 0x00F9AB
192.168.33.33   9.9.9.9         719         0x80000001 0x007FE2
192.168.168.0   2.2.2.2         775         0x80000001 0x00AE6D
192.168.169.170 2.2.2.2         720         0x80000001 0x001557

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
172.16.0.0      4.4.4.4         78          0x80000001 0x00D7FE 0
172.16.0.4      4.4.4.4         78          0x80000001 0x00AF23 0
172.16.0.8      4.4.4.4         78          0x80000001 0x008747 0
172.16.0.12     4.4.4.4         78          0x80000001 0x005F6B 0
172.16.111.0    4.4.4.4         78          0x80000001 0x002044 0
192.168.44.0    4.4.4.4         603         0x80000001 0x00D723 0
192.168.55.0    4.4.4.4         603         0x80000001 0x005E91 0

R1#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

     192.168.13.0/32 is subnetted, 1 subnets
O       192.168.13.13 [110/11] via 192.168.0.3, 00:10:58, FastEthernet0/0
O E2 192.168.44.0/24 [110/20] via 192.168.0.14, 00:10:58, Serial0/1
     172.16.0.0/16 is variably subnetted, 5 subnets, 2 masks
O E2    172.16.0.12/30 [110/20] via 192.168.0.14, 00:02:16, Serial0/1
O E2    172.16.0.8/30 [110/20] via 192.168.0.14, 00:02:16, Serial0/1
O E2    172.16.0.4/30 [110/20] via 192.168.0.14, 00:02:16, Serial0/1
O E2    172.16.0.0/30 [110/20] via 192.168.0.14, 00:02:16, Serial0/1
O E2    172.16.111.0/24 [110/20] via 192.168.0.14, 00:02:18, Serial0/1
O E2 192.168.55.0/24 [110/20] via 192.168.0.14, 00:10:59, Serial0/1
     10.0.0.0/32 is subnetted, 5 subnets
O IA    10.0.1.3 [110/128] via 192.168.0.22, 00:10:59, Serial0/0
O IA    10.0.1.2 [110/128] via 192.168.0.22, 00:10:59, Serial0/0
O IA    10.0.11.11 [110/129] via 192.168.0.22, 00:11:00, Serial0/0
O IA    10.0.10.10 [110/129] via 192.168.0.22, 00:11:00, Serial0/0
O IA    10.0.1.1 [110/64] via 192.168.0.22, 00:11:00, Serial0/0
     192.168.0.0/24 is variably subnetted, 4 subnets, 2 masks
C       192.168.0.12/30 is directly connected, Serial0/1
C       192.168.0.0/29 is directly connected, FastEthernet0/0
C       192.168.0.16/30 is directly connected, Serial0/2
C       192.168.0.20/30 is directly connected, Serial0/0
     192.168.168.0/30 is subnetted, 1 subnets
O IA    192.168.168.0 [110/20] via 192.168.0.2, 00:11:00, FastEthernet0/0
C    192.168.100.0/24 is directly connected, Loopback0
     192.168.169.0/32 is subnetted, 1 subnets
O IA    192.168.169.170 [110/21] via 192.168.0.2, 00:11:00, FastEthernet0/0
     192.168.3.0/30 is subnetted, 1 subnets
O IA    192.168.3.0 [110/74] via 192.168.0.22, 00:11:00, Serial0/0
     192.168.33.0/32 is subnetted, 1 subnets
O IA    192.168.33.33 [110/75] via 192.168.0.22, 00:11:02, Serial0/0

Notes:
- According to show ip ospf database, we can see that indeed R4 is the advertising router of the new Type 5 LSAs: 4.4.4.4
- Looking at R1's routing table, we confirm that the default external metric type is E2 and the default metric for each route coming from EIGRP is 20. Each route being an E2 route, internal OSPF costs are not added to the cost of the route.

No comments:

Post a Comment