BGP Policy Accounting Commands

The command-line interface (CLI) commands that you need to configure and verify BGP Policy Accounting are as follows:

  • router(config-if)# bgp-policy accounting [input | output] [source]

    enables BGP policy accounting for the interface.

    - Use the optional input or output keyword to account for traffic

    either entering or exiting the router. By default, BGP policy accounting is based on traffic entering the router (input).

    - Use the optional source keyword to account for traffic based on source

    address (source lookup classification).

  • Router(config-route-map)# set traffic-index bucket-number

    Applied under the route-map submenu, this command indicates where to collect output packets that pass a match clause of a route map for BGP policy accounting.

  • Router(config-router)# table-map route-map-name

    Applied under the BGP process submenu, this command classifies BGP prefixes entered in the routing table and sets the traffic index next to the entries in the FIB.

  • Router# show cef interface [type number] policy-statistics [input | output]

    displays the per-interface traffic statistics. You can display BGP accounting policy statistics based on traffic traveling through an input interface (input) or output interface (output) by using the appropriate keyword.

  • Router# clear ip bgp [ipv4 | ipv6 | vpnv4] table-map

    reassigns the traffic indexes in case of change or removal. Note that this command does not clear the BGP Policy Accounting counters.


It is recommended that you consult the specific documentation for your specific IOS release to better understand route-map commands as well as other regular expressions. They are very useful in conjunction with the BGP Policy Accounting feature.

Part II: Implementations on the Cisco Devices