39 IP A CCOUNTING CONFIGURATIONWhen configuring IP accounting, go to these sections for information you areinterested in:■ “Introduction to IP Accounting” on page 619■ “Configuring IP Accounting” on page 619■ “IP Accounting Configuration Example” on page 620■ “Displaying and Maintaining IP Accounting Configuration” on page 622Introduction to IPAccountingThe IP accounting feature implements the statistics of incoming and outgoing IPpackets on the router. These IP packets include those sent and forwarded by therouter normally as well as those denied by the firewall.The statistics of the IP accounting includes information such as source anddestination IP addresses, protocol number, packet sum, and byte sum. Thestatistics results of IP packets passing the firewall and those matching the IPaccounting rule are respectively stored and displayed.Each IP accounting rule consists of an IP address and its mask, namely, a subnetaddress, which is the result of ANDing the IP address with its mask. IP packets aresorted as follows:■ If a firewall is configured on an interface and incoming and outgoing IP packetsare denied by the firewall, these IP packets are counted in the firewall-deniedtable.■ If the source or destination IP address of the IP packets passing the interface orthe firewall, if configured, matches a network address in the IP accounting rule,the packets are counted in the interior table. Otherwise, the packets arecounted in the exterior table.■ If the statistics information of an entry in an accounting table is not updatedwithin its aging time, the router considers that the entry time out and deletesthem.Configuring IPAccountingConfigurationPrerequisitesAssign an IP address and mask to the interface on which the IP accounting featureneeds to be enabled. If necessary, configure a firewall on the interface.Configuration Procedure Follow these steps to configure IP accounting: