Configuring Route Maps with the route-map Command
The general rules for route maps are:
- Each route-map command must have an explicitly configured name. All commands that use the same name are part of the same route map.
- Each route-map command has an action (permit or deny).
- Each route-map command in the same route map has a unique sequence number, allowing deletion and insertion of single route-map commands.
- The route-map processes routes taken from the current routing table (redistribution).
- The route-map is processed sequentially based on the sequence numbers.
- Once a particular route is matched by the route map, it is not processed beyond that matching route-map command (redistribution).
- Once matched, if the route-map has a permit parameter, the route is redistributed (redistribution).
- Once matched, if the route-map has a deny parameter, the route is not redistributed (redistribution).
Key points about route map logic when used for redistribution:
- route-map commands with the permit option either cause a route to be redistributed or leave the route to be examined by the next route-map clause.
- route-map commands with the deny option either filter the route or leave the route to be examined by the next route-map clause.
- A permit match in the ACL either causes a redistribution (route-map permit) or filtered (route-map deny).
- The route-map command includes an implied deny all clause at the end. To configure a permit all, use a route-map permit, but without a match command.
Route Map match Commands for Route Redistribution
-
match interface _interface-type_ _interface-number_
: Looks at outgoing interface of routes.
-
match ip address _access-list_ | _prefix-list_
: Examines route prefix and prefix length.
-
match ip next-hop _access-list_
: Examines route's next-hop address.
-
match ip route-source _access-list_
: Matches advertising router's IP address.
-
match metric _metric-value_ _deviation_
: Matches route's metric exactly or a range of metrics.
-
match route-type _internal_ | _external_ _type-1_ | _type-2_ | _level-1_ | _level-2_
: Matches route type.
-
match tag _tag-value_
: Tag must have been set earlier.
Route Map set Commands for Route Redistribution
-
set level _level1_ | _level-2_ | _level-1-2_ | _stub-area_ | _backbone_
: Defines database into which the route is redistributed.
-
set metric _metric-value_
: Sets the route's metric for OSPF, RIP and IS-IS.
-
set metric _bandwidth_ _delay_ _reliability_ _loading_ _mtu_
: Sets the IGRP/EIGRP metric values.
-
set metric-type _internal_ | _external_ | _type-1_ | _type-2_
: Sets type of route for IS-IS and OSPF.
-
set tag _tag-value_
: Sets the unitless tag value in the route.
IP Prefix Lists
Provide mechanisms to match two components of an IP route:
- The route prefix (the subnet number)
- The prefix length (the subnet mask)
Prefix list logic can be summarized into a two-step comparison process for each route:
- The route's prefix must be within the range of addresses implied by the prefix-list command's network/length parameters.
- The route's prefix length must match the range of prefixes implied by the prefix-list command.
LE and GE parameters and the implied range:
- Neither: conf-length = route-length
- Only le: conf-length <= route-length <= le-value
- Only ge: ge-value <= route-length <= 32
- Both ge and le: ge-value <= route-length <= le-value
Administrative Distance
- Connected: 0
- Static: 1
- EIGRP summary route: 5
- EBGP: 20
- EIGRP (internal): 90
- IGRP: 100
- OSPF: 110
- IS-IS: 115
- RIP: 120
- EIGRP (external): 170
- iBGP: 200
- Unreachable: 255
The defaults can be changed by using the distance command:
-
distance _distance_
(RIP)
-
distance eigrp _internal-distance_ _external-distance_
-
distance ospf _intra-area-distance_ _inter-area-distance_ _external-distance_
Mechanics of the redistribute Command
The redistribute command identifies the routing source from which routes are taken and the router command identifies the routing process into which the routes are advertised.
Redistribution Using Default Settings
router eigrp 1
redistribute ospf 1 metric 1544 5 255 1 1500
redistribute rip metric 1544 5 255 1 1500
no auto-summary
router ospf 1
redistribute eigrp 1 subnets
redistribute rip subnets
router rip
version 2
redistribute eigrp 1 metric 2
redistribute ospf 1 metric 3
no auto-summary
Logic to choose which routes to redistribute from a particular IGP protocol:
1. Take all routes in the routing table that were learned by that routing protocol.
2. Take all connected subnets matched by that routing protocol's network commands.
Setting Metrics, Metric Types, and Tags
Three mechanisms for setting the metrics of redistributed routes:
1. Call a route map from the redistribute command (set metric) -> different metrics for different routes.
2. Use the metric option on the redistribute command -> same metric for all routes of routing protocol.
3. Use the default-metric command under the router command -> same metric for all redistributed routes.
Redistributing a Subset of Routes Using a Route Map
router eigrp 1
redistribute ospf 1 route-map ospf-into-eigrp
default-metric 1544 5 1 1 1
no auto-summary
router ospf 1
redistribute eigrp 1 subnets route-map eigrp-into-ospf
ip access-list standard A-14-3-x-x
permit 14.3.0.0 0.0.255.255
ip access-list standard A-15-1-1-5
permit 15.1.1.5
ip access-list standard A-6-6-6-6
permit 6.6.6.6
ip prefix-list e-into-o seq 5 permit 14.2.0.0/16 ge 23 le 24
route-map ospf-into-eigrp permit 10
match ip next-hop A-15-1-1-5
set tag 5
route-map ospf-into-eigrp permit 15
match ip route-source A-6-6-6-6
match route-type external type-1
set tag 6
route-map eigrp-into-ospf permit 10
match ip address prefix-list e-into-o
set metric 300
route-map eigrp-into-ospf permit 18
match ip address A-14-3-x-x
set tag 99
Route Summarization
Features:
- The advertised summary is assigned the same metric as the currently lowest-metric component subnet.
- The router does not advertise the component subnets.
- The router does not advertise the summary when its routing tables does not have any of the component subnets.
- The summarizing router creates a local route to the summary, with destination null0, to prevent routing loops.
- Summary routes reduces the size of routing tables and topology databases, improving convergence.
- Summary routes decrease the amount of specific information in routing tables, causing suboptimal routing.
EIGRP Route Summarization
Under an interface:
ip summary-address eigrp _as-number_ _network-address_ _subnet-mask_ _admin-distance_
If any of the component routes are in that router's table, EIGRP advertises the summary route out that interface.
The EIGRP AD for summary routes defaults to 5.
OSPF Route Summarization
OPSF allows route summarization only as routes are injected into an area, either by an:
- ABR (IA routes):
area _area-id_ range _ip-address-mask_ _advertise_|_not-advertise_ cost _cost_
- ASBR (external routes):
summary-address _ip-address-mask_ _not-advertise_ tag _tag_
The area range command specifies an area in which the component subnets reside, with the summary being advertised into all other areas.
Default Routes
Four methods for learning default routes:
- Static route to 0.0.0.0 with the redistribute static command (RIP, EIGRP).
- The default-information originate (RIP, OSPF). The always keyword means a default is sourced regardless of whether a default route is in the routing table. A static route to 0.0.0.0/0 does not cause RIP to inject a default.
- The ip default-network command (RIP, EIGRP). The classfull network must be in the local routing table.
- Using summary routes (EIGRP).
Useful troubleshooting commands in diagnosing Layer 3
-
show ip protocols
-
show interface _interface_
-
show ip interface _interface_
-
show ip nat translations
-
show ip access-list
-
show ip interface brief
-
show dampening
-
show logging
-
show policy-map
-
show route-map
-
show standby
-
show vrrp
-
show track
-
show ip route _prefix_
-
debug ip routing
(useful to detect a routing loop)
-
debug ipv6 routing