peer keep-all-routes

Use peer keep-all-routes to save all route updates from a peer or peer group, regardless of whether the routes have passed the configured routing policy.

Use undo peer keep-all-routes to restore the default.

Syntax

In BGP IPv4 unicast address family view/BGP-VPN IPv4 unicast address family view/BGP VPNv4 address family view:

peer { group-name | ip-address } keep-all-routes

undo peer { group-name | ip-address } keep-all-routes

In BGP IPv6 unicast address family view:

peer { group-name | ipv6-address } keep-all-routes

undo peer { group-name | ipv6-address } keep-all-routes

Default

Route updates from a peer or peer group are not saved.

Views

BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP VPNv4 address family view, BGP IPv6 unicast address family view

Predefined user roles

network-admin

mdc-admin

Parameters

group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.

ip-address: Specifies a peer by its IP address. The peer must have been created.

ipv6-address: Specifies a peer by its IPv6 address. The peer must have been created.

Usage guidelines

To implement BGP session soft-reset when the local router and a peer or peer group do not support the route refresh function, use the peer keep-all-routes command to save all route updates received from the peer or peer group. After modifying the route selection policy, filter all saved routes with the new policy to refresh the routing table. This method avoids tearing down BGP sessions.

Examples

# In BGP IPv4 unicast address family view, save all route updates from peer 1.1.1.1.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] peer 1.1.1.1 keep-all-routes

# In BGP-VPN IPv4 unicast address family view, save all route updates from peer 1.1.1.1.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] ip vpn-instance vpn1
[Sysname-bgp-vpn1] address-family ipv4 unicast
[Sysname-bgp-ipv4-vpn1] peer 1.1.1.1 keep-all-routes

# In BGP IPv6 unicast address family view, save all route updates from peer 1::1.

<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv6 unicast
[Sysname-bgp-ipv6] peer 1::1 keep-all-routes

Related commands

peer capability-advertise route-refresh

refresh bgp ipv4 unicast

refresh bgp ipv6 unicast