Syntax
accounting enable
undo accounting enable
View
Traffic accounting view
Parameter
None
Description
Use the accounting
enable command to enable the traffic accounting
function on the traffic accounting card.
Use the undo accounting enable command
to disable the traffic accounting function on the traffic accounting card.
The traffic accounting card starts traffic
accounting immediately after the traffic accounting function is enabled.
By default, the traffic accounting function
is disabled on the traffic accounting card.
Example
# Enable the traffic accounting function.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] traffic-accounting
accounting-slot 3
[H3C-accounting-slot-3] accounting
enable
# Disable the traffic accounting function.
[H3C-accounting-slot-3] undo
accounting enable
Syntax
accounting-mode traffic
View
ISP domain view
Parameter
None
Description
Use the accounting-mode traffic command
to set the accounting mode to traffic accounting.
Use the undo accounting-mode traffic command
to restore the default accounting mode.
By default, the system adopts the time-based
accounting mode.
Example
# Set the
accounting mode to traffic accounting.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] domain cams
[H3C-isp-cams] accounting-mode
traffic
# Restore the default accounting mode.
[H3C-isp-cams] undo accounting-mode
traffic
Syntax
debugging traffic-accounting event
View
User view
Parameter
None
Description
Use the debugging traffic-accounting
event command to turn on debugging for traffic accounting.
Use the undo debugging
traffic-accounting event command to turn off debugging for traffic
accounting.
By default, debugging is turned off for
traffic accounting.
Example
# Turn on debugging for traffic accounting.
<H3C> debugging
traffic-accounting event
Syntax
display traffic-accounting
accounting-slot [ slot-num ]
View
Any view
Parameter
slot-num:
Traffic accounting slot.
Description
Use the display traffic-accounting-slot command
to display the configuration information of the traffic accounting slots.
If you specify the slot-num
argument, the command is executed to display the configuration information of
the specified traffic accounting slot. Otherwise, the command is executed to
display the configuration information of all traffic accounting slots.
At present, the
system supports only one traffic accounting slot. Therefore the same
configuration information is displayed regardless of whether you specify the
traffic accounting slot.
Example
# Display the configuration information of
traffic accounting slot 3.
<H3C> display
traffic-accounting accounting-slot 3
Accounting slot number : 2
traffic-slot 3
traffic accounting is enabled
Syntax
display traffic-accounting statistics [ ip-address ]
View
Any view
Parameter
ip-address: IP address.
Description
Use the display traffic-accounting
statistics command to display the traffic accounting statistics of one or
all online users.
If you specify the ip-address
argument, the command is executed to display the traffic accounting statistics
of the specified online IP address. Otherwise, this command is executed to
display the traffic accounting statistics of all the online IP addresses.
Example
# Display the traffic accounting statistics
of all online users.
<H3C> display
traffic-accounting statistics
User IP: 10.0.0.1
group name :somegroup
output octets low-32:
1920 output octets high-32: 0
input octets low-32 :
480 input octets high-32 : 0
User IP: 10.0.0.2
Syntax
display traffic-accounting traffic-group [ group-name ]
View
Any view
Parameter
group-name: Name of a traffic group.
Description
Use the display traffic-accounting
traffic-group command to display the configuration information of one or
all traffic groups.
If you specify the group-name
argument, this command is executed to display the configuration information of
the specified traffic group. Otherwise, it is executed to display the
configuration information of all traffic groups.
Example
# Display the configuration information of
the traffic group named somegroup.
<H3C> display
traffic-accounting traffic-group somegroup
Traffic group : somegroup
1.1.1.0/255.255.255.0
not referenced
# Display the configuration information of
all traffic groups.
<H3C> display
traffic-accounting traffic-group
Traffic group : default-group
0.0.0.0/0.0.0.0
not referenced
Traffic group : somegroup
1.1.1.0/255.255.255.0
referenced
Syntax
network ip-address { mask | mask-len
}
undo network
ip-address { mask | mask-len }
View
Traffic group view
Parameter
ip-address: IP address.
mask: Subnet mask.
Mask-len: Mask length.
Description
Use the network command to configure
a network address for the traffic group, so as to add a destination network
segment to the traffic group.
Use the undo network command to
remove a network address from the traffic group, so as to remove a destination
network segment from the traffic group.
The address range
of the network segment to be set for a traffic group can neither overlap the
existing address range of this traffic group nor be identical with the address
range of any other traffic group.
Example
# Add a network segment to the traffic
group named somegroup.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] traffic-accounting
traffic-group somegroup
[H3C-traffic-group-somegroup] network
10.0.0.0 16
# Remove the network segment from the
traffic group.
[H3C-traffic-group-somegroup] undo
network 10.0.0.0 16
Syntax
traffic-accounting accounting-slot slot-num
undo traffic-accounting accounting-slot slot-num
View
System view
Parameter
slot-num: Slot number.
Description
Use the traffic-accounting
accounting-slot command to specify a traffic accounting slot.
Use the undo traffic-accounting
accounting-slot command to remove the specified traffic accounting slot.
By default, no slot is specified as a
traffic accounting slot.
Related command: display
traffic-accounting accounting-slot.
Example
# Specify slot 2 as the traffic accounting
slot.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] traffic-accounting
accounting-slot 2
# Remove the specified traffic accounting
slot 2.
[H3C] undo traffic-accounting
accounting-slot 2
Syntax
traffic-accounting traffic-group group-name
undo traffic-accounting traffic-group group-name
View
System view
Parameter
group-name: Name of a traffic group, a string of up to 32 characters.
Description
Use the traffic-accounting traffic-group
command to create a traffic group or enter the view of an existing traffic
group.
Use the undo traffic-accounting
traffic-group command to delete an existing traffic group.
The system allows you to configure up to 15
traffic groups. In addition, there is a default traffic group that you are not
allowed to configure.
By default, there is a default traffic
group.
Related command: display
traffic-accounting traffic-group.
Example
# Create a traffic group test-group.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] traffic-accounting
traffic-group test-group
# Delete the created traffic group
test-group.
[H3C] undo traffic-accounting
traffic-group test-group
Syntax
traffic-group group-name rate id-num
View
Domain view
Parameter
group-name: Name of a traffic group.
id-num: Charging rate ID, in the range 1 to 255, used to identify different
charging rates. This argument is ignored in the current command, and it is
reserved for future use.
Description
Use the traffic-group command to
configure the domain to use a traffic group.
Use the undo traffic-group command
to cancel the configuration.
If a domain is configured to use a traffic
group, the generated traffic is measured when a user belonging to the domain
accesses an address in the traffic group and the user is charged for the
traffic.
By default, no traffic group is used by a
domain.
Related command: display
traffic-accounting traffic-group.
Example
# Configure the domain “CAMS”
to use the traffic group “test-group”, with the charge rate of 1.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] domain cams
[H3C-isp-cams] traffic-group
test-group rate 1
Syntax
traffic-slot
slot-num
undo traffic-slot slot-num
View
Traffic accounting view
Parameter
slot-num:
Slot number.
Description
Use the traffic-slot command to
specify a traffic collection card.
Use the undo traffic-slot
command to cancel the specified traffic collection card.
By default, no traffic collection card is
specified.
Related command: traffic-accounting
accounting-slot.
Example
# Specify slot 2 as the traffic accounting
slot and slot 3 as the traffic collection slot.
<H3C> system-view
System View: return to User View with
Ctrl+Z.
[H3C] traffic-accounting
accounting-slot 2
[H3C-accounting-slot-2] traffic-slot
3