Route maps provide a way to logically make decision regarding routes using similar logic found in programming such as IF, THEN, ELSE. A single Route Map has one or more commands in sequential order based on sequence numbers. Each Route Map command has an underlying matching parameter configured with a match command. Route Maps also play a major role in Policy Based Routing or PBR.

Route Redistribution

The use of a routing protocol to advertise routes that are learned by some other means, such as by another routing protocol, static routes, or directly connected routes, is called redistribution. Route redistribution is often where Route Maps are used to control which routes are eligible for redistributed.

When a Route is redistributed into another routing protocol is metric plays important role in the process. Each routing protocol uses a different metric. When routes are redistributed they must convey a metric that is understandable to the receiving protocol.

RIP Metric

  • Hop Count

EIGRP Metric

When redistributing routes into EIGRP you have to take care to configure the metric options. For example when you redistribute routes such as OSPF or RIP into EIGRP they are considered to be EX or externally learned routes.

EIGRP Metric Options or K Values

  • Bandwidth
  • Delay 
  • Reliability
  • Load
  • MTU

OSPF Metric

OSPF uses a reference bandwidth of 100 Mbps for cost calculation. The formula to calculate the cost is reference bandwidth divided by interface bandwidth. For example, in the case of Ethernet, it is 100 Mbps / 10 Mbps = 10. When redistributing routes such as EIGRP or RIP into OSPF they are considered to be either one of two types either E1 or E2. The E represents the fact the route is an externally learned route.

  • Cost = Reference / Interface bandwidth in bps

Common Routing Decision

  1. Prefer the route with the longest prefix length
  2. Prefer the route with the lowest Metric
  3. Prefer the route with the lowest Administrative Distance

Prefix Lists Operators

  • Less Then or Equal To – le
  • Greater Then or Equal To – ge

Prefix List Condition Examples

  1. 10.0.0.0/8 – without le or ge only matches on 1
  2. 10.128.0.0/9 – without le or ge only matches on 2
  3. 10.1.1.0/24 ge 9 – would match on 2 – 6
  4. 10.1.2.0/24 ge 24 le 24 – would match on 3, 4
  5. 10.128.10.4/30 ge – would match on 5, 6
  6. 10.128.10.8/30 le – would match on 1 – 6

The key point to take away from the above examples is the focus on the prefix or mask in this case. The condition is focused on the Prefix length and what matches based on the range.

R1 S0/0 = 10.0.0.1/30
R1 S0/1 = 10.0.0.5/30
R1 S0/2 = 10.0.0.9/30
R1 EIGRP, OSPF, RIP

R2 S0/0 = 10.0.0.2/30
R2 Loopback0 = 2.2.2.2/24
R2 Loopback1 = 172.16.2.1/28
R2 Loopback2 = 192.168.2.1/24
R2 EIGRP

R3 S0/0 = 10.0.0.6/30
R3 Loopback0 = 3.3.3.3/24
R3 Loopback1 = 172.16.3.1/28
R3 Loopback2 = 192.168.3.1/24
R3 OSPF

R4 S0/0 = 10.0.0.10/30
R4 Loopback0 = 4.4.4.4/24
R4 Loopback1 = 172.16.4.1/28
R4 Loopback2 = 192.168.4.1/24
R4 RIP

The following example calls on two Route Maps one called OSPF, and the other RIP. I choose to use simple names for this example to emphasis when OSPF or RIP was being redistributed. You an see that the Route Maps are called by the redistribution command. The OSPF Route Map clause calls the Prefix List, and sets the EIGRP metric.The RIP Route Map clause calls the ACL R4, and sets the metric.

Lets get the Interfaces on Router R1 up and running

 R1# config t
 R1(config)# interface serial0/0
 R1(config-if)#ip address 10.0.0.1 255.255.255.252
 R1(config-if)#no shutdown
 R1(config-if)#interface serial0/1
 R1(config-if)#ip address 10.0.0.5 255.255.255.252
 R1(config-if)#no shutdown
 R1(config-if)#interface serial0/2
 R1(config-if)#ip address 10.0.0.9 255.255.255.252
 R1(config-if)#no shutdown
 R1(config-if)#exit
 R1(config)#exit
 R1#

The IP Prefix List for OSPF redistribution into EIGRP from Router R1

 R1#config t
 R1(config)#ip prefix-list R3 permit 3.3.3.0/24 le 32
 R1(config)#ip prefix-list R3 permit 172.16.3.0/24 ge 32
 R1(config)#ip prefix-list R3 permit 192.168.3.0/24 ge 32
 R1(config) exit
 R1#

The Route Map for OSPF redistribution into EIGRP from R1

 R1#config t
 R1(config)#route-map OSPF
 R1(config-route-map)#match ip address prefix-list R3
 R1(config-route-map)#set metric 1544 100 255 1 1500
 R1(config-route-map)#exit
 R1(config)#exit
 R1#

