Overview

The network command can be used to generate BGP routes for known network addresses in the routing table. This section describes the generation of BGP aggregate route by the network command.

Two methods for BGP route aggregation

BGP allows manual aggregation at arbitrary boundaries as well as at class boundaries in 8-bit increments. Aggregation is basically manual aggregation; the following methods are available to perform BGP route aggregation on Cisco routers.

  • network command
  • aggregate-address command

Basically, aggregation is done with the aggregate-address command. In case you are interested, here is an introduction to configuring the aggregation with the network command.

Aggregation using network command

The network command is used to generate BGP route. In order for the network command to generate a BGP route, there must be an exact match of the route information in the routing table. The key point is that it must be an exact match. For example, suppose the routing table contains the following route information.

  • 192.168.0.0/24
  • 192.168.1.0/24
  • 192.168.2.0/24
  • 192.168.3.0/24

Trying to generate route information for 192.168.0.0/22 by aggregating these four routes, the network command is configured as follows.

router bgp <AS>
 network 192.168.0.0 mask 255.255.252.0

However, no aggregate route is generated with this configuration. This is because the route information specified by the network command, 192.168.0.0/22, does not exist in the routing table. The idea is to register matching route information in the routing table so that the network command will work.

The network command will work if you additionally configure a static route with null0 as the output interface as follows.

ip route 192.168.0.0 255.255.252.0 null0

The reason null0 is used as the output interface is to prevent loops of packets destined for networks that are included in the range of the aggregate route but do not actually exist.

Figure: Configuring aggregate route using network command
Figure: Configuring aggregate route using network command

Problems with configuring aggregation using the network command

As you can see, the network command can also be used to configure aggregate route, but there are some problems.

  • Always advertise the aggregate route
  • Aggregate route attributes are not flexible

Static route with null0 as the output interface is always present in the routing table. Thus, even if all the pre-aggregation networks are down, the network command will always be enabled and the aggregate route will be advertised to the neighbor.

Also, since the aggregate route is generated by the network command, the attribute is the same as the route generated by the network command normally, and cannot be configured flexibly.

Figure: Problems with aggregation by network command
Figure: Problems with aggregation by network command

On the other hand, if you generate aggregate route with the aggregate-address command, it will stop advertising the aggregate route if all pre-aggregate routes are down. It is also possible for the aggregate route to inherit attributes added to the pre-aggregate route by configuring the options of the command.

Summary

Point

  • Aggregate route generation can also be done with the network command for generating BGP routes.
  • To generate an aggregated route with the network command, configure a static route for the aggregate route with Null0 as the output interface and then use the network command.