Configure Generated Routes
Generated routes are used as the route of last resort. A packet is forwarded to the route of last resort when the routing tables have no information about how to reach that packet's destination. One use of route generation is to generate a default route to use if the routing table contains a route from a peer on a neighboring backbone.
A generated route becomes active when it has one or more contributing routes. A contributing route is an active route that is a more specific match for the generated destination. For example, for the destination
128.100.0.0/16, routes to128.100.192.0/19and128.100.67.0/24are contributing routes, but routes to128.0.0.0./8,128.0.0.0/16, and128.100.0.0/16are not.A route can contribute only to a single generated route. However, an active generated route can recursively contribute to a less specific matching generated route. For example, a generated route to the destination
128.100.0.0/16can contribute to a generated route to128.96.0.0/13.By default, when generated routes are installed in the routing table, the next hop is chosen from the primary contributing route.
Currently, you can configure only one generated route for each destination prefix.
To configure generated routes in the default routing table (
inet.0), include thegeneratestatement:[edit]routing-options {generate {defaults {generate-options;}routedestination-prefix{policypolicy-name;generate-options;}}}For a list of hierarchy levels at which you can configure this statement, see the statement summary section for this statement.
To configure generated routes in one of the other routing tables, or to explicitly configure generated routes in the default route table (
inet.0), include thegeneratestatement:[edit]routing-options {ribrouting-table-name{generate {defaults {generate-options;}routedestination-prefix{policypolicy-name;generate-options;}}}}For a list of hierarchy levels at which you can configure this statement, see the statement summary section for this statement.
The
generatestatement consists of two parts:
defaults—Here you specify global generated route options. These are treated as global defaults and apply to all the generated routes you configure in thegeneratestatement. This part of thegeneratestatement is optional.route—Here you configure individual generated routes. In this part of thegeneratestatement, you optionally can configure generated route options. These options apply to the individual destination only and override any options you configured in thedefaultspart of thegeneratestatement.The following sections explain how to configure generated routes.