Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

How to configure the BGP Policy Accounting feature

Core Issue

The Border Gateway Protocol (BGP) is the interdomain routing protocol of choice for most service providers. This is because it is critical to the service provider operations to have accounting and billing customers carry their traffic. The BGP Policy Accounting feature classifies and measures IP traffic sent or received from BGP peers. This is used for billing customers.


To resolve this issue, perform these steps:
  1. Traffic can be classified based on BGP community or Autonomous System (AS)-Path attributes.

    To classify traffic based on BGP community attribute, create a numbered or named community list for BGP by issuing the ip community-list command in global configuration mode.

    To classify traffic based on the BGP AS-Path attribute, define a BGP AS-Path Access Control List (ACL) by issuing the ip as-path access-list command in global configuration mode.

  2. Configure a route map to match the configured community or AS-Path list and set the bucket into which packet and byte statistics are collected. To configure a route map, issue the route-map command in global configuration mode.
  3. To match a BGP community, issue the match community command in route-map configuration mode or match a BGP AS-Path ACL by issuing the match as-path command in route-map configuration mode.

    To indicate how to classify packets that pass a match clause of a route map for BGP policy accounting, issue the set traffic-index command in route-map configuration mode.

  4. To modify the bucket number when the IP routing table is updated with routes learned from BGP, issue the table-map command in router configuration mode.
  5. Enable policy accounting on the router's interfaces. To enable BGP Policy Accounting or policy propagation on an interface, issue the bgp-policy command in interface configuration mode and use the accounting keyword.

For additional information on configuring Policy Accounting, refer to BGP Policy Accounting and BGP Policy Accounting Output Interface Accounting Features.

Problem Type


IP Routing Protocols