Supported Platforms
Related Documentation
- ACX, M, PTX, QFX, T Series
- Understanding Route Advertisement
- ACX, EX, M, MX, PTX, QFX, SRX, T Series
- out-delay
keep
Syntax
Hierarchy Level
Release Information
Statement introduced before Junos OS Release 7.4.
Statement introduced in Junos OS Release 9.0 for EX Series switches.
Statement introduced in Junos OS Release 11.3 for the QFX Series.
Description
Control whether or not Junos OS keeps in memory and hides certain routes.
If the keep none statement is used, Junos OS does not retain in memory and hide routes that are rejected because of a BGP import policy. Nor does BGP keep in memory and hide routes that are declared unfeasible due to BGP sanity checks. The keep none statement causes Junos OS to discard from memory the routes that are rejected due to BGP-specific logic or BGP evaluation. When a route is rejected because of some non-BGP-specific reason, the keep none statement has no effect on this route. This rejected route is retained in memory and hidden even though keep none is configured. An example of this type of hidden route is a route for which the protocol nexthop is unresolved.
The routing table can retain the route information learned from BGP in one of the following ways:
- Default (omit the keep statement)—Keep all route information that was learned from BGP, except for routes whose AS path is looped and whose loop includes the local AS.
- keep all—Keep all route information that was learned from BGP.
- keep none—Discard routes that were received from a peer and that were rejected by import policy or other sanity checking, such as AS path or next hop. When you configure keep none for the BGP session and the inbound policy changes, Junos OS forces readvertisement of the full set of routes advertised by the peer.
In an AS path healing situation, routes with looped paths theoretically could become usable during a soft reconfiguration when the AS path loop limit is changed. However, there is a significant memory usage difference between the default and keep all.
Consider the following scenarios:
- A peer readvertises routes back to the peer from which
it learned them.
This can happen in the following cases:
- Another vendor's routing device advertises the routes back to the sending peer.
- The Junos OS peer’s default behavior of not readvertising routes back to the sending peer is overridden by configuring advertise-peer-as.
- A provider edge (PE) routing device discards any VPN route that does not have any of the expected route targets.
When keep all is configured, the behavior of discarding routes received in the above scenarios is overridden.
![]() | Caution: When you configure keep (all | none), the associated BGP sessions are restarted. |
Default
By default, BGP retains incoming rejected routes in memory and hides them. If you do not include the keep statement, most routes are retained in the routing table. BGP keeps all route information that was learned from BGP, except for routes whose AS path is looped and whose loop includes the local AS.
Options
all—Retain all routes.
none—Discard routes that were received from a peer and that were rejected by import policy or other sanity checking. When keep none is configured for the BGP session and the inbound policy changes, Junos OS forces readvertisement of the full set of routes advertised by the peer.
Required Privilege Level
routing—To view this statement in the configuration.
routing-control—To add this statement to the configuration.
Related Documentation
- ACX, M, PTX, QFX, T Series
- Understanding Route Advertisement
- ACX, EX, M, MX, PTX, QFX, SRX, T Series
- out-delay
Published: 2013-05-02
Supported Platforms
Related Documentation
- ACX, M, PTX, QFX, T Series
- Understanding Route Advertisement
- ACX, EX, M, MX, PTX, QFX, SRX, T Series
- out-delay