Network Diagram
Configuration Procedure
Figure 184 Network diagram for IP accounting configuration
Eth 1 / 0
1 . 1 . 1 . 2 / 24
Host A
Router
1 . 1 . 1 . 1 / 24
Configure the router.
■
# Enable IP accounting.
<Router> system-view
[Router] ip count enable
# Configure an IP accounting rule.
[Router] ip count rule 1.1.1.1 24
# Set the aging time to 1440 minutes (24 hours).
[Router] ip count timeout 1440
# Set the maximum number of accounting entries in the interior table to 100.
[Router] ip count interior-threshold 100
# Set the maximum number of accounting entries in the exterior table to 20.
[Router] ip count exterior-threshold 20
# Assign Ethernet1/0 an IP address and count both incoming and outgoing IP
packets on it.
[Router] interface ethernet 1/0
[Router-Ethernet1/0] ip address 1.1.1.2 24
[Router-Ethernet1/0] ip count inbound-packets
[Router-Ethernet1/0] ip count outbound-packets
[Router-Ethernet1/0] quit
# Assign Ethernet1/1 an IP address.
[Router] interface ethernet 1/1
[Router-Ethernet1/1] ip address 2.2.2.1 24
[Router-Ethernet1/1] quit
Configure Host A and Host B.
■
# Configure static routes from Host A to Host B and from Host B to Host A. Ping
Host B from Host A.
Omitted.
Display the IP accounting information.
■
# Display IP accounting information on the router.
IP Accounting Configuration Example
Eth 1 / 1
2 . 2 . 2 . 1 / 24
Host B
2 . 2 . 2 . 2 / 24
621