|
|
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 all interfaces and subinterfaces and supports CEF, dCEF, flow, and optimum switching.
Command descriptions use these conventions:
This feature is supported on these platforms:
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.
The following sections describe how to configure IP accounting on an interface based on the MAC address and based on IP precedence.
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:
| Task | Command |
|---|---|
Step 1 Specify the interfaces (or subinterface) and enter interface configuration mode. | interface type number |
Step 2 Configure IP accounting based on the MAC address of received (input) or transmitted (output) packets. | ip accounting mac-address {input | output} |
Step 3 Exit configuration mode. | end |
Step 4 Verify the configuration. | show running-config |
To remove IP accounting based on the MAC address from the interface, use the no ip accounting mac-address command.
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:
| Task | Command |
|---|---|
Step 1 Specify the interfaces (or subinterface) and enter interface configuration mode. | interface type number |
Step 2 Configure IP accounting based on the precedence of received (input) or transmitted (output) packets. | ip accounting precedence {input | output} |
Step 3 Exit configuration mode. | end |
Step 4 Verify the configuration. | show running-config |
To remove IP accounting based on IP precedence from the interface, use the no ip accounting precedence command.
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 terminal
router(config)# interface ethernet 4/0/0
router(config-if)# ip accounting mac-address input
router(config-if)# ip accounting mac-address output
router(config-if)# ip accounting precedence input
router(config-if)# ip accounting precedence output
router(config-if)# end
router#
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.
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}
input | Perform accounting based on the source MAC address on received packets. |
output | Perform accounting based on the destination MAC address on transmitted packets. |
Disabled
Interface configuration
This command first appeared in Cisco IOS Release 11.1 CC.
This feature is supported on Ethernet, FastEthernet, and FDDI interfaces and subinterfaces.
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.
The following example enables IP accounting based on the source and destination MAC address for received and transmitted packets:
router# configure terminal
router(config)# interface ethernet 4/0/0
router(config-if)# ip accounting mac-address input
router(config-if)# ip accounting mac-address output
router(config-if)# end
router#
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}
input | Perform accounting based on IP precedence on received packets. |
output | Perform accounting based on IP precedence on transmitted packets. |
Disabled
Interface configuration
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 all interfaces and subinterfaces and supports CEF, dCEF, flow, and optimum switching.
The following example enables IP accounting based on IP precedence for received and transmitted packets:
router# configure terminal
router(config)# interface ethernet 4/0/0
router(config-if)# ip accounting precedence input
router(config-if)# ip accounting precedence output
router(config-if)# end
router#
To display MAC accounting information for interfaces configured for MAC accounting, use the show interfaces mac EXEC command.
show interface [type number] mac
type | Interface type (for example, Ethernet, FastEthernet) supported on your router. |
number | Port number of the interface. The syntax varies depending on the type of router. For example, on a Cisco 7500 series router the syntax is 0/0/0, where 0 represents the slot, port adapter, and port number (the slash is required). Refer to the appropriate hardware manual for numbering information. |
EXEC
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.
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 mac
Ethernet0/1/1
Input (511 free)
0007.f618.4449(228): 4 packets, 456 bytes, last: 2684ms ago
Total: 4 packets, 456 bytes
Output (511 free)
0007.f618.4449(228): 4 packets, 456 bytes, last: 2692ms ago
Total: 4 packets, 456 bytes
To display precedence accounting information for an interface configured for precedence accounting, use the show interfaces precedence EXEC command.
show interface type number precedence
type | Interface type (for example, ethernet, fastethernet) supported on your router. |
number | Port number of the interface. The syntax varies depending on the type of router. For example, on a Cisco 7500 series router the syntax is 0/0/0, where 0 represents the slot, port adapter, and port number (the slash is required). Refer to the appropriate hardware manual for numbering information. |
EXEC
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.
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 precedence
Ethernet0/1/1
Input
Precedence 0: 4 packets, 456 bytes
Output
Precedence 0: 4 packets, 456 bytes
|
|