BGP Conditional Route Injection
Overview
The BGP Conditional Route Injection feature is an extension of the BGP routing protocol. Routes that are advertised through the Border Gateway Protocol (BGP) are commonly aggregated to minimize the number of routes that are used and reduce the size of global routing tables. However, common route aggregation can obscure more specific routing information that is more accurate but not necessary to forward packets to their destinations. Routing accuracy is obscured by common route aggregation because a prefix that represents multiple addresses or hosts over a large topological area cannot be accurately reflected in a single route. Cisco IOS software provides several methods in which you can originate a prefix into BGP. The existing methods include redistribution and using the network or aggregate-address command. These methods assume the existence of more specific routing information (matching the route to be originated) in either the routing table or the BGP table.
The BGP Conditional Route Injection feature allows you to originate a prefix into a BGP routing table without the corresponding match. This feature allows more specific routes to be generated based on administrative policy or traffic engineering information in order to provide more specific control over the forwarding of packets to these more specific routes, which are injected into the BGP routing table only if the configured conditions are met. Enabling this feature will allow you to improve the accuracy of common route aggregation by conditionally injecting or replacing less specific prefixes with more specific prefixes. Only prefixes that are equal to or more specific than the original prefix may be injected. The BGP Conditional Route Injection feature is enabled with the bgp inject-map exist-map command. This command uses two route maps (inject-map and exist-map) to install one (or more) more specific prefix into a BGP routing table. The exist-map specifies the prefixes that the BGP speaker will track. The inject-map defines the prefixes that will be created and installed into the local BGP table.
Benefits
The BGP Conditional Route Injection feature allows you to inject more specific prefixes into a BGP routing table over less specific prefixes that were selected through normal route aggregation. These more specific prefixes can be used to provide a finer granularity of traffic engineering or administrative control than is possible with aggregated routes.
.The BGP Conditional Route Injection feature allows you to inject more specific prefixes into a BGP routing table over less specific prefixes that were selected through normal route aggregation. These more specific prefixes can be used to provide a finer granularity of traffic engineering or administrative control than is possible with aggregated routes.
Supported Platforms
The BGP Conditional Route Injection feature is supported by all platforms in Cisco IOS
Release 12.2(14)S that support BGP:
• Cisco 7200 series
• Cisco 7400 series
• Cisco 7500 series
Supported Standards, MIBs, and RFCs
Standards
No new or modified standards are supported by this feature.
MIBs
No new or modified MIBs are supported by this feature.
To obtain lists of supported MIBs by platform and Cisco IOS release, and to download MIB modules, go to the Cisco MIB website on Cisco.com at the following URL:http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml
RFCs
No new or modified RFCs are supported by this feature.
Configuration Tasks
See the following section for configuration tasks for the BGP Conditional Route Injection feature. Each task in the list is identified as either required or optional.
Configuring BGP Conditional Route Injection
To configure the BGP Conditional Route Injection feature, use the following commands beginning in global configuration mode:
Command | Purpose | |
Step 1 | Router(config)# router bgp as-number | Places the router in router configuration mode, and configures the router to run a BGP process. |
Step 2 | Router(config-router)# bgp inject-map ORIGINATE exist-map LEARNED_PATH | Configures the inject-map named ORIGINATE and the exist-map named LEARNED_PATH for conditional route injection. |
Step 3 | Router(config-router)# exit | Exits router configuration mode, and enters global configuration mode. |
Step 4 | Router(config)# route-map LEARNED_PATH permit sequence-number | Configures the route map named LEARNED_PATH. |
Step 5 | Router(config-route-map)# match ip address prefix-list ROUTE | Specifies the aggregate route to which a more specific route will be injected. |
Step 6 | Router(config-route-map# match ip route-source prefix-list ROUTE_SOURCE | Configures the prefix list named ROUTE_SOURCE to redistribute the source of the route. |
Step 7 | Router(config-route-map)# exit | Exits route-map configuration mode, and enters global configuration mode. |
Step 8 | Router(config)# route-map ORIGINATE permit 10 | Configures the route map named ORIGINATE. |
Step 9 | Router(config-route-map)# set ip address prefix-list ORIGINATED_ROUTES | Specifies the routes to be injected. |
Step 10 | Router(config-route-map)# set community community-attribute additive | Configures the community attribute of the injected routes. |
Step 11 | Router(config-route-map)# exit | Exits route-map configuration mode, and enters global configuration mode. |
Step 12 | Router(config)# ip prefix-list ROUTE permit 10.1.1.0/24 | Configures the prefix list named ROUTE to permit routes from network 10.1.1.0/24. |
Step 13 | Router(config)# ip prefix-list ORIGINATED_ROUTES permit 10.1.1.0/25 | Configures the prefix list named ORIGINATED_ROUTES to permit routes from network 10.1.1.0/25. |
Step 14 | Router(config)# ip prefix-list ORIGINATED_ROUTES permit 10.1.1.128/25 | Configures the prefix list named ORIGINATED_ROUTES to permit routes from network 10.1.1.0/25. |
Step 15 | Router(config)# ip prefix-list ROUTE_SOURCE permit 10.2.1.1/32 | Configures the prefix list named ROUTE_SOURCE to permit routes from network 10.2.1.1/32. |
Note: To enable conditional route injection, the exist-map must contain both the match ip address prefix-list and match ip route-source prefix-list match clauses in the route map paragraph.
Verifying BGP Conditional Route Injection
To verify that the BGP Conditional Route Injection feature is configured correctly, use the show ip bgp or show ip bgp injected-paths command.
The following sample output is similar to the output that will be displayed when the show ip bgp command is entered:
Router# show ip bgp 172.16.0.0 BGP routing table entry for 172.16.0.0/8, version 13Paths:(2 available, best #1, table Default-IP-Routing-Table) Flag:0x200 Not advertised to any peer Local, (injected path from 172.16.0.0/8)
The following sample output is similar to the output that will be displayed when the show ip bgp injected-routes command is entered:
Troubleshooting Tips
The BGP Conditional Route Injection feature is based on the injection of a more specific prefix into the BGP routing table when a less specific prefix is present. If conditional route injection is not working properly, check the following:
To display BGP conditional advertisement information, use the following commands in EXEC mode, as needed:
Configuration Examples
This following configuration example configures conditional route injection for the inject-map named ORIGINATE and the exist-map named LEARNED_PATH:
Command Reference
This section documents new and modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.2 command reference publications.
New Commands
• bgp inject-map exist-map • show ip bgp injected-paths
Modified Commands
• show ip bgp
bgp inject-map exist-map: To inject a more specific route into a Border Gateway Protocol (BGP) routing table, use the bgp inject-map exist-map command in address family or router configuration mode. To disable the conditional injection of a selected route, use the no form of this command.
bgp inject-map {inject-map-name} exist-map {exist-map-name}[copy-attributes]no bgp inject-map {inject-map-name} exist-map {exist-map-name}[copy-attributes]
Syntax Description:
inject-map-name: Defines the prefixes that will be created and installed to the local BGP table.
exist-map-name: Specifies the prefix that the BGP speaker will track.
copy-attributes: (Optional) Configures the injected route to inherit the attributes of the aggregate route.
Defaults:The BGP Conditional Route Injection feature is not enabled by default.
Command Modes: Address family configuration, Router configuration
Examples The following example configures the router for conditional route injection:
Related Commands
show ip bgp: To display entries in the Border Gateway Protocol (BGP) routing table, use the show ip bgp command in EXEC command.
show ip bgp [network] [network-mask] [longer-prefixes] [prefix-list prefix-list-name | route-map route-map-name] [shorter prefixes mask-length]
Syntax Description:
Command Modes EXEC
show ip bgp Field Descriptions
Related Commands: clear ip bgp, neighbor soft-reconfiguration
The following is sample output from the show ip bgp command in EXEC mode when you specify the longer-prefixes keyword:
Router# show ip bgp 10.92.0.0 255.255.0.0 longer-prefixes
BGP table version is 1738, local router ID is 192.168.72.24
Status codes: s suppressed, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
10.0.0.2 from 10.0.0.2 (2.2.2.2)
Origin incomplete, localpref 100, valid, external, best
Community:957874231
200Origin incomplete, localpref 100, valid, external, best
Community:957874231
10.0.0.2 from 10.0.0.2 (2.2.2.2) Origin incomplete, metric 0, localpref 100, valid, external
The following sample output is similar to the output that will be displayed when the show ip bgp injected-routes command is entered:
Router# show ip bgp injected-paths BGP table version is 11, local router ID is 10.0.0.1 Status codes:s suppressed, d damped, h history, * valid, > best, i -internal Origin codes:i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.0.0 10.0.0.2 0 ? *> 172.17.0.0/16 10.0.0.2 0 ?
Troubleshooting Tips
The BGP Conditional Route Injection feature is based on the injection of a more specific prefix into the BGP routing table when a less specific prefix is present. If conditional route injection is not working properly, check the following:
- If conditional route injection is configured but does not occur, check for the existence of the aggregate prefix in the BGP routing table. The existence (or not) of the tracked prefix in the BGP routing table can be verified with the show ip bgp command.
- If the aggregate prefix exists but conditional route injection does not occur, verify that the aggregate prefix is being received from the correct neighbor and the prefix list identifying that neighbor is a /32 match.
- Verify the injection (or not) of the more specific prefix using the show ip bgp injected-paths command.
- Verify that the prefix that is being injected is not outside of the scope of the aggregate prefix.
- Ensure that the inject route map is configured with the set ip address command and not the match ip address command.
To display BGP conditional advertisement information, use the following commands in EXEC mode, as needed:
Command | Purpose |
Router# show ip bgp | Displays entries in the BGP routing table. |
Router# show ip bgp injected-paths | Displays paths in the BGP routing table that were conditionally injected. |
Router# show ip bgp neighbors | Displays information about the TCP and BGP connections to neighbors. |
Configuration Examples
This following configuration example configures conditional route injection for the inject-map named ORIGINATE and the exist-map named LEARNED_PATH:
router bgp 109 bgp inject-map ORIGINATE exist-map LEARNED_PATH ! route-map LEARNED_PATH permit 10 match ip address prefix-list ROUTE match ip route-source prefix-list ROUTE_SOURCE ! route-map ORIGINATE permit 10 set ip address prefix-list ORIGINATED_ROUTES set community 14616:555 additive ! ip prefix-list ROUTE permit 10.1.1.0/24 ! ip prefix-list ORIGINATED_ROUTES permit 10.1.1.0/25 ip prefix-list ORIGINATED_ROUTES permit 10.1.1.128/25 ! ip prefix-list ROUTE_SOURCE permit 10.2.1.1/32
Command Reference
This section documents new and modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.2 command reference publications.
New Commands
• bgp inject-map exist-map • show ip bgp injected-paths
Modified Commands
• show ip bgp
bgp inject-map exist-map: To inject a more specific route into a Border Gateway Protocol (BGP) routing table, use the bgp inject-map exist-map command in address family or router configuration mode. To disable the conditional injection of a selected route, use the no form of this command.
bgp inject-map {inject-map-name} exist-map {exist-map-name}[copy-attributes]no bgp inject-map {inject-map-name} exist-map {exist-map-name}[copy-attributes]
Syntax Description:
inject-map-name: Defines the prefixes that will be created and installed to the local BGP table.
exist-map-name: Specifies the prefix that the BGP speaker will track.
copy-attributes: (Optional) Configures the injected route to inherit the attributes of the aggregate route.
Defaults:The BGP Conditional Route Injection feature is not enabled by default.
Command Modes: Address family configuration, Router configuration
Examples The following example configures the router for conditional route injection:
(config-router)# bgp inject-map map1 exist-map map2 copy-attributes
Related Commands
Command | Description |
ip prefix-list | Displays information about a prefix list or prefix list entries. |
neighbor remote-as | Adds an entry to the BGP or multiprotocol BGP neighbor table. |
route-map (IP) | Defines the conditions for redistributing routes from one routing protocol into another, or enables policy routing. |
show ip bgp | Displays entries in the BGP routing table. |
show ip bgp injected-paths | Displays injected paths in the BGP routing table. |
show ip bgp: To display entries in the Border Gateway Protocol (BGP) routing table, use the show ip bgp command in EXEC command.
show ip bgp [network] [network-mask] [longer-prefixes] [prefix-list prefix-list-name | route-map route-map-name] [shorter prefixes mask-length]
Syntax Description:
Argument | Description |
network | (Optional) Network number, entered to display a particular network in the BGP routing table. |
network-mask | (Optional) Displays all BGP routes matching the address and mask pair. |
longer-prefixes | (Optional) Displays the route and more specific routes. |
prefix-list | route-map | (Optional) Displays selected routes from a BGP routing table based on the contents of a prefix list or route map. |
prefix-list-name | route-map-name | (Optional) The name of the route map or prefix list that is specified for the above argument. |
shorter prefixes mask-length | (Optional) Displays learned prefixes that are longer than the maximum length but shorter than the specified mask for the prefix. |
Command Modes EXEC
show ip bgp Field Descriptions
Field | Description |
BGP table version | Internal version number of the table. This number is incremented whenever the table changes. |
local router ID | IP address of the router. |
Status codes | Status of the table entry. The status is displayed at the beginning of each line in the table. It can be one of the following values: s—The table entry is suppressed. d—The table entry is dampened. h—The table entry history. *—The table entry is valid. >—The table entry is the best entry to use for that network. i—The table entry was learned via an internal BGP (iBGP) session. |
Origin codes | Origin of the entry. The origin code is placed at the end of each line in the table. It can be one of the following values: i—Entry originated from Interior Gateway Protocol (IGP) and was advertised with a network router configuration command. e—Entry originated from Exterior Gateway Protocol (EGP). ?—Origin of the path is not clear. Usually, this is a router that is redistributed into BGP from an IGP. |
Network | IP address of a network entity. |
Next Hop | IP address of the next system that is used when forwarding a packet to the destination network. An entry of 0.0.0.0 indicates that the router has some non-BGP routes to this network. |
Metric | If shown, the value of the interautonomous system metric. |
LocPrf | Local preference value as set with the set local-preference route-map configuration command. The default value is 100. |
Weight | Weight of the route as set via autonomous system filters. |
Path | Autonomous system paths to the destination network. There can be one entry in this field for each autonomous system in the path. |
Related Commands: clear ip bgp, neighbor soft-reconfiguration
The following is sample output from the show ip bgp command in EXEC mode when you specify the longer-prefixes keyword:
Router# show ip bgp 10.92.0.0 255.255.0.0 longer-prefixes
BGP table version is 1738, local router ID is 192.168.72.24
Status codes: s suppressed, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
show ip bgp injected-paths: To display all the injected paths in the BGP routing table, use the show ip bgp injected-paths command in EXEC mode.
show ip bgp injected-paths
Examples The following is sample output from the show ip bgp injected-paths command in EXEC mode:
Router# show ip bgp injected-paths
BGP table version is 11, local router ID is 10.0.0.1
Status codes:s suppressed, d damped, h history, * valid, > best, i -
internal
Origin codes:i - IGP, e - EGP, ? - incomplete
Network | Next Hop | Metric | LocPrf | Weight | Path | |
*> | 172.16.0.0 | 10.0.0.2 | 0 | ? | ||
*> | 172.17.0.0/16 | 10.0.0.2 | 0 | ? |
show ip bgp injected-paths Field Descriptions
Field | Description |
BGP table version | Internal version number of the table. This number is incremented whenever the table changes. |
local router ID | IP address of the router. |
Status codes | Status of the table entry. The status is displayed at the beginning of each line in the table. It can be one of the following values: s—The table entry is suppressed. d—The table entry is dampened. h—The table entry history. *—The table entry is valid. >—The table entry is the best entry to use for that network. i—The table entry was learned via an internal BGP (iBGP) session. |
Origin codes | Origin of the entry. The origin code is placed at the end of each line in the table. It can be one of the following values: i—Entry originated from Interior Gateway Protocol (IGP) and was advertised with a network router configuration command. e—Entry originated from Exterior Gateway Protocol (EGP). ?—Origin of the path is not clear. Usually, this is a router that is redistributed into BGP from an IGP. |
Network | IP address of a network entity. |
Next Hop | IP address of the next system that is used when forwarding a packet to the destination network. An entry of 0.0.0.0 indicates that the router has some non-BGP routes to this network. |
Metric | If shown, the value of the interautonomous system metric. |
LocPrf | Local preference value as set with the set local-preference route-map configuration command. The default value is 100. |
Weight | Weight of the route as set via autonomous system filters. |
Path | Autonomous system paths to the destination network. There can be one entry in this field for each autonomous system in the path. |