This article explains how to configure route aggregation and export the aggregated routes to the BGP neighbors.
Consider the following scenario in which you have four subnets:
- 10.10.4.0/24
- 10.10.5.0/24
- 10.10.6.0/24
- 10.10.7.0/24
The four subnets are connected to four interfaces and a fifth interface is connected to an ISP, to which we advertise the routes to the other 4 subnets. We may want to aggregate this routing information into a single route, as this reduces the amount of information the BGP has to share with its neighbors.
Configure a policy statement to specify the routes that have to be aggregated
root# set policy-options policy-statement aggregate-route from protocol direct
root# set policy-options policy-statement aggregate-route from route-filter 10.10.4.0/22 orlonger
root# set policy-options policy-statement aggregate-route then accept
[edit policy-options]
root# show
policy-statement aggregate-route {
from {
protocol direct;
route-filter 10.10.4.0/22 orlonger;
}
then accept;
}
Aggregate the specified routes
root# set routing-options aggregate route 10.10.4.0/22 policy aggregate-route
[edit routing-options]
root# show
aggregate {
route 10.10.4.0/22 policy aggregate-route;
}
Configure a policy statement to specify the routes that have to be exported
root# set policy-options policy-statement export-route from protocol aggregate
root# set policy-options policy-statement export-route from route-filter 10.10.4.0/22 exact
root# set policy-options policy-statement export-route then accept
[edit policy-options]
root# show
policy-statement export-route {
from {
protocol aggregate;
route-filter 10.10.4.0/22 exact;
}
then accept;
}
Apply the policy statement in the BGP configuration
[edit protocols bgp]
root# set group session-to-AS65505 type external
root# set group session-to-AS65505 peer-as 65505
root# set group session-to-AS65505 neighbor 11.11.11.1
[edit protocols]
root# show
bgp {
group session-to-AS65505 {
type external;
export export–route;
peer-as 65505;
neighbor 11.11.11.1;
}
}