Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

retain

date_range 20-Nov-23

Syntax

content_copy zoom_out_map
(no-retain | retain);

Hierarchy Level

content_copy zoom_out_map
[edit logical-systems logical-system-name routing-instances routing-instance-name routing-options rib routing-table-name static (defaults | route)],
[edit logical-systems logical-system-name routing-instances routing-instance-name routing-options static (defaults | route)],
[edit logical-systems logical-system-name routing-options rib routing-table-name static (defaults | route)],
[edit logical-systems logical-system-name routing-options static (defaults | route)],
[edit routing-instances routing-instance-name routing-options rib routing-table-name static (defaults | route)],
[edit routing-instances routing-instance-name routing-options static (defaults | route)],
[edit routing-options rib routing-table-name static (defaults | route)],
[edit routing-options static (defaults | route)]

Description

Configure statically configured routes to be deleted from or retained in the forwarding table when the routing protocol process shuts down normally.

Note:

You cannot configure both retain and resolve options for a statically configured route because resolved next hops cannot be retained.

Default

Statically configured routes are deleted from the forwarding table when the routing protocol process shuts down normally.

The retention policy applied to defaults and route is as follows:

  • defaults— The default route retention policy. By default, the default route retention policy is no-retain for the configured scope using the defaults configuration statement. This default retention policy is overridden on a per route basis using the routes option.

  • route—The retention policy for this route. The default retention policy for a route is the policy of its routing table.

Options

no-retain

Delete statically configured routes from the forwarding table when the routing protocol process shuts down normally. To explicitly specify that routes be deleted from the forwarding table, include the no-retain statement. Include this statement when configuring an individual route in the route portion of the static statement to override a retain option specified in the defaults portion of the statement.

retain

Have a static route remain in the forwarding table when the routing protocol process shuts down normally. Doing this greatly reduces the time required to restart a system that has a large number of routes in its routing table.

Required Privilege Level

routing—To view this statement in the configuration.

routing-control—To add this statement to the configuration.

Release Information

Statement introduced before Junos OS Release 7.4.

footer-navigation