The peer keep-all-routes command saves all the BGP routing updates from the specified peer or the peer group after the BGP connection is set up, even though those routes do not pass the configured ingress policy.
The undo peer keep-all-routes command disables this function.
By default, only the BGP routing updates received from the peers and passing the configured ingress policy are saved.
Usage Scenario
After changing a BGP import policy, you can reset BGP connections for the new import policy to take effect immediately, interrupting these BGP connections temporarily. If a device's peer does not support route-refresh, the peer keep-all-routes command can be used on the device to remain all routing updates received from the peer so that the device can refresh its routing table without closing the connection with the peer.
Implementation Procedure
If the peer keep-all-routes command is run but no peer exists, a message is displayed, indicating that the peer does not exist.
Precautions
If the route does not support the route-refresh capability, the peer keep-all-routes command needs to be run on the route and its peer. If the peer keep-all-routes command is run on a device for the first time, the sessions between the device and its peers will be re-established.
If the route supports the route-refresh capability, running this command does not result in re-establishment of the sessions between the route and its peers. After the refresh bgp command is run on the route, however, the route does not refresh its routing table. After the keep-all-routes command is run, the undo peer keep-all-routes command becomes ineffective. To have the undo peer keep-all-routes command become effective, run the undo keep-all-routes command and then the peer keep-all-routes command.<HUAWEI> system-view [~HUAWEI] bgp 100 [*HUAWEI-bgp] peer 2001:DB8:1::1 as-number 100 [*HUAWEI-bgp] ipv6-family unicast [*HUAWEI-bgp-af-ipv6] peer 2001:DB8:1::1 enable [*HUAWEI-bgp-af-ipv6] peer 2001:DB8:1::1 keep-all-routes