2. Route Maps
◦ Route Maps represent a powerful tool for manipulating ip routes and
packets. Route maps are somewhat similar to Access Lists but are
more complex and more powerful. This article describe the basics of
route maps on Cisco devices, and what they are used for. Route
maps are widely used by:
◦ Border Gateway Protocol (BGP);
◦ Route Redistribution;
◦ Policy Based Routing (PBR).
3. ◦ When a route map is applied it will check packets against a match
with match command.
◦ If a match occurs then an action can be done by using set
command.
◦ Every statement in a route map has a sequence number, default
sequence number is 10.
◦ Each statement has a permit or deny parameter, which can have
different effects in different situations. Any statement that has the
same name is the part of the same Route Map.
◦ Each route map statement can contain one or several match or set
statements.
4. example
◦ route-map TEST deny 10
◦ match ip address 50
◦ route-map TEST permit 20
◦ match ip address 60 70
◦ set ip next-hop 10.10.10.10
◦ In example above you see route map TEST. Numbers 10 and 20 are
sequence numbers. This route map can be used in Policy Based Routing
(PBR) where next hop address is set to 10.10.10.10. Numbers 50, 60 and
70 are Access Lists numbers, that route map will use to find out which
packets to analyse.
5. When this route map is used by PBR, following will happen:
◦ If a match in first statement occurs, then next hop will remain
and route map is not further analysed;
◦ If a match in first statement will not occur, next statement will be
analysed;
◦ If in second statement a match occurs, set command will take effect and
next hop will be changed.
◦ At the end of route map there is an implicit “deny all”, similarly to ACLs.
6. ◦ A match statement can have more than one criteria (like previous slide,
criteria 60 and 70). If so, then a logical OR is applied, i.e at least one of
them must be true to consider this statement as a match.
◦ If there are multiple match statements under the same sequence
number, then a logical AND is applied, i.e all of them must be true to
consider this statement (for this sequence number) as a match.
9. ◦ In the topology we have two EIGRP domains and one OSPF domain.
The task is to redistribute EIGRP learned routes into OSPF domain.
Redistribution will be done by router R1 which is part of all routing
domains.
◦ Let’s assume that all interface configurations are done and EIGRP and
OSPF is configured except redistribution. At this point R1 knows all
routes learned by EIGRP and OSPF, R2 doesn’t know EIGRP learned
routes.
10. ◦ R1
◦ 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
◦ 172.16.0.0/24 is subnetted, 2 subnets
◦ C 172.16.30.0 is directly connected, FastEthernet0/1
◦ C 172.16.0.0 is directly connected, FastEthernet0/0
◦ 10.0.0.0/24 is subnetted, 1 subnets
◦ C 10.0.0.0 is directly connected, FastEthernet1/0
◦ D 192.168.0.0/24 [90/409600] via 172.16.0.2, 01:12:06, FastEthernet0/0
◦ D 192.168.1.0/24 [90/409600] via 172.16.0.2, 01:12:06, FastEthernet0/0
◦ D 192.168.2.0/24 [90/409600] via 172.16.30.2, 01:12:06, FastEthernet0/1
◦ D 192.168.3.0/24 [90/409600] via 172.16.30.2, 01:12:08, FastEthernet0/1
11. When configuring route redistribution with route-maps a simple guideline
should be followed:
◦ Define one or more ACLs (Access Lists) in which specify routes that
be checked by the route-map;
◦ Define an route-map with permit (redistribution will take place) or deny
(redistribution will not take place) statements where ACLs are matched
and attributes for routes are set;
◦ Set the route-map parameter in redistribute command.
12. Configuring Redistribution (R1)
◦ ACL 10 used to specify routes from EIGRP domain 1:
◦ ip access-list standard 10
◦ 10 permit 192.168.0.0 0.0.0.255
◦ 20 permit 192.168.1.0 0.0.0.255
◦ 30 permit 172.16.0.0 0.0.0.255
◦ ACL 20 used to specify routes from EIGRP domain 2:
◦ ip access-list standard 20
◦ 10 permit 192.168.2.0 0.0.0.255
◦ 20 permit 172.16.30.0 0.0.0.255
13. ◦ Route map domain1-in-ospf
◦ route-map domain1-in-ospf permit 10
◦ match ip address 10
◦ set metric 200
◦ set metric-type type-1
◦ Route map domain2-in-ospf
◦ route-map domain2-in-ospf permit 10
◦ match ip address 20
◦ set metric 200
◦ set metric-type type-2
14. ◦ If route map sequence is a permit then redistribution will take place, if it
is a deny redistribution will not happen.
◦ In both route-maps above there is a match statement, first matches
access list 10 and second matches access list 20 (one for each
redistributed EIGRP domain).
◦ Then metric value was set to 200, which means that matched routes will
enter ospf domain with metric 200.
◦ Also you can set metric type for redistributed routes, if type-1 is chosen
then OSPF will add internal cost to redistributed metric, if type-2 is
chosen then metric value (cost) will remain unchanged.
◦ Take note that redistribution will happen or not depending on permit
or deny command of route-map sequence, but not ACL statement.
15. Redistribute commands!
◦ R1
◦ router ospf 1
◦ redistribute eigrp 1 subnets route-map domain1-in-ospf
◦ redistribute eigrp 2 subnets route-map domain2-in-ospf
◦ In redistribution statement we use route-map parameter to specify
witch route map will be used (in our case there is domain1-in-ospf and
domain2-in-ospf ). At this point R2 should have external routes to
EIGRP domains,
16. ◦ R2
◦ R2#sh 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
◦ 172.16.0.0/24 is subnetted, 2 subnets
◦ O E2 172.16.30.0 [110/200] via 10.0.0.1, 00:13:20, FastEthernet0/0
◦ O E1 172.16.0.0 [110/210] via 10.0.0.1, 00:13:30, FastEthernet0/0
◦ 10.0.0.0/24 is subnetted, 1 subnets
◦ C 10.0.0.0 is directly connected, FastEthernet0/0
◦ O E1 192.168.0.0/24 [110/210] via 10.0.0.1, 00:13:30, FastEthernet0/0
◦ O E1 192.168.1.0/24 [110/210] via 10.0.0.1, 00:13:30, FastEthernet0/0
◦ O E2 192.168.2.0/24 [110/200] via 10.0.0.1, 00:13:20, FastEthernet0/0
17. ◦ With E1 you see routes learned from first EIGRP domain that are type-1
routes and cost is 210 (200 at the redistribution point plus cost of R2’s
fa0/0 interface). With E2 (type-2) cost remains unchanged.
◦ If you noticed above in ACL 20 We’ve skipped 192.168.3.0/24 route in
second EIGRP domain. We did this with the purpose to not redistribute
that network in OSPF domain. Also you can filter routes from being
redistributed with deny sequences in route-maps.