The ACL for RIP redistribution from Router R1 to Router R4

 R1#config t
 R1(config)#ip access-list extended R4
 R1(config-ext-nacl)#permit ip 4.4.4.0 0.0.0.255 any
 R1(config-ext-nacl)#permit ip 172.16.4.0 0.0.0.240 any
 R1(config-ext-nacl)#exit
 R1(config)#exit
 R1#

The Route Map for RIP redistribution into EIGRP on Router 2

 R1#config t
 R1(config)#route-map RIP
 R1(config-route-map)#match ip address R4
 R1(config-route-map)#set metric 1544 100 255 1 1500
 R1(config-route-map)#exit
 R1(config)#exit
 R1#

Configure EIGRP on R1 with the OSPF and RIP Route Maps for redistrubutoin

 R1#config t
 R1(config)#router eigrp 1
 R1(config-router)#eigrp router-id 1.1.1.1
 R1(config-router)#redistribute ospf 1 route-map OSPF
 R1(config-router)#redistribute rip route-map RIP
 R1(config-router)#network 10.0.0.0 0.0.0.3
 R1(config-router)#no auto-summary
 R1(config-router)#exit
 R1#config)#exit
 R1#

Configure OSPF on Router R1 with RIP and EIGRP redistrubution

 R1# config 1
 R1(config)# router ospf 1
 R1(config-router)# router-id 1.1.1.1
 R1(config-router)# log-adjacency-changes
 R1(config-router)# redistribute eigrp 1
 R1(config-router)# redistribute rip metric 0 subnets
 R1(config-router)# network 0.0.0.0 255.255.255.255 area 0
 R1(config-router)# exit
 R1(config)# exit
 R1#

Configure RIP on Router R1 with OSPF and EIGRP redistrubution

 R1#config t
 R1(config)#router rip
 R1(config-router)#version 2
 R1(config-router)#redistribute eigrp 1 metric 0
 R1(config-router)#redistribute ospf 1 metric 0
 R1(config-router)#network 1.0.0.0
 R1(config-router)#network 10.0.0.0
 R1(config-router)#neighbor 10.0.0.10
 R1(config-router)#no auto-summary
 R1(config-router)#exit
 R1(config)#exit
 R1#

The following is the ACL for R3 OSPF routes, however I didn’t use it for the redistribution of R3 OSPF routes into R2 EIGRP routes. Instead I used a prefix list to define which routes were eligible for redistribution. You can see this in the above Route Map example.

 R1#config t
 R1(config)#ip access-list extended R3
 R1(config-ext-nacl)#permit ip 3.3.3.0 0.0.0.255 any
 R1(config-ext-nacl)#permit ip 172.16.3.0 0.0.0.255 any
 R1(config-ext-nacl)#permit ip 192.168.3.0 0.0.0.255 any
 R1(config-ext-nacl)#exit
 R1(config)#exit
 R1#

Loopback interfaces are considered host routes with OSPF so you have to take care to match the length /32 when advertised with a prefix list. Note the prefix length used in the R3 route map. This feature can be disabled by using the ip ospf network point-to-point.

 R1#show ip prefix-list R3

 ip prefix-list R3: 3 entries
 seq 1 permit 3.3.3.0/24 le 32
 seq 2 permit 172.16.3.0/24 ge 32
 seq 3 permit 192.168.3.0/24 ge 32

Lets get Router R2’s Interfaces up and running

 R2#config t
 R2(config)#interface serial0/0
 R2(config-if)#ip address 10.0.0.2 255.255.255.252
 R2(config-if)#no shutdown
 R2(config-if)#interface loopback0
 R2(config-if)#ip address 2.2.2.2 255.255.255.0
 R2(config-if)#no shutdown
 R2(config-if)#exit
 R2(config)#exit
 R2#

Lets get Router R2’s EIGRP configuration up and running

 R2#config t
 R2(config)#router eigrp
 R2(config-router)#eigrp router-id 2.2.2.2
 R2(config-router)#network 2.2.2.0 0.0.0.255
 R2(config-router)#network 10.0.0.0 0.0.0.3
 R2(config-router)#network 172.16.2.0 0.0.0.15
 R2(config-router)#network 192.168.2.0
 R2(config-router)#no auto-summary
 R2(config-router)#exit
 R2(config)#exit
 R2#

Lets get Router R3’s Interfaces up and running

 R3#config t
 R3(config)#interface serial0/0
 R3(config-if)#ip address 10.0.0.6 255.255.255.252
 R3(config-if)#no shutdown
 R3(config-if)#interface loopback0
 R3(config-if)#ip address 3.3.3.3 255.255.255.0
 R3(config-if)#no shutdown
 R3(config-if)#exit
 R3(config)#exit
 R3#

Lets get Router R3’s EIGRP configuration up and running

 R3#config t
 R3(config)#router ospf
 R3(config-router)#router-id 3.3.3.3
 R3(config-router)#log-adjacency-changes
 R3(config-router)#network 0.0.0.0 255.255.255.255 area 0
 R3(config-router)#exit
 R3(config)#exit
 R3#

