No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CLI-based Configuration Guide - Network Management and Monitoring

AR100, AR120, AR150, AR160, AR200, AR1200, AR2200, AR3200, and AR3600 V200R009

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Example for Configuring IP Accounting

Example for Configuring IP Accounting

This section provides the IP accounting configuration procedure.

Networking Requirements

As shown in Figure 13-1, host A and host B connect to GE1/0/0 of the router through a switch, and host C is connected to GE2/0/0. Statistics about the IP packets from host A and host B to GE1/0/0 need to be collected, and statistics about the IP packets received on GE2/0/0 need to be collected based on IP precedence.

The IP address of GE1/0/0 is 192.168.1.1/24, of host A is 192.168.1.100/24, and of host B is 192.168.1.200/24. The IP address of GE2/0/0 is 192.168.2.1/24 and of host C is 192.168.2.10/24.

Figure 13-1  Networking diagram of IP accounting configuration

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure IP accounting rules for host A and host B.
  2. Enable common IP accounting on GE1/0/0.
  3. Enable IP precedence accounting on GE2/0/0.

Procedure

  1. Configure IP accounting on the router.

    # Configure an IP address for GE1/0/0.

    <Huawei> system-view
    [Huawei] sysname Router
    [Router] interface gigabitethernet 1/0/0
    [Router-GigabitEthernet1/0/0] ip address 192.168.1.1 255.255.255.0
    [Router-GigabitEthernet1/0/0] quit
    

    # Configure an IP address for GE2/0/0.

    [Router] interface gigabitethernet 2/0/0
    [Router-GigabitEthernet2/0/0] ip address 192.168.2.1 255.255.255.0
    [Router-GigabitEthernet2/0/0] quit
    

    # Configure IP accounting rules on the router.

    [Router] ip accounting rule 192.168.1.0 255.255.255.0
    

    # Enable common IP accounting for the IP packets received by GE1/0/0.

    [Router] interface gigabitethernet 1/0/0
    [Router-GigabitEthernet1/0/0] ip accounting input-packets
    [Router-GigabitEthernet1/0/0] quit
    

    # Enable IP precedence accounting for the IP packets received by GE2/0/0.

    [Router] interface gigabitethernet 2/0/0
    [Router-GigabitEthernet2/0/0] ip accounting input-packets
    [Router-GigabitEthernet2/0/0] ip accounting precedence input-packets
    [Router-GigabitEthernet2/0/0] quit
    [Router] quit
    

  2. Verify the configuration.

    # Run the display ip accounting input-packets matched command on the router to view statistics about the IP packets sent by host A and host B.

    <Router> display ip accounting input-packets matched
    The matched list contains 2 incoming streams.
    Source          Destination     Protocol Packets      Bytes        Age(Unit:Min)
    192.168.1.100   192.168.200.155 1        10           840          10
    192.168.1.200   192.168.200.155 1        1            100          10
    

    # Run the display ip accounting precedence command on the router to view statistics about the IP packets received by GE2/0/0. The statistics are displayed based on IP precedence.

    <Router> display ip accounting precedence
    Precedence Packets          Bytes
    Input
    0          4611010          392075935
    6          10               840
    Output
    

Configuration File

Configuration file of the router
#
 sysname Router
#
 ip accounting rule 192.168.1.0 255.255.255.0
#
interface GigabitEthernet1/0/0
 ip address 192.168.1.1 255.255.255.0
 ip accounting input-packets
#
interface GigabitEthernet2/0/0
 ip address 192.168.2.1 255.255.255.0
 ip accounting input-packets
 ip accounting precedence input-packets
#
return
Translation
Download
Updated: 2019-05-17

Document ID: EDOC1000174072

Views: 100009

Downloads: 331

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next