Configure BGP Route Generation
Configuration Condition
Before configuring BGP route generation, ensure that:
- BGP is enabled.
- BGP neighbors are configured and a session is set up successfully.
Configure BGP to Advertise Local Routes
BGP can use the network command to introduce the routes of the IP routing table into the BGP routing table. Only when there are routes that match completely the network prefix and mask can the routes be introduced into the BGP routing table and advertised.
In advertising a local route, you can apply a route map for the route, and you can also specify the route as the backdoor route. The backdoor route takes EBGP routes as local BGP routes and uses the administrative distance of local routes. This allows IGP routes to have higher priorities than EBGP routes. At the same time, backdoor routes will not be advertised to EBGP neighbors.
Table 12-9 Configure BGP to advertise local routes
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure BGP to advertise local routes.
|
network ip-address mask [ route-map rtmap-name [ backdoor ] | backdoor ]
|
Mandatory.
By default, BGP does not advertise local routes.
|
-
The Origin property type of the local routes that are advertised by BGP is IGP.
- If you run the network backdoor command for an EBGP route, the administrative distance of the EBGP route changes to the local route administrative distance. (By default, the EBGP route administrative distance is 20, and the local route administrative distance is 200.) Then, the administrative distance of the EBGP route is smaller than the administrative distance of the default IGP route. In this way, the IGP route is selected with priority, forming a backdoor link between EBGP neighbors.
- The route map applied to the local routes that are advertised by BGP supports match options, including as-path, community, extcommunity, ip address, ip nexthop, and metric, and it supports the set options, including as-path, comm-list, community, extcommunity, ip next-hop, local-preference, metric, origin, and weight.
Configure BGP to Redistribute Routes
BGP is not responsible for route learning. It focuses mainly on managing route properties so as to control the route direction. Therefore, BGP redistributes IGP routes to generate BGP routes and advertise the BGP routes to neighbors. When BGP redistributes IGP routes, it can apply a routing diagram.
Table 12-10 Configure BGP to redistribute routes
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure BGP to redistribute IGP routes.
|
redistribute { connected | irmp as-number | isis [ area-tag ] [ match isis-level ] | ospf as-number [ match route-sub-type ] | rip | static } [ route-map map-name / metric value ]
|
Mandatory.
By default, BGP does not redistribute IGP routes.
|
-
The Origin property type of the IGP routes that are advertised by BGP is INCOMPLETE.
- The route map applied to other protocol routes that are redistributed by BGP supports match options, including as-path, community, extcommunity, ip address, ip nexthop, and metric, and it supports the set options, including as-path, comm-list, community, extcommunity, ip next-hop, local-preference, metric, origin, and weight.
Configure BGP to Advertise the Default Route
Before BGP advertises a default route to neighbors, the default route needs to be introduced. Two ways of introducing the default routes are available: Running the neighbor default-originate command to generate a BGP default route, and running the default-information originate command to redistribute the default route of another protocol.
The default route that is generated by running the neighbor default-originate command is route 0.0.0.0/0 that is automatically generated by BGP. The default route that is redistributed by running the default-information originate command is route 0.0.0.0/0 of the redistributed protocol introduced by BGP.
Table 12-11 Configure BGP to advertise the default route
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure BGP to generate the default route.
|
neighbor { neighbor-address | peer-group-name } default-originate [ route-map rtmap-name ]
|
Mandatory.
By default, BGP does not generate the default route.
|
Configure the default route of another protocol redistributed by BGP.
|
default-information originate
|
Mandatory.
By default, BGP does not redistribute the default route of another protocol.
|
-
In configuring BGP to redistribute the default route of another protocol, you need to configure BGP to redistribute routes.
- In configuring BGP to generate a default route, you can apply a route map to the route.
- The route map that is applied to the default route that is generated by BGP supports set options, including as-path, comm-list, community, extcommunity, ip next-hop, local-preference, metric, origin, and weigh.