Configuring BGP to Advertise Default Routes to Peers
Context
If a BGP device needs to send multiple routes to its peer, the BGP device can be configured to send only a default route with the local address as the next-hop address to its peer, regardless of whether there are default routes in the local routing table. This function reduces the number of network routes and saves memory and network resources.
Default routes are commonly used on a network that meets the following conditions:
Each device has multiple EBGP peers and receives all routes on the network from each EBGP peer.
There are multiple route reflectors (RRs), and each RR receives all routes on the network.
If load balancing is not implemented on the network, a BGP peer receives at most one copy of active routes on the network. If load balancing is implemented on the network, the number of active routes received by a BGP peer will be increased by multiple times, causing the number of routes on the network to sharply increase. To greatly reduce the number of routes on such a network, configure a BGP device to advertise only default routes to its BGP peer and use default routes for traffic load balancing.
Before configuring BGP to send default routes to peers, complete the following task:
Procedure
- Run system-view
The system view is displayed.
- Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
- Enter the corresponding address family view based on network type to configure BGP devices on networks.
Run ipv4-family unicast
The BGP-IPv4 unicast address family view is displayed.
Run ipv4-family multicast
The BGP-IPv4 multicast address family view is displayed.
Run ipv4-family vpn-instance vpn-instance-name
The BGP-VPN instance IPv4 address family view is displayed.
Run ipv6-family [ unicast ]
The BGP-IPv6 unicast address family view is displayed.
Run ipv6-family vpn-instance vpn-instance-name
The BGP-VPN instance IPv6 address family view is displayed.
- Run either of the following commands to configure a BGP device to send default routes to a peer or peer group.
peer { group-name | ipv4-address | ipv6-address } default-route-advertise [ route-policy route-policy-name ] [ conditional-route-match-all { ipv4-address1 { mask1 | mask-length1 } } &<1-4> | conditional-route-match-any { ipv4-address2 { mask2 | mask-length2 } } &<1-4> ]
peer { group-name | ipv4-address | ipv6-address } default-route-advertise [ route-policy route-policy-name ] [ conditional-route-match-all { ipv6-address1 ipv6-mask-length1 } &<1-4> | conditional-route-match-any { ipv6-address2 ipv6-mask-length2 } &<1-4> ]
The conditional-route-match-all and conditional-route-match-any keywords are not supported in the IPv4 multicast address family view.
- Run commit
The configuration is committed.
Verifying the Configuration
Run the display bgp routing-table [ ipv4-address [ mask | mask-length [ longer-prefixes ] ] ] command to check received BGP default routes.
- Run the display bgp multicast routing-table [ ip-address [ mask-length [ longer-prefixes ] | mask [ longer-prefixes ] ] ] command to check received MBGP default routes.