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:
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.
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.
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.
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.
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.