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 restores the default setting.
By default, only the BGP routing updates received from the peers and passing the configured ingress policy are saved.
peer { group-name | ipv4-address | ipv6-address } keep-all-routes
undo peer { group-name | ipv4-address | ipv6-address } keep-all-routes
Parameter | Description | Value |
---|---|---|
group-name | Specifies the name of a peer group. | The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
ipv4-address | Specifies the IPv4 address of a peer. | It is in dotted decimal notation. |
ipv6-address | Specifies the IPv6 address of a peer. | The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
ipv4-address is valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, and BGP-IPv6 unicast address family view.
ipv6-address is valid only in the BGP-IPv6 unicast address family view and BGP-VPN instance IPv6 address family view.
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view
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.
Precautions
If the switch does not support the route-refresh capability, the peer keep-all-routes command needs to be run on the switch 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 reestablished.
If the switch supports the route-refresh capability, running this command does not result in re-establishment of the sessions between the switch and its peers. After the refresh bgp command is run on the switch, however, the switch does not refresh its routing table.
If the switch supports the route-refresh capability, the peer keep-all-routes command does not need to be run on it.