Table Of Contents
MAC Address Accounting and Precedence Accounting
Configure IP MAC Accounting on an Interface
Configure IP Precedence Accounting on an Interface
MAC Address Accounting and Precedence Accounting
Feature Summary
The MAC address accounting feature provides accounting information for IP traffic based on the source and destination MAC addresses on LAN interfaces. This feature calculates the total packet and byte counts for a LAN interface that receives or sends IP packets to or from a unique MAC address. It also records a timestamp for the last packet received or sent. For example, with this feature you can determine how much traffic is being sent to and/or received from various peers at NAPS/peering points. This feature is currently supported on Ethernet, FastEthernet, and FDDI interfaces and supports Cisco Express Forwarding (CEF), distributed CEF (dCEF), flow, and optimum switching.
The precedence accounting feature provides accounting information for IP traffic based on the precedence on any interface. This feature calculates the total packet and byte counts for an interface that receives or sends IP packets and sorts the results based on IP precedence. This feature is supported on the main interface and supports CEF, dCEF, flow, and optimum switching.
Document Conventions
Command descriptions use these conventions:
•
Boldface indicates commands and keywords that are entered literally as shown.
•
Italics indicate arguments for which you supply values; in contexts that do not allow italics, arguments are enclosed in angle brackets ( >).
•
Square brackets ([ ]) indicate optional elements.
•
Braces ({ }) group required choices, and vertical bars ( | ) separate alternative elements.
•
Braces and vertical bars within square brackets ([{ | }]) indicate a required choice within an optional element.
Platforms
This feature is supported on these platforms:
•
Cisco 7200 series
•
Cisco 7500 series
•
Cisco 7000 series routers with the RSP7000 and RSP7000CI
Supported MIBs and RFCs
This feature supports the Cisco IP Statistics MIB (CISCO-IP-STAT-MIB.my). For descriptions of supported MIBs and how to use MIBs, see Cisco's MIB website on CCO at the following URL:
http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml
No RFCs are supported by this feature.
Configuration Tasks
The following sections describe how to configure IP accounting on an interface based on the MAC address and based on IP precedence.
Configure IP MAC Accounting on an Interface
This section assumes you have already configured the interface and are adding the IP accounting feature.
To configure the interface for IP accounting based on the MAC address, perform the following steps beginning in global configuration mode:
To remove IP accounting based on the MAC address from the interface, use the no ip accounting mac-address command.
Configure IP Precedence Accounting on an Interface
This section assumes you have already configured the interface and are adding the IP accounting feature.
To configure the interface for IP accounting based on IP precedence, perform the following steps beginning in global configuration mode:
To remove IP accounting based on IP precedence from the interface, use the no ip accounting precedence command.
Configuration Examples
The following example enables IP accounting based on the source and destination MAC address and based on IP precedence for received and transmitted packets.
router# configure terminalrouter(config)# interface ethernet 4/0/0router(config-if)# ip accounting mac-address inputrouter(config-if)# ip accounting mac-address outputrouter(config-if)# ip accounting precedence inputrouter(config-if)# ip accounting precedence outputrouter(config-if)# endrouter#Command Reference
This section documents new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 11.1 command references.
ip accounting mac-address
To enable IP accounting on a LAN interface based on the source and destination MAC address, use the ip accounting mac-address interface configuration command. To disable IP accounting based on the source and destination MAC address, use the no form of this command.
ip accounting mac-address {input | output}
no ip accounting mac-address {input | output}Syntax Description
input
Perform accounting based on the source MAC address on received packets.
output
Perform accounting based on the destination MAC address on transmitted packets.
Default
Disabled
Command Mode
Interface configuration
Usage Guidelines
This command first appeared in Cisco IOS Release 11.1 CC.
This feature is supported on Ethernet, FastEthernet, and FDDI interfaces.
To display the MAC accounting information, use the show interface mac EXEC command.
The MAC address accounting feature provides accounting information for IP traffic based on the source and destination MAC address on LAN interfaces. This feature calculates the total packet and byte counts for a LAN interface that receives or sends IP packets to or from a unique MAC address. It also records a timestamp for the last packet received or sent. With this feature you can determine how much traffic is being sent to and/or received from various peers at NAPS/peering points.
Examples
The following example enables IP accounting based on the source and destination MAC address for received and transmitted packets:
router# configure terminalrouter(config)# interface ethernet 4/0/0router(config-if)# ip accounting mac-address inputrouter(config-if)# ip accounting mac-address outputrouter(config-if)# endrouter#Related Commands
ip accounting precedence
To enable IP accounting on any interface based on IP precedence, use the ip accounting precedence interface configuration command. To disable IP accounting based on IP precedence, use the no form of this command.
ip accounting precedence {input | output}
no ip accounting precedence {input | output}Syntax Description
input
Perform accounting based on IP precedence on received packets.
output
Perform accounting based on IP precedence on transmitted packets.
Default
Disabled
Command Mode
Interface configuration
Usage Guidelines
This command first appeared in Cisco IOS Release 11.1 CC.
To display IP precedence accounting information, use the show interface precedence EXEC command.
The precedence accounting feature provides accounting information for IP traffic, summarized by IP precedence value(s). This feature calculates the total packet and byte counts for an interface that receives or sends IP packets and sorts the results based on IP precedence. This feature is supported on main interfaces and supports CEF, dCEF, flow, and optimum switching.
Examples
The following example enables IP accounting based on IP precedence for received and transmitted packets:
router# configure terminalrouter(config)# interface ethernet 4/0/0router(config-if)# ip accounting precedence inputrouter(config-if)# ip accounting precedence outputrouter(config-if)# endrouter#Related Commands
show interfaces mac
To display MAC accounting information for interfaces configured for MAC accounting, use the show interfaces mac EXEC command.
show interface [type number] mac
Syntax Description
Command Mode
EXEC
Usage Guidelines
This command first appeared in Cisco IOS Release 11.1 CC.
The show interface mac command displays information for all interfaces configured for MAC accounting. To display information for a single interface, use the show interface type number mac command.
For incoming packets on the interface, the accounting statistics are gathered before the CAR/DCAR feature is performed on the packet. For outgoing packets on the interface, the accounting statistics are gathered after output CAR, before output DCAR or DWRED or DWFQ feature is performed on the packet. Therefore, if a you are using DCAR or DWRED on the interface and packets are dropped, the dropped packets are still counted in the show interface mac command because the calculations are done prior to the features.
The maximum number of MAC addresses that can be stored for the input address is 512 and the maximum number of MAC address that can be stored for the output address is 512. After the maximum is reached, subsequent MAC addresses are ignored.
To clear the accounting statistics, use the clear counter EXEC command.
To configure an interface for IP accounting based on the MAC address, use the ip accounting mac-address interface configuration command.
Sample Display
The following is sample output from the show interface mac command. This feature calculates the total packet and byte counts for the interface that receives (input) or sends (output) IP packets to or from a unique MAC address. It also records a timestamp for the last packet received or sent.
Router# show interface ethernet 0/1/1 macEthernet0/1/1Input (511 free)0007.f618.4449(228): 4 packets, 456 bytes, last: 2684ms agoTotal: 4 packets, 456 bytesOutput (511 free)0007.f618.4449(228): 4 packets, 456 bytes, last: 2692ms agoTotal: 4 packets, 456 bytesRelated Commands
show interface precedence
To display precedence accounting information for an interface configured for precedence accounting, use the show interfaces precedence EXEC command.
show interface type number precedence
Syntax Description
Command Mode
EXEC
Usage Guidelines
This command first appeared in Cisco IOS Release 11.1 CC.
The show interface precedence command displays information for all interfaces configured for IP precedence accounting. To display information for a single interface, use the show interface type number precedence command.
For incoming packets on the interface, the accounting statistics are gathered before input CAR/DCAR is performed on the packet. Therefore, if CAR/DCAR changes the precedence on the packet, it is counted based on the old precedence setting with the show interface precedence command.
For outgoing packets on the interface, the accounting statistics are gathered after output DCAR or DWRED or DWFQ feature is performed on the packet.
To clear the accounting statistics, use the clear counter EXEC command.
To configure an interface for IP accounting based on IP precedence, use the ip accounting precedence interface configuration command.
Sample Display
The following is sample output from the show interface precedence command. This feature calculates the total packet and byte counts for an interface that receives (input) or sends (output) IP packets and sorts the results based on IP precedence.
Router# show interface ethernet 0/1/1 precedenceEthernet0/1/1InputPrecedence 0: 4 packets, 456 bytesOutputPrecedence 0: 4 packets, 456 bytesRelated Commands