Using Route Maps for Attribute Modification in BGP

Learn to implement BGP attribute modification using route maps for traffic engineering and routing policy control. Covers local preference, MED, AS path prepending, communities, and complex policy examples with verification commands.

Using Route Maps for Attribute Modification in BGP

Route maps serve as BGP's primary policy engine for attribute modification, giving you granular control over path selection, traffic engineering, and routing behavior. Understanding how to implement effective routing policies through route map attribute modification is essential for managing enterprise BGP deployments and passing the CCNP ENARSI exam.

Route Map Structure for BGP Attribute Modification

Route maps operate as conditional statements that match specific criteria and apply actions. For BGP attribute modification, you'll primarily work with set statements that modify path attributes based on match conditions.

route-map POLICY_NAME {permit | deny} sequence-number
 match {condition}
 set {attribute modification}

The sequence number determines processing order, with lower numbers processed first. If no match occurs, routes are implicitly denied unless you include a final permit statement.

Common BGP Attributes for Modification

Local Preference Manipulation

Local preference influences outbound path selection within your AS. Higher values are preferred, making it ideal for implementing primary/backup scenarios.

route-map INBOUND_POLICY permit 10
 match as-path 100
 set local-preference 200
!
route-map INBOUND_POLICY permit 20
 match as-path 200
 set local-preference 150
!
route-map INBOUND_POLICY permit 30

Apply this route map to incoming BGP updates:

router bgp 65001
 neighbor 10.1.1.2 remote-as 65002
 neighbor 10.1.1.2 route-map INBOUND_POLICY in

MED (Multi-Exit Discriminator) Configuration

MED influences inbound traffic by suggesting preferred entry points to neighboring ASes. Lower MED values are preferred.

route-map SET_MED permit 10
 match ip address prefix-list CRITICAL_PREFIXES
 set metric 50
!
route-map SET_MED permit 20
 match ip address prefix-list NORMAL_PREFIXES
 set metric 100
!
route-map SET_MED permit 30

AS Path Manipulation

AS path prepending artificially lengthens the AS path to make routes less attractive for inbound traffic engineering.

route-map AS_PATH_PREPEND permit 10
 match ip address prefix-list BACKUP_PATH
 set as-path prepend 65001 65001 65001
!
route-map AS_PATH_PREPEND permit 20

Advanced Attribute Modification Techniques

Community String Assignment

BGP communities enable sophisticated routing policies across AS boundaries. Use standard communities for common policies and extended communities for more granular control.

ip community-list standard CUSTOMER_ROUTES permit 65001:100
ip community-list standard PEER_ROUTES permit 65001:200
ip community-list standard PROVIDER_ROUTES permit 65001:300
!
route-map COMMUNITY_POLICY permit 10
 match ip address prefix-list CUSTOMER_PREFIXES
 set community 65001:100
!
route-map COMMUNITY_POLICY permit 20
 match ip address prefix-list PEER_PREFIXES
 set community 65001:200
!
route-map COMMUNITY_POLICY permit 30
 set community 65001:300

Next-Hop Modification

Next-hop modification is crucial for route reflectors and multi-homed scenarios where you need to control the next-hop behavior.

route-map NEXT_HOP_SELF permit 10
 set ip next-hop self
!
route-map NEXT_HOP_UNCHANGED permit 10
 set ip next-hop unchanged

Complex Route Map Examples

Traffic Engineering with Multiple Attributes

This example demonstrates comprehensive traffic engineering using multiple attribute modifications:

ip prefix-list PRIMARY_PATH permit 192.168.0.0/16
ip prefix-list BACKUP_PATH permit 10.0.0.0/8
!
route-map TRAFFIC_ENGINEERING permit 10
 match ip address prefix-list PRIMARY_PATH
 set local-preference 300
 set community 65001:primary
 set metric 50
!
route-map TRAFFIC_ENGINEERING permit 20
 match ip address prefix-list BACKUP_PATH
 set local-preference 150
 set community 65001:backup
 set as-path prepend 65001 65001
 set metric 200
!
route-map TRAFFIC_ENGINEERING permit 30

Conditional Attribute Setting

Use route maps to apply different policies based on multiple match criteria:

route-map CONDITIONAL_POLICY permit 10
 match as-path 100
 match ip address prefix-list CRITICAL_NETWORKS
 set local-preference 400
 set community 65001:critical
!
route-map CONDITIONAL_POLICY permit 20
 match as-path 100
 set local-preference 200
!
route-map CONDITIONAL_POLICY permit 30
 match community PEER_COMMUNITY
 set local-preference 150
 set metric 100

Verification and Troubleshooting

Verify route map application and attribute modification using these commands:

show ip bgp neighbors 10.1.1.2 advertised-routes
show ip bgp neighbors 10.1.1.2 received-routes
show route-map POLICY_NAME
show ip bgp 192.168.1.0/24

Use debug commands sparingly in production environments:

debug ip bgp updates
debug ip policy

Best Practices for Route Map Implementation

Document your routing policies thoroughly, including the business logic behind each route map. Use descriptive names and include permit statements at the end of route maps to avoid implicit denials. Test route map changes in a lab environment before production deployment, and always have a rollback plan when implementing complex routing policies.

Monitor the impact of attribute modifications on your routing table size and convergence times. Large-scale attribute modifications can affect router performance, particularly on older hardware.

What's Next

Now that you understand route map attribute modification in BGP, the next logical step is exploring advanced BGP features like route reflectors and confederation design. These topics build on your route map knowledge to create scalable iBGP architectures in large enterprise networks.

🔧
Use comprehensive network monitoring tools to track BGP route changes and validate that your route map policies are working as expected. PRTG Network Monitor, SolarWinds NPM and Nagios.

Tools and resources for this topic