Configuring Generated Route Options
In the defaults and route parts of the generate statement, you can specify options that define additional information about generated routes that is included with the route when it is installed in the routing table. All generated options are optional. Generated options that you specify in the defaults part of the generate statement are treated as global defaults and apply to all the generated routes you configure in the generate statement. Generated options that you specify in the route part of the generate statement override any global generated options and apply to that destination only.
To configure generated route options, include one or more of them in the defaults or route part of the generate statement (for routing instances, include the statement).
For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.
The following sections explain how to configure generated route options:
- Configuring a Metric Value for Generated Routes
- Configuring a Preference Value for Generated Routes
- Configuring the Next Hop for Generated Routes
- Associating BGP Communities with Generated Routes
- Associating AS Paths with Generated Routes
- Configuring an OSPF Tag String for Generated Routes
- Including AS Numbers in Generated Route Paths
- Controlling Retention of Inactive Generated Routes in the Routing and Forwarding Tables
Configuring a Metric Value for Generated Routes
You can specify up to four metric values, starting with metric (for the first metric value) and continuing with metric2, metric3, and metric4, by including one or more of the following statements:
For a list of hierarchy levels at which you can include these statements, see the statement summary sections for these statements.
In the type option, you specify the type of route.
Configuring a Preference Value for Generated Routes
By default, generated routes have a preference value of 130. If the Junos routing table contains a dynamic route to a destination that has a better (lower) preference value than this, the dynamic route is chosen as the active route and is installed in the forwarding table.
To modify the default preference value, specify a primary preference value (preference). You also can specify a secondary preference value (preference2) and colors, which are even finer-grained preference values (color and color2). To do this, include one or more of the following statements:
For a list of hierarchy levels at which you can include these statements, see the statement summary sections for these statements.
The preference value can be a number in the range from 0 through 4,294,967,295 (232 – 1) with a lower number indicating a more preferred route. For more information about preference values, see Route Preferences Overview.
In the type option, you specify the type of route.
Configuring the Next Hop for Generated Routes
By default, when generated routes are installed in the routing table, the next hop is chosen from the primary contributing route.
When you configure an individual route in the route part of the generate statement, or when you configure the defaults for generated routes, you can specify a discard next hop. This means that if a more specific packet does not match a more specific route, the packet is rejected and a reject route for this destination is installed in the routing table, but ICMP unreachable messages are not sent. The discard next-hop feature allows you to originate a summary route, which can be advertised through dynamic routing protocols, and allows you to discard received traffic that does not match a more specific route than the summary route.
For example:
Associating BGP Communities with Generated Routes
By default, no BGP community information is associated with generated routes. To associate community information with the routes, include the community option:
For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.
community-ids is one or more community identifiers for either communities or extended communities.
The format for community identifiers is:
as-number is the AS number and can be a value in the range from 1 through 65,534.
You also can specify community-ids for communities as one of the following well-known community names, which are defined in RFC 1997:
- no-advertise—Routes containing this community name are not advertised to other BGP peers.
- no-export—Routes containing this community name are not advertised outside a BGP confederation boundary.
- no-export-subconfed—Routes containing this community name are not advertised to external BGP peers, including peers in other members’ ASs inside a BGP confederation.
You can explicitly exclude BGP community information with a generated route using the none option. Include none when configuring an individual route in the route portion of the generate statement to override a community option specified in the defaults portion of the statement.
![]() | Note: Extended community attributes are not supported at the [edit routing-options] hierarchy level. You must configure extended communities at the [edit policy-options] hierarchy level. For information about configuring extended communities, see the “Configuring the Extended Communities Attribute” section in the Junos Policy Framework Configuration Guide. For information about configuring 4-byte AS numbers and extended communities, see Configuring 4-Byte AS Numbers and BGP Extended Community Attributes in the Using 4-Byte Autonomous System Numbers in BGP Networks Technology Overview . |
Associating AS Paths with Generated Routes
By default, no AS path information is associated with generated routes. To associate AS path information with the routes, include the as-path statement:
For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.
as-path is the AS path to include with the route. It can include a combination of individual AS path numbers and AS sets. Enclose sets in brackets ( [ ] ). The first AS number in the path represents the AS immediately adjacent to the local AS. Each subsequent number represents an AS that is progressively farther from the local AS, heading toward the origin of the path.
![]() | Note: In Junos OS Release 9.1 and later, the numeric AS range is extended to provide BGP support for 4-byte AS numbers, as defined in RFC 4983, BGP Support for Four-octet AS Number Space. For the AS number, you can configure a number from 1 through 4,294,967,295. All releases of the Junos OS support 2-byte AS numbers. The 2-byte AS number range is 1 through 65,535 (this is a subset of the 4-byte range). In Junos OS Release 9.2 and later, you can also configure a 4-byte AS number using the AS-dot notation format of two integer values joined by a period: <16-bit high-order value in decimal>.<16-bit low-order value in decimal>. For example, the 4-byte AS number of 65,546 in plain-number format is represented as 1.10 in the AS-dot notation format. You can specify a value in the range from 0.0 through 65535.65535 in AS-dot notation format. |
You also can specify the AS path using the BGP origin attribute, which indicates the origin of the AS path information:
- egp—Path information originated in another AS.
- igp—Path information originated within the local AS.
- incomplete—Path information was learned by some other means.
To attach the BGP ATOMIC_AGGREGATE path attribute to the generated route, specify the atomic-aggregate option. This path attribute indicates that the local system selected a less specific route rather than a more specific route.
To attach the BGP AGGREGATOR path attribute to the generated route, specify the aggregator option. When using this option, you must specify the last AS number that formed the generated route (encoded as two octets), followed by the IP address of the BGP system that formed the generated route.
Configuring an OSPF Tag String for Generated Routes
By default, no OSPF tag strings are associated with generated routes. You can specify an OSPF tag string by including the tag statement:
For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.
Including AS Numbers in Generated Route Paths
By default, all AS numbers from all contributing paths are included in the generated route’s path. To include only the longest common leading sequences from the contributing AS paths, include the brief statement when configuring the route. If doing this results in AS numbers being omitted from the generated route, the BGP ATOMIC_ATTRIBUTE path attribute is included with the generated route.
To explicitly have all AS numbers from all contributing paths be included in the generated route’s path, include the full state when configuring routes. Include this option when configuring an individual route in the route portion of the generate statement to override a retain option specified in the defaults portion of the statement.
For a list of hierarchy levels at which you can include the brief or full statement, see the statement summary sections for these statements.
Controlling Retention of Inactive Generated Routes in the Routing and Forwarding Tables
Static routes are only removed from the routing table if the next hop becomes unreachable, which happens if there are no contributing routes. To have a generated route remain continually installed in the routing and forwarding tables, include the passive option when configuring the route:
Routes that have been configured to remain continually installed in the routing and forwarding tables are marked with reject next hops when they are inactive.
To explicitly remove generated routes when they become inactive, include the active option when configuring routes. Include this option when configuring an individual route in the route portion of the generate statement to override a retain option specified in the defaults portion of the statement.
For a list of hierarchy levels at which you can include these statements, see the statement summary sections for these statements.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1
