statistic mode

Function

The statistic mode command switches the statistics collection mode on an interface.

The undo statistic mode command restores the default setting.

By default, the device collects packet statistics for an interface based on packets' destination MAC addresses.

Format

statistic mode { forward | mac }

undo statistic mode

Parameters

Parameter Description Value
forward

Enables the device to collect packet statistics for an interface based on packets' forwarding modes. That is, statistics for IPv4 and IPv6 packets are collected separately.

-

mac

Enables the interface to collect statistics based on the destination MAC address of packets.

-

Views

100GE interface view, 10G LAN interface view, 10G WAN interface view, 400GE interface view, 40GE interface view, Eth-Trunk sub-interface view, Eth-Trunk interface view, GE sub-interface view, GE interface view, GE electrical interface view, Global VE sub-interface view, PW-VE sub-interface view, VBDIF interface view, VE sub-interface view, VLANIF interface view, Management interface view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
forwarding write

Usage Guidelines

Usage Scenario

By default, the device collects packet statistics for an interface based on packets' destination MAC addresses. If you want to modify the packet statistics collection mode, run the statistic mode command. For example, if you want to distinguish between IPv4 and IPv6 packets on an interface, specify the forward parameter in the statistic mode command so that the device will collect packet statistics based on packets' forwarding modes.

  • In MAC mode, statistics are collected based on the destination MAC address of Layer 2 packets. If an interface forwards only IPv4 packets, statistics are collected in MAC mode, and no configuration file is generated.
  • In forward mode, statistics are collected based on the destination IP address of Layer 3 packets. If an interface needs to forward both IPv4 and IPv6 packets, statistics are collected in forward mode, and a configuration file is generated.

Configuration Impact

If a device is enabled to collect packet statistics for an interface based on the packets' forwarding mode, statistics about IPv4 unicast and IPv6 unicast packets are added in the command output after the display interface command is run.

Example

# Enable the device to collect packet statistics for GE0/1/0 based on packets' forwarding modes.
<HUAWEI> system-view
<~HUAWEI> interface GigabitEthernet 0/1/0
[~HUAWEI-GigabitEthernet0/1/0] statistic mode forward
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >