Route+Redistribution+and+Summarization

=Route Maps= toc

Route maps consist of match and set clauses that work similar to if/then/else statements seen in other programming languages. The following general rules apply:


 * A route map must be configured with a name
 * Each route map must have a permit or deny action
 * Each route-map command within a single route map is associated with a sequence number and commands are processed in order
 * When used for redistribution, routes are taken from the current active routing table. A matching permit clauses allows redist
 * Once a route is matched, it is not processed beyond that route map command
 * Used with an ACL, when the ACL permits a route, it allows that route to be evaluated by the route map clause. When the ACL denies the route, it is sent to the next route-map clause for evaluation
 * A route map has an implicit deny all at the end. To change to an implicit permit all, use a permit clause with no match statement.

Match Options
//*Allows multiple ACLs to be applied//

Set Options


=IP Prefix Lists=

Used to filter a range of prefixes. The redistribute command cannot match a prefix list directly, but can refer to it via the use of a route-map. Standard syntax is:

//** #ip prefix-list list-name [seq seq-value ] {deny network/length | permit network/length }[ge ge-value ] [le le-value ] **//

Matching logic follows two steps:


 * 1) The prefix must be within the range implied by the network/length option
 * 2) The prefix must match the range of prefixes implied by ge and le

=Administrative Distance=



This can be changed via the **#distance** subcommand under the respective protocol and can take a few forms:

code
 * 1) distance distance
 * 2) distance eigrp internal-distance external-distance
 * 3) distance ospf {[intra-area dist1] [inter-area dist2] [external dist3]}

code //** #distance { distance-value ip-address { wildcard-mask } [ ip-standard-list ] [ ip-extendedlist ] **//

=Route redistribution=

The redistribute command is used to place routes from one protocol into another. The full syntax of the command is:


 * redistribute protocol [ process-id ] [level-1 | level-1-2 | level-2] [ as-number ] [metric // metric-value //] [metric-type // type-value //] [match {internal | external 1 | external 2}] [tag // tag-value //] [route-map // map-tag //] [subnets]**

The redistribute command is ran under the protocol for which the routes should be distributed into. The command itself specifies the source protocol from which routes are taken. Some caveats:


 * When redistributing into EIGRP, you must set the metrics as they do not have default values
 * When redistributing into RIP, you must set the metric as it does not have a default value
 * When redistributing into OSPF, you must use the subnets option if you want to redistribute classless subnets. OSPF uses a default value of 20 for the metric on IGP redistributed routes and 1 from BGP
 * Routes are only taken from the current IP routing table
 * Redistribution will pick up connected routes if they match the network statement for the protocol being redistributed

Setting metrics and tags
There are 3 ways to set metrics on redistributed routes:


 * 1) Via a route map in the redistribute command using **#set metric**. Allows different metrics for different routes
 * 2) Via the metric option in the redistribute command. Sets the same metric for all routes being redistributed
 * 3) Using the default-metric command under the router command. This will set metrics for all routes redistributed and not explicitly set in the other two methods.

This list also implies order of preference.



Preventing suboptimal routes
An interesting case may occur in which a route may distribute a better route into a protocol with a lower AD, causing that route to be preferred. One solution to this is to configure the router with the suboptimal route to set a higher AD for routes that it redistributes or recieves.

Another method would be to tag the route via a route map as they are being redistributed. You can then look for this route tag and filter the routes on each router that requires it. This has the advantage of identify routes that change. With a prefix list, you would need to alter the list each time a new route is added. The downside is that if the original route fails, the routers will not use the alternate path through he higher AD domain due to the routes being filtered.

Using metrics to influence routes
Routers within a single protocol domain may not always choose the metric first when deciding on a best route. The following table shows what protocols consider BEFORE looking at the route metric:



Route Summarization
The following attributes are shared between all IGPs when considering summarized routes:


 * The summarized route shares the metric of the lowest-metric component route
 * Component subnets are not advertised
 * The summary is not advertised if no component subnets are active
 * The summarizing router creates a local route to null0 for the summarized route to prevent loops

EIGRP
To configure run the following as an interface subcommand:

//**#ip summary-address eigrp [as-number] [network-address] [subnet-mask] [admin-distance]**//

If any component subnets exist, the route is advertised out the interface under which it is configured. The admin distance option is used the set the AD of the summarized route, but only locally. It is not advertised out with the route. It determines if the summary route is place into the routing table of the local router. The default AD for summary routes is 5.

OSPF
OSPF allows summarization only when routes are injected into an area, by an ABR or ASBR. This ensures that all OSPF routers within the area share the same LSA table. A different command exists depending on which of these types of routers are summarizing. Both are configured as a router subcommand:



The //area-id// in the area range command specifies the area in which the component subnets exist. The summary is advertised into all other areas. This command can also set the cost, instead of using the lowest common cost between the component subnets.

Another important feature is that the //not-advertise// option, on both commands, can be used to basically just filter the component subnets out, without actually advertising the summary route.

OSPF installs a null route when summarizing with the goal of dropping the traffic if the longest match is the summary route. This can be disabled with the no-discard option. You can only summarize if the networks are described in a type 1 LSA from the area you are summarizing from. For external summaries, the router originating the type 5 LSA is the only one able to summarize. If the destination area is a NSSA<, then the type5 to type 7 translator does the summary.

RIP
Similar to EIGRP, RIP uses the following interface subcommand:

//**#ip summary-address rip [ip-address] [ip-network-mask]**//

There are a few caveats:


 * Summarization only works in RIPv2
 * RIP summarization does not support supernetting (Combining two or more classful networks into a single summary). For example, //**#ip summary-address rip 172.16.0.0 255.254.0.0**// is not supported.
 * Only one summary route is allowed per classful network

=Default Routes=

There are five main methods for learning default routes. The fifth, not listed below, is the redistribute the default route into another protocol:

//*Summary static routes are not// //recommended because they are hella strange//

When a router learns multiple default routes, the following best path selection process is used in order:


 * 1) Administrative distance
 * 2) Route type
 * 3) Lowest metric

Redistribute static

 * Will redistribute the default route if configured with the //**#ip route**// command
 * EIGRP treats the default route as an external route with AD 170 by default

default-information originate

 * Can set the metric and type directly, but OSPF defaults to cost of 1 and type of E2
 * Can use the **always** keyword, which will distribute the route even if a default route does not exist in the routing table
 * In RIP, this command will not redistribute a default route if the route is applied statically, as RIP supports the redistribute static command
 * In some instances, a route map can be used to match IP addresses or prefixes. The default information will only be originated if the routes exist in the routing table.

ip default-network
This command will inject default routes if the following conditions are met:


 * The specified network must be classful
 * The specified network must be in the routing table
 * For EIGRP, the network must be advertised by the local router into EIGRP

Leak maps and Summary default
When summaring for a default route, just use //**#ip summary address eigrp 100 0.0.0.0 0.0.0.0**//. You can also use leak maps (Oly on physical interfaces) to allow more specific routes through. basically configure a route map and access list, then specify the route map with the leak-map option in the ip summary-address command.

Note that if you do note want a summary to install a null0 route into the routing table, you can set the AD to 255 to poison the route.