Lets take a look at the redistributed OSPF routes from R1 learned from R3 on R2. Notice the routed denoted with the EX indicating Externally learned routes.

 R2#show ip route

 Gateway of last resort is not set

 2.0.0.0/24 is subnetted, 1 subnets
 C    2.2.2.0 is directly connected, Loopback0
 3.0.0.0/32 is subnetted, 1 subnets
 D    EX 3.3.3.3 [170/2195456] via 10.0.0.1, 00:34:07, Serial0/0
 4.0.0.0/24 is subnetted, 1 subnets
 D    EX 4.4.4.0 [170/2195456] via 10.0.0.1, 00:09:01, Serial0/0
 172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
 D    EX 172.16.4.0/28 [170/2195456] via 10.0.0.1, 00:09:01, Serial0/0
 D    EX 172.16.3.1/32 [170/2195456] via 10.0.0.1, 00:34:07, Serial0/0
 C    172.16.2.0/28 is directly connected, Loopback1
 10.0.0.0/30 is subnetted, 1 subnets
 C    10.0.0.0 is directly connected, Serial0/0
 C    192.168.2.0/24 is directly connected, Loopback2
 192.168.3.0/32 is subnetted, 1 subnets
 D    EX 192.168.3.1 [170/2195456] via 10.0.0.1, 00:34:24, Serial0/0

Lets take a look at the EIGRP Topology table on Router R2

 R2#show ip eigrp topology


 IP-EIGRP Topology Table for AS(1)/ID(2.2.2.2)
 Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
 r - reply Status, s - sia Status

 P 3.3.3.3/32, 1 successors, FD is 2195456
                 via 10.0.0.1 (2195456/1683456), Serial0/0
 P 2.2.2.0/24, 1 successors, FD is 128256
                 via Connected, Loopback0
 P 4.4.4.0/24, 1 successors, FD is 2195456
                 via 10.0.0.1 (2195456/1683456), Serial0/0
 P 10.0.0.0/30, 1 successors, FD is 2169856
                 via Connected, Serial0/0
 P 192.168.3.1/32, 1 successors, FD is 2195456
                 via 10.0.0.1 (2195456/1683456), Serial0/0
 P 192.168.2.0/24, 1 successors, FD is 128256
                 via Connected, Loopback2
 P 172.16.4.0/28, 1 successors, FD is 2195456
                 via 10.0.0.1 (2195456/1683456), Serial0/0
 P 172.16.3.1/32, 1 successors, FD is 2195456
                 via 10.0.0.1 (2195456/1683456), Serial0/0
 P 172.16.2.0/28, 1 successors, FD is 128256
                 via Connected, Loopback1

The redistribution of EIGRP, and RIP routes into R3 OSPF was done with default metrics. For example the RIP routes were redistributed using the default metric of 0 with the subnets option.

Lets get Router R4’s Interfaces up and running

 R4#config t
 R4(config)#interface serial0/0
 R4(config-if)#ip address 10.0.0.10 255.255.255.252
 R4(config-if)#no shutdown
 R4(config-if)#interface loopback0
 R4(config-if)#ip address 4.4.4.4 255.255.255.0
 R4(config-if)#exit
 R4(config)#exit
 R4#

Lets get Router R4’s RIP configuration up and running

 R4#config t
 R4(config)#router rip
 R4(config-router)#version 2
 R4(config-router)#network 4.0.0.0
 R4(config-router)#network 10.0.0.0
 R4(config-router)#network 172.16.0.0
 R4(config-router)#network 192.168.4.0
 R4(config-router)#neighbor 10.0.0.9
 R4(config-router)#no auto-summary
 R4(config-router)#exit
 R4(config)#exit
 R4#

Lets take a look at the RIP routes on Router R4

 R4#show ip route rip

 Gateway of last resort is not set

 2.0.0.0/24 is subnetted, 1 subnets
 R    2.2.2.0 [120/1] via 10.0.0.9, 00:00:09, Serial0/0
 4.0.0.0/24 is subnetted, 1 subnets
 C    4.4.4.0 is directly connected, Loopback0
 172.16.0.0/28 is subnetted, 2 subnets
 C    172.16.4.0 is directly connected, Loopback1
 R    172.16.2.0 [120/1] via 10.0.0.9, 00:00:09, Serial0/0
 C    192.168.4.0/24 is directly connected, Loopback2
 10.0.0.0/30 is subnetted, 3 subnets
 C    10.0.0.8 is directly connected, Serial0/0
 R    10.0.0.0 [120/1] via 10.0.0.9, 00:00:11, Serial0/0
 R    10.0.0.4 [120/1] via 10.0.0.9, 00:00:11, Serial0/0
 R    192.168.2.0/24 [120/1] via 10.0.0.9, 00:00:11, Serial0/0