01-14 Security Commands
01-14 Security Commands
Ethernet Switches
Command Reference 14 Security Commands
14 Security Commands
Product Support
Format
acl ip-pool acl-ip-pool-name
undo acl ip-pool acl-ip-pool-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
An ACL IP address pool applies when policy-based routing (PBR) is used to redirect
packets to multiple next hops. An ACL IP address pool can be invoked by the
redirect ip-multihop command to redirect packets to the next hop specified by
the ACL IP address pool.
Follow-up Procedure
Run the ip-address (ACL IP address pool view) command multiple times to
specify multiple IP addresses.
Precautions
The switch supports a maximum of 12 ACL IP address pools. Each ACL IP address
pool supports a maximum of 4 IP addresses.
In the scenario when PBR is used to redirect packets to multiple next hops, if the
device has no ARP entry matching the specified next hop IP address, the
redirection does not take effect. The device still forwards packets to the original
destination until the ARP entry matching the specified next hop IP address is
generated on the device. You can run the display acl ip-pool command to check
whether the next hop IP address specified in the ACL IP address pool takes effect.
Example
# Create an ACL IP address pool named abc.
<HUAWEI> system-view
[HUAWEI] acl ip-pool abc
Function
The acl ipv6 ip-pool command creates an ACL IPv6 address pool and enters the
ACL IPv6 address pool view.
The undo acl ipv6 ip-pool command deletes an ACL IPv6 address pool.
By default, no ACL IPv6 address pool has been created on the device.
Product Support
Format
acl ipv6 ip-pool acl-ipv6-pool-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
An ACL IPv6 address pool applies when policy-based routing (PBR) is used to
redirect packets to multiple next hops. An ACL IPv6 address pool can be invoked
by the redirect ipv6-multihop command to redirect packets to the next hop
specified by the ACL IPv6 address pool.
Follow-up Procedure
Run the ipv6 address (ACL IPv6 address pool view) command multiple times to
specify multiple IPv6 addresses.
Precautions
The switch supports a maximum of 12 ACL IPv6 address pools. Each ACL IPv6
address pool supports a maximum of 4 IPv6 addresses.
In the scenario where PBR is used to redirect packets to multiple next hops, if the
device does not match the neighbor entry corresponding to the next hop IPv6
address, the device sends NS packets to check whether the neighbor is reachable.
If the neighbor is unreachable, packets are forwarded based on the original path
and redirection does not take effect. You can run the display acl ipv6 ip-pool
command to check whether the next hop IPv6 address specified in the ACL IPv6
address pool takes effect.
Example
# Create an ACL IPv6 address pool named abc.
<HUAWEI> system-view
[HUAWEI] acl ipv6 ip-pool abc
Format
acl ipv6 name acl6-name [ advance | basic | ucl | acl6-number ] [ match-order
{ auto | config } ]
undo acl ipv6 name acl6-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
An ACL6 is a set of rules composed of permit or deny clauses. ACL6s are mainly
used in QoS. ACL6s can limit data flows to improve network performance. For
example, ACL6s are configured on an enterprise network to limit video data flows,
which lowers the network load and improves network performance.
Follow-up Procedure
Run the rule command to configure ACL6 rules and apply the ACL6 to services for
which packets need to be filtered.
Precautions
Example
# Create basic ACL6 2001 named test2.
<HUAWEI> system-view
[HUAWEI] acl ipv6 name test2 2001
Function
The acl ipv6 command creates a numbered ACL6 and enters the ACL6 view.
Format
acl ipv6 [ number ] acl6-number [ match-order { auto | config } ]
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
An ACL6 is a set of rules composed of permit or deny clauses. ACL6 rules can be
referenced by modules. ACL6s are applicable to QoS. ACL6s can limit data flows to
improve network performance. For example, ACL6s are configured on an
enterprise network to limit video data flows, which lowers the network load and
improves network performance.
Follow-up Procedure
Run the rule command to configure ACL6 rules and apply the ACL6 to services for
which packets need to be filtered.
Precautions
● After you create a named ACL6 using the acl ipv6 command, the ACL6 still
exists even if you exit from the ACL6 view. You must run the undo acl ipv6
acl6-number command to delete the ACL6.
● When you delete an ACL6 that has been referenced by other services, the
services will be interrupted. Before deleting an ACL6, ensure that the ACL6 is
not in use.
● All ACL6s can be deleted on the device in one go, but this method is not
recommended.
● For the S1720GF, S1720GFR-P, S1720GW, S1720GW-E, S1720GWR,
S1720GWR-E, S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5735S-H, and S5736-
S, before creating an user ACL6, the ACL resource allocation mode device
must be set to NAC mode using the assign resource-template acl-mode,
restarted to make the NAC mode take effect.
● For versions earlier than V200R019C00, if the rule IDs of basic or advanced
ACL6 rules are disordered, after the version is upgraded to V200R019C00 or a
later version, all rule IDs are updated at a step of 5.
Example
# Create an advanced ACL6 with the number of 3000.
<HUAWEI> system-view
[HUAWEI] acl ipv6 number 3000
Function
The acl name command creates a named ACL and enters the ACL view.
Format
acl name acl-name [ advance | basic | link | ucl | user | acl-number ] [ match-
order { auto | config } ]
undo acl name acl-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
● Limit data flows to improve network performance. For example, ACLs are
configured on an enterprise network to limit video data flows, which lowers
the network load and improves network performance.
● Provide flow control. For example, ACLs are used to limit transmission of
routing updates so that the bandwidth is saved.
● Provide network access security. For example, ACLs are configured to allow
specified users to access the human resource network.
Follow-up Procedure
Run the rule command to configure ACL rules and apply the ACL to services for
which packets need to be filtered.
Precautions
After you create a named ACL by using the acl name command, the ACL still
exists even if you exit from the ACL view. You must run the undo acl name acl-
name or undo acl acl-number command to delete the ACL.
When you delete an ACL that has been referenced by other services, the services
may be interrupted. Before deleting an ACL, ensure that the ACL is not in use.
The device automatically allocates a number to the named ACLs that have no
number specified. The number allocated depends on the following:
● If the type of a named ACL is specified, the number of the named ACL
allocated by the device is the maximum value of the named ACL of the type.
● If the number and the type of a named ACL are not specified, the device
considers the named ACL as the advanced ACL and allocates the maximum
value as the number of the named ACL.
The Switch does not allocate the number to a named ACL repeatedly.
Example
# Create basic ACL 2001 named test1.
<HUAWEI> system-view
[HUAWEI] acl name test1 2001
Format
acl [ number ] acl-number [ match-order { auto | config } ]
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
An ACL consists of a series of rules defined by multiple permit or deny clauses.
ACLs are mainly applied to QoS, route filtering, and user access. The major
functions of ACLs are as follows:
● Limit data flows to improve network performance. For example, ACLs are
configured on an enterprise network to limit video data flows, which lowers
the network load and improves network performance.
● Provide flow control. For example, ACLs are used to limit transmission of
routing updates so that the bandwidth is saved.
● Provide network access security. For example, ACLs are configured to allow
specified users to access the human resource network.
Follow-up Procedure
Run the rule command to configure ACL rules and apply the ACL to services for
which packets need to be filtered.
Precautions
● After you create an ACL using the acl command, the ACL still exists even if
you exit from the ACL view. You must run the undo acl acl-number command
to delete the ACL.
● When you delete an ACL that has been referenced by other services, the
services may be interrupted. Before deleting an ACL, ensure that the ACL is
not in use.
● You are advised not to delete all ACLs because this operation may cause a
service interruption.
Example
# Create an ACL numbered 2000.
<HUAWEI> system-view
[HUAWEI] acl number 2000
Function
The acl threshold-alarm command configures the alarm threshold percentage of
ACL, Meter or Counter resource usage.
The undo acl threshold-alarm command restores the default alarm threshold
percentage of ACL, Meter or Counter resource usage.
By default, the lower alarm threshold percentage is 70, and the upper alarm
threshold percentage is 80.
Format
acl [ meter | counter ] threshold-alarm { upper-limit upper-limit | lower-limit
lower-limit } *
Parameters
Parameter Description Value
NOTE
● If neither meter nor counter is specified, the alarm threshold percentage of ACL
resource usage is configured.
● The value of upper-limit must be greater than that of lower-limit. If the offset
between the value of the two parameters is too small, trap information may be
frequently displayed.
● S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-
L-M, S5735-S, S500, S5735S-S, and S5735-S-I does not support counter parameter.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
ACL resources are occupied by ACL or ACL6 services, Meter resources are occupied
by traffic rate limiting services, and Counter resources are occupied by traffic
statistics service. You can run the this command to configure the alarm threshold
percentage of ACL, Meter or Counter resources usage.
When the ACL, Meter or Counter resource usage is equivalent to or higher than
the threshold, the device generates an alarm. When the ACL, Meter or Counter
resource usage becomes equivalent to or lower than the lower threshold, the
device generates a clear alarm.
Precautions
If you run this command multiple times, only the latest configuration takes effect.
The upper threshold must be equivalent to or greater than the lower threshold.
Example
# Configure the lower alarm threshold percentage to 30 and the upper alarm
threshold percentage to 50.
<HUAWEI> system-view
[HUAWEI] acl threshold-alarm upper-limit 50 lower-limit 30
Function
The assign resource-template acl-mode command sets the ACL resource
allocation mode.
The undo assign resource-template acl-mode command restores the default ACL
resource allocation mode.
NOTE
The nac parameter is available only on the S1720GF, S1720GW, S1720GFR-P, S1720GWR,
S1720GW-E, S1720GWR-E, S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5735S-H, and S5736-
S. The enhanced-acl parameter is available only on the S6735-S.
Format
assign resource-template acl-mode { enhanced-acl | nac | normal } [ slot slot-
id ]
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The default ACL resource allocation mode is Normal. In Normal mode, the ACL
does not support matching of destination IPv6 addresses. If matching destination
IPv6 addresses is required, switch the ACL resource allocation mode to NAC. On
the S6735-S, you can switch the resource allocation mode to the enhanced-acl
mode to increase the number of ACLs.
Precautions
● The ACL specifications in NAC and Normal ACL resource allocation modes are
the same.
● In NAC mode, matching MAC addresses of IPv6 packets is not supported. As a
result, the configuration of the corresponding function matching the source
and destination MAC addresses of IPv6 packets in Normal mode may be lost
or not take effect.
● After configuring the ACL resource allocation mode, save the configuration,
and restart the device for the configuration to take effect.
Example
# Change the ACL resource allocation mode to NAC.
<HUAWEI> system-view
[HUAWEI] assign resource-template acl-mode nac
14.1.10 description
Function
The description command configures the description of an ACL or ACL6.
The undo description command deletes the description of an ACL or ACL6.
By default, no description is configured for an ACL or ACL6.
Format
description text
undo description
Parameters
Parameter Description Value
Views
ACL view, ACL6 view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The description command configures the description of an ACL or ACL6, for
example, the usage or application scenario of the ACL. It is used to differentiate
ACLs.
Prerequisites
The ACL or ACL6 to be described has been created.
Configuration Impact
If you run the description command multiple times in the same ACL view or ACL6
view, only the latest configuration takes effect.
Example
# Configure the description of ACL 2100.
<HUAWEI> system-view
[HUAWEI] acl 2100
[HUAWEI-acl-basic-2100] description This acl is used in QoS policy
[HUAWEI-acl-basic-2100] display acl 2100
Basic ACL 2100, 0 rule
This acl is used in QoS policy
Acl's step is 5
Function
The display acl command displays the configuration of an ACL.
Format
display acl { acl-number | name acl-name | all }
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display acl command displays the ACL configuration.
Example
# Display configuration about the ACL named test.
<HUAWEI> display acl name test
Advanced ACL test 3999, 1 rule, match-order is auto
Acl's step is 5
rule 5 permit ip destination 10.10.10.1 0
Advanced ACL test 3999, 1 rule, Advanced ACL 3999 named test that
match-order is auto matches in the automatic order and
contains one rule.
Advanced ACL 3000, 1 rule Advanced ACL 3000 contains one rule.
rule 5 permit ip dscp cs1 Rule 5 that matches packets with DSCP
priorities.
To modify an advanced ACL rule, run the
rule (advanced ACL view) command.
Function
The display acl ip-pool command displays the configuration and status of an ACL
IP address pool.
Product Support
Format
display acl ip-pool acl-ip-pool-name [ multihop-status [ vpn-instance vpn-
instance-name ] ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After an ACL IP address pool is configured, you can run the display acl ip-pool
command to check the configuration of the ACL IP address pool and whether the
next hop IP address takes effect.
In the scenario when PBR is used to redirect packets to multiple next hops, if the
device has no ARP entry matching the specified next hop IP address, the
redirection does not take effect. The device still forwards packets to the original
destination until the ARP entry matching the specified next hop IP address is
generated on the device. You can run the display acl ip-pool command to check
whether the next hop IP address specified in the ACL IP address pool takes effect.
Example
# Display the configuration and status of the ACL IP address pool named abc.
<HUAWEI> display acl ip-pool abc multihop-status
-----------------------------------------------------------------------------------------
IP Address NQA AdminName NQA TestName Status
-----------------------------------------------------------------------------------------
10.3.3.3 -- -- invalid
192.168.200.1 user test valid
192.168.150.1 user test valid
-----------------------------------------------------------------------------------------
Total: 3
Table 14-2 Description of the display acl ip-pool abc multihop-status command
output
Item Description
Function
The display acl ipv6 ip-pool command displays the configuration and status of an
ACL IPv6 address pool.
Product Support
Format
display acl ipv6 ip-pool acl-ipv6-pool-name [ multihop-status [ vpn-instance
vpn-instance-name ] ]
Parameters
Parameter Description Value
vpn-instance vpn- Displays the ACL IPv6 The VPN instance name
instance-name address pool of a must exist.
specified VPN instance.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After an ACL IPv6 address pool is configured, you can run the display acl ipv6 ip-
pool command to check the configuration of the ACL IPv6 address pool and
whether the next hop IPv6 address takes effect.
In the scenario when PBR is used to redirect packets to multiple next hops, if the
device does not match the neighbor entry corresponding to the next hop IPv6
address, the device sends NS packets to check whether the neighbor is reachable.
If the neighbor is unreachable, packets are forwarded based on the original path
and redirection does not take effect. You can run the display acl ipv6 ip-pool
command to check whether the next hop IPv6 address specified in the ACL IPv6
address pool takes effect.
Example
# Display the configuration and status of the ACL IPv6 address pool named abc.
<HUAWEI> display acl ip-pool abc multihop-status
-----------------------------------------------------------------------------------------------------------------
2001:DB8::1 -- -- invalid
2001:DB8::2 -- -- invalid
-----------------------------------------------------------------------------------------------------------------
Total: 2
Table 14-3 Description of the display acl ipv6 ip-pool abc multihop-status
command output
Item Description
Item Description
Format
display acl ipv6 { acl6-number | name acl6-name | all }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display acl ipv6 command displays the ACL6 configuration.
Example
# Display the configuration about the ACL6 with the number of 2000.
<HUAWEI> display acl ipv6 2000
Item Description
Basic IPv6 ACL 2000, 2 ACL6 2000, which is a basic ACL6 and has two rules.
rules
Item Description
rule 0 deny source 3::/64 ACL6 rule 0, which denies packets with the source
IPv6 address 3::/64.
To modify a basic ACL6 rule, run the rule (rule
basic acl6 view) command.
rule 1 permit source ACL6 rule 1, which permits packets with the source
4::/64 IPv6 address 4::/64.
To modify a basic ACL6 rule, run the rule (rule
basic acl6 view) command.
Advanced IPv6 ACL 3999 ACL6 3999, named test, which is an advanced ACL6
name test, 0 rule and has 0 rule.
Ucl group IPv6 ACL 6000, ACL6 6000, which is an user ACL6 and has 0 rule.
0 rule
Function
The display acl resource command displays information about ACL resources.
Format
display acl resource [ slot slot-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
If ACL configuration fails, all the ACL, Meter, or Counter resources on the device
may have been used up. You can run the display acl resource command to check
whether there are available ACL, Meter, or Counter resources (including ACL4 and
ACL6).
Precautions
Example
# Display information about ACL resources in slot 0 (S5720-LI is used as an
example).
<HUAWEI> display acl resource slot 0
Slot 0
GigabitEthernet0/0/1 to GigabitEthernet0/0/12
Vlan-ACL Inbound-ACL Outbound-ACL
----------------------------------------------------------------------------
Rule Used 0 65 65
Rule Free 512 3007 3007
Rule Total 512 3072 3072
Meter Used 0 0 0
Meter Free 0 768 128
Meter Total 0 768 128
Counter Used 0 0 0
Counter Free 0 768 128
Counter Total 0 768 128
----------------------------------------------------------------------------
Slot 0
IACL Slice 11 1 12
IACL Unallocated - - 3072
IACL Allocated - - 1024
Srv ACL 10 502 512
Sec ACL 348 164 512
EACL Slice 0 4 4
EACL Unallocated - - 1024
EACL Allocated - - 0
Ingress UDF 0 8 8
----------------------------------------------------------------------------
Item Description
Item Description
Item Description
Item Description
Function
The display time-range command displays the configuration and status of the
current time range.
Format
display time-range { all | time-name }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To specify a time range during which ACL rules take effect, run the time-range
command and reference the time range name when you configure an ACL.
Before using a time range to filter data packets, run the display time-range
command to view the time range configuration to avoid duplicate time ranges.
NOTE
The device updates the status of ACLs with a delay of about 30 seconds. The display time-
range command adopts the current time range to determine the status of ACLs; therefore,
you may find that the ACL using an active time range is inactive. This is normal.
Example
# Display the configuration and status of all time ranges.
<HUAWEI> display time-range all
Current time is 14:48:13 10-17-2012 Wednesday
Item Description
from 23:23 2012/9/9 to 23:59 Time range abc is from 23:23 2012/9/9 to
2012/12/31 23:59 2012/12/31.
Product Support
Format
ip address ip-address [ mask-length | wildcard | track-nqa admin-name test-
name ]
undo ip address ip-address [ mask-length | wildcard | track-nqa admin-name
test-name ]
Parameters
Parameter Description Value
Views
ACL IP address pool view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After an ACL IP address pool is created, you can run the ip address command to
specify an IP address for the ACL IP address pool. The ACL IP address pool can be
invoked by the redirect ip-multihop command to redirect packets to the next hop
specified in the ACL IP address pool.
Prerequisites
An ACL IP address pool has been created by running the acl ip-pool command.
Precautions
The switch supports a maximum of 12 ACL IP address pools. Each ACL IP address
pool supports a maximum of 4 IP addresses.
In the scenario when PBR is used to redirect packets to multiple next hops, if the
device has no ARP entry matching the specified next hop IP address, the
redirection does not take effect. The device still forwards packets to the original
destination until the ARP entry matching the specified next hop IP address is
generated on the device. You can run the display acl ip-pool command to check
whether the next hop IP address specified in the ACL IP address pool takes effect.
Example
# Specify five IP addresses for the ACL IP address pool named abc.
<HUAWEI> system-view
[HUAWEI] acl ip-pool abc
[HUAWEI-acl-ip-pool-abc] ip address 192.168.10.1 32
[HUAWEI-acl-ip-pool-abc] ip address 192.168.20.1 32
[HUAWEI-acl-ip-pool-abc] ip address 192.168.30.1 32
[HUAWEI-acl-ip-pool-abc] ip address 192.168.40.1 32
[HUAWEI-acl-ip-pool-abc] ip address 192.168.50.1 32
Product Support
Format
ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length }
ipv6 address ipv6-address
undo ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length }
undo ipv6 address ipv6-address
Parameters
Parameter Description Value
Views
ACL IPv6 address pool view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After an ACL IPv6 address pool is created, you can run the ipv6 address command
to specify an IPv6 address for the ACL IPv6 address pool. The ACL IPv6 address
pool can be invoked by the redirect ipv6-multihop command to redirect packets
to the next hop specified in the ACL IPv6 address pool.
Prerequisites
An ACL IPv6 address pool has been created by running the acl ipv6 ip-pool
command.
Precautions
The switch supports a maximum of 12 ACL IPv6 address pools. Each ACL IPv6
address pool supports a maximum of 4 IPv6 addresses.
In the scenario when PBR is used to redirect packets to multiple next hops, if the
device does not match the neighbor entry corresponding to the next hop IPv6
address, the device sends NS packets to check whether the neighbor is reachable.
If the neighbor is unreachable, packets are forwarded based on the original path
and redirection does not take effect. You can run the display acl ipv6 ip-pool
command to check whether the next hop IPv6 address specified in the ACL IPv6
address pool takes effect.
Example
# Specify four IPv6 addresses for the ACL IPv6 address pool named abc.
<HUAWEI> system-view
[HUAWEI] acl ipv6 ip-pool abc
[HUAWEI-acl6-ip-pool-abc] ipv6 address 2001:db8::1 128
[HUAWEI-acl6-ip-pool-abc] ipv6 address 2001:db8::2 128
[HUAWEI-acl6-ip-pool-abc] ipv6 address 2001:db8::3 128
[HUAWEI-acl6-ip-pool-abc] ipv6 address 2001:db8::4 128
Function
The reset acl counter command clears statistics about ACLs.
Format
reset acl counter { name acl-name | acl-number | all }
Parameters
Parameter Description Value
name acl- Specifies the name of
The value is a string of 1 to 64 case-
name an ACL whose
sensitive characters without spaces. The
statistics need to be
value must start with a letter.
cleared.
acl-number Specifies the number The value is an integer.
of an ACL whose
statistics need to be ● The number of a basic ACL ranges
cleared. from 2000 to 2999.
● The number of a numbered advanced
ACL ranges from 3000 to 3999.
● The number of a Layer 2 ACL ranges
from 4000 to 4999.
● The number of a user-defined ACL
ranges from 5000 to 5999.
● The number of a user ACL ranges from
6000 to 9999.
all Clears all the ACL -
statistics.
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To obtain the accurate ACL statistics generated in a certain period, run the reset
acl counter command to clear existing statistics and start statistics collection.
NOTICE
After the reset acl counter command is executed, the system does not prompt
you the statistics deletion.
Before using the reset acl counter command, determine whether you intend to
clear ACL statistics.
Follow-up Procedure
After running the reset acl counter command to clear the previous ACL statistics,
you can use the display acl match-counter command in the diagnostic view to
check ACL rules and statistics on the packets matching the ACL rules in the
current period.
Example
# Clear statistics about ACL 2000.
<HUAWEI> reset acl counter 2000
Function
The reset acl ipv6 counter command clears the ACL6 statistics.
Format
reset acl ipv6 counter { name acl6-name | acl6-number | all }
Parameters
Parameter Description Value
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To obtain the accurate ACL6 statistics in a certain period, run the reset acl ipv6
counter command to clear existing statistics and start statistics collection.
NOTICE
Before using the reset acl ipv6 counter command, determine whether you intend
to clear ACL6 statistics.
After the reset acl ipv6 counter command is executed, the system does not
prompt you the statistics deletion.
Follow-up Procedure
After running the reset acl ipv6 counter command to clear the previous ACL
statistics, you can use the display acl ipv6 command to view ACL rules and
statistics on the packets matching the ACL rules in the current period.
Example
# Clear the statistics about basic ACL6 2000.
<HUAWEI> reset acl ipv6 counter 2000
Format
● When the parameter protocol is specified as the Internet Control Message
Protocol (ICMP), the command format is as follows:
rule [ rule-id ] { deny | permit } { protocol-number | icmp } [ destination
{ destination-address destination-wildcard | any } | { { precedence precedence
| tos tos } * | dscp dscp } | { fragment | first-fragment } | logging | icmp-type
{ icmp-name | icmp-type [ icmp-code ] } | source { source-address source-
wildcard | any } | time-range time-name | ttl-expired | { vpn-instance vpn-
instance-name | public } ] *
undo rule { deny | permit } { protocol-number | icmp } [ destination
{ destination-address destination-wildcard | any } | { { precedence precedence
| tos tos } * | dscp dscp } | { fragment | first-fragment } | logging | icmp-type
Parameters
Parameter Description Value
source-port { eq port | Specifies the source port The value of port can be
gt port | lt port | range of UDP or TCP packets. a name or a number.
port-start port-end } The value is valid only ● When the value is
when the protocol of expressed as a
packets is TCP or UDP. If number, it ranges
this parameter is not from 0 to 65535 in eq
specified, TCP or UDP port
packets with any source
port are matched. The ● When the value is
operators are as follows: expressed as a
number, it ranges
● eq port: equivalent to from 0 to 65534 in gt
the source port port
number.
● When the value is
● gt port: greater than expressed as a
the source port number, it ranges
number. from 1 to 65535 in lt
● lt port: smaller than port
the source port The value of port-start
number. and port-end can be a
● range port-start port- name or a number.
end: source port When the value is
number range. port- expressed as a number, it
start specifies the ranges from 0 to 65535.
start port number. Table 14-9 and Table
port-end specifies the 14-10 list the mapping
end port number. between the well-known
source or destination
port numbers of UDP or
TCP and values of port.
normal 0 max-reliability 2
min-monetary- 1 max-throughput 4
cost
min-delay 8 - -
Table 14-8 Values of ICMP name and the corresponding ICMP type and ICMP
code
ICMP name ICMP type ICMP code
Echo 8 0
Echo-reply 0 0
Parameter-problem 12 0
Port-unreachable 3 3
Protocol-unreachable 3 2
Reassembly-timeout 11 1
Source-quench 4 0
Source-route-failed 3 5
Timestamp-reply 14 0
Timestamp-request 13 0
Ttl-exceeded 11 0
Fragmentneed-DFset 3 4
Host-redirect 5 1
Host-tos-redirect 5 3
Host-unreachable 3 1
Information-reply 16 0
Information-request 15 0
Net-redirect 5 0
Net-tos-redirect 5 2
Net-unreachable 3 0
Views
Advanced ACL view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The rule command defines the time range and flexibly configures the time ACL
rules take effect.
Prerequisites
Precautions
If the specified rule ID already exists and the new rule conflicts with the original
rule, the new rule replaces the original rule.
To modify an existing rule, delete the old rule, and then create a new rule.
Otherwise, the configuration result will be incorrect.
To configure both the precedence precedence and tos tos parameters, set the two
parameters consecutively in the command.
The undo rule command deletes an ACL rule even if the ACL rule is referenced. (If
a simplified traffic policy references a specified rule in an ACL, this command does
not take effect.) Before deleting a rule, ensure that the rule is not being
referenced.
Example
# Add a rule to ACL 3000 to filter ICMP packets.
<HUAWEI> system-view
[HUAWEI] acl 3000
[HUAWEI-acl-adv-3000] rule 1 permit icmp
<HUAWEI> system-view
[HUAWEI] acl 3000
[HUAWEI-acl-adv-3000] rule 2 permit igmp
# Add a rule to ACL 3001 to filter all the IP packets sent from hosts at 10.9.0.0 to
hosts at 10.38.160.0.
<HUAWEI> system-view
[HUAWEI] acl 3001
[HUAWEI-acl-adv-3001] rule permit ip source 10.9.0.0 0.0.255.255 destination 10.38.160.0 0.0.0.255
# Add a rule to ACL 3001 to filter the packets with source UDP port number 128
from 10.9.8.0 to 10.38.160.0.
<HUAWEI> system-view
[HUAWEI] acl 3001
[HUAWEI-acl-adv-3001] rule permit udp source 10.9.8.0 0.0.0.255 destination 10.38.160.0 0.0.0.255
destination-port eq 128
Function
The rule command adds or modifies an advanced ACL6 rule.
The undo rule command deletes an advanced ACL6 rule.
By default, no advanced ACL6 rule is created.
Format
● When the protocol is set to TCP, the command format is as follows:
rule [ rule-id ] { deny | permit } { tcp | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | destination-ipv6-
address wildcard | any } | destination-port { eq port | gt port | lt port | range
port-start port-end } | { { precedence precedence | tos tos } * | dscp dscp } |
routing [ routing-type routing-type ] | { fragment | first-fragment } |
logging | source { source-ipv6-address prefix-length | source-ipv6-address/
prefix-length | source-ipv6-address postfix postfix-length | source-ipv6-
address wildcard | any } | source-port { eq port | gt port | lt port | range port-
start port-end } | tcp-flag { ack | established | fin | psh | rst | syn | urg } * |
time-range time-name | { vpn-instance vpn-instance-name | public } ] *
undo rule { deny | permit } { tcp | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | destination-ipv6-
address wildcard | any } | destination-port { eq port | gt port | lt port | range
port-start port-end } | { { precedence precedence | tos tos } * | dscp dscp } |
routing [ routing-type routing-type ] | { fragment | first-fragment } |
logging | source { source-ipv6-address prefix-length | source-ipv6-address/
prefix-length | source-ipv6-address postfix postfix-length | source-ipv6-
address wildcard | any } | source-port { eq port | gt port | lt port | range port-
start port-end } | tcp-flag { ack | established | fin | psh | rst | syn | urg } * |
time-range time-name | { vpn-instance vpn-instance-name | public } ] *
● When the protocol is set to UDP, the command format is as follows:
rule [ rule-id ] { deny | permit } { udp | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | destination-ipv6-
address wildcard | any } | destination-port { eq port | gt port | lt port | range
port-start port-end } | { { precedence precedence | tos tos } * | dscp dscp } |
routing [ routing-type routing-type ] | { fragment | first-fragment } |
logging | source { source-ipv6-address prefix-length | source-ipv6-address/
prefix-length | source-ipv6-address postfix postfix-length | source-ipv6-
address wildcard | any } | source-port { eq port | gt port | lt port | range port-
start port-end } | time-range time-name | { vpn-instance vpn-instance-name
| public } ] *
undo rule { deny | permit } { udp | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | destination-ipv6-
address wildcard | any } | destination-port { eq port | gt port | lt port | range
port-start port-end } | { { precedence precedence | tos tos } * | dscp dscp } |
routing [ routing-type routing-type ] | { fragment | first-fragment } |
logging | source { source-ipv6-address prefix-length | source-ipv6-address/
prefix-length | source-ipv6-address postfix postfix-length | source-ipv6-
address wildcard | any } | source-port { eq port | gt port | lt port | range port-
start port-end } | time-range time-name | { vpn-instance vpn-instance-name
| public } ] *
● When the protocol is set to ICMPv6, the command format is as follows:
rule [ rule-id ] { deny | permit } { icmpv6 | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | destination-ipv6-
address wildcard | any } | { { precedence precedence | tos tos } * | dscp dscp }
| routing [ routing-type routing-type ] | { fragment | first-fragment } |
icmp6-type { icmp6-name | icmp6-type [ icmp6-code ] } | logging | source
{ source-ipv6-address prefix-length | source-ipv6-address/prefix-length |
source-ipv6-address postfix postfix-length | source-ipv6-address wildcard |
any } | time-range time-name | { vpn-instance vpn-instance-name |
public } ] *
undo rule { deny | permit } { icmpv6 | protocol-number } [ destination
{ destination-ipv6-address prefix-length | destination-ipv6-address/prefix-
length | destination-ipv6-address postfix postfix-length | destination-ipv6-
address wildcard | any } | { { precedence precedence | tos tos } * | dscp dscp }
| routing [ routing-type routing-type ] | { fragment | first-fragment } |
icmp6-type { icmp6-name | icmp6-type [ icmp6-code ] } | logging | source
{ source-ipv6-address prefix-length | source-ipv6-address/prefix-length |
source-ipv6-address postfix postfix-length | source-ipv6-address wildcard |
any } | time-range time-name | { vpn-instance vpn-instance-name |
public } ] *
● When the protocol is set to other protocols, the command format is as
follows:
rule [ rule-id ] { deny | permit } { protocol-number | gre | ipv6 | ospf }
[ destination { destination-ipv6-address prefix-length | destination-ipv6-
● The vpn-instance and public parameter is supported only when a software-based ACL is
applied to the S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H, S5731-
S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-
S, or S6730S-S. For usage scenarios of software-based ACLs, see "ACL Implementations" in
the S300, S500, S2700, S5700, and S6700 V200R021C10 Configuration Guide - Security ACL
Configuration - ACL Fundamentals.
● For details about the parameters that are not supported when ACL rules are hardware-based
ACLs, see Table 14-11.
● Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720S-EI, S6730-H,
S6730S-H, S6730-S, and S6730S-S support routing [ routing-type routing-type ].
● Only the S1720GF, S1720GW, S1720GW-E, S1720GWR, S1720GFR-P, S1720GWR-E, S2720-EI,
S5720-LI, S5720S-LI, S5720I-SI, S5735S-H, S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S,
S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, S6730S-S, S1730S-H,
S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S,
S500, S5735S-S, and S5735-S-I support dscp, precedence, and tos.
● Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S2730S-S, S5735-L-I, S5735-
L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I,
S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support
destination and first-fragment. For the S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L,
S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, and S5735-S-I, an ACL
containing the first-fragment can only be used in the inbound direction.
Parameters
Parameter Description Value
source-port { eq port | Specifies the source port The value of port can be
gt port | lt port | range of UDP or TCP packets. a name or a number.
port-start port-end } The value is valid only ● When the value is
when the protocol of expressed as a
packets is TCP or UDP. If number, it ranges
this parameter is not from 0 to 65535 in eq
specified, TCP or UDP port
packets with any source
port are matched. The ● When the value is
operators are as follows: expressed as a
number, it ranges
● eq port: equivalent to from 0 to 65534 in gt
the source port port
number.
● When the value is
● gt port: greater than expressed as a
the source port number, it ranges
number. from 1 to 65535 in lt
● lt port: smaller than port
the source port The value of port-start
number. and port-end can be a
● range port-start port- name or a number.
end: source port When the value is
number range. port- expressed as a number, it
start specifies the ranges from 0 to 65535.
start port number. Table 14-15 and Table
port-end specifies the 14-14 list the mapping
end port number. between the well-known
source or destination
port numbers of UDP or
TCP and values of port.
Table 14-11 Parameter support regarding different protocols when ACL rules
configured are implemented on hardware
Parameter TCP UDP ICMPv6 Other
Protocols
normal 0 max-reliability 2
min-monetary- 1 max-throughput 4
cost
min-delay 8 - -
Table 14-13 Values of icmp6-name and the corresponding ICMPv6 type and
ICMPv6 code
ICMPv6 Name ICMPv6 Type ICMPv6 Code
Redirect 137 0
Echo 128 0
Echo-reply 129 0
Err-Header-field 4 0
Frag-time-exceeded 3 1
Hop-limit-exceeded 3 0
Host-admin-prohib 1 1
Host-unreachable 1 3
Neighbor-advertisement 136 0
Neighbor-solicitation 135 0
Network-unreachable 1 0
Packet-too-big 2 0
Port-unreachable 1 4
Router-advertisement 134 0
Router-solicitation 133 0
Unknown-ipv6-opt 4 2
Unknown-next-hdr 4 1
Views
Advanced ACL6 view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Advanced ACL6s classify data packets based on the source IP address, destination
IP address, source port number, destination port number, and protocol type.
The rule command defines the time range to flexibly configure the time during
which ACL6 rules take effect.
Prerequisites
An ACL6 has been created before the rule is configured.
Precautions
If the specified rule ID already exists and the new rule conflicts with the original
rule, the new rule replaces the original rule.
To modify an existing rule, delete the old rule, and then create a new rule.
Otherwise, the configuration result will be incorrect.
To configure both the precedence precedence and tos tos parameters, set the two
parameters consecutively in the command.
When you use the undo rule command to delete an ACL6 rule, the rule ID must
exist. If the rule ID is unknown, you can use the display acl ipv6 command to
view the rule ID.
The undo rule command deletes an ACL6 rule even if the ACL6 rule is referenced.
Use this command with caution, especially when you delete an ACL6 rule that has
been referenced.
The parameter fragment cannot be set together with source-port, destination-
port, icmp6-type, and tcp-flag.
Example
# Add a rule to ACL6 3000 to deny the packets with the destination UDP port
number that is greater than 128 from fc00:1::1 to fc00:3::1.
<HUAWEI> system-view
[HUAWEI] acl ipv6 3000
[HUAWEI-acl6-adv-3000] rule deny udp source fc00:1::1 64 destination fc00:3::1 64 destination-port gt
128
Format
rule [ rule-id ] { deny | permit } [ source { source-address source-wildcard | any }
| fragment | logging | time-range time-name | { vpn-instance vpn-instance-
name | public } ] *
undo rule { deny | permit } [ source { source-address source-wildcard | any } |
fragment | logging | time-range time-name | { vpn-instance vpn-instance-name
| public } ] *
NOTE
The vpn-instance and public parameter is supported only when a software-based ACL is
applied to the S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H,
S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H,
S6730-S, or S6730S-S. For usage scenarios of software-based ACLs, see "ACL
Implementations" in the S300, S500, S2700, S5700, and S6700 V200R021C10
Configuration Guide - Security ACL Configuration - ACL Fundamentals.
Parameters
Parameter Description Value
Views
Basic ACL view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The rule command defines the time range and flexibly configures the time ACL
rules take effect.
Prerequisites
Precautions
If the specified rule ID already exists and the new rule conflicts with the original
rule, the new rule replaces the original rule.
To modify an existing rule, delete the old rule, and then create a new rule.
Otherwise, the configuration result will be incorrect.
The undo rule command deletes an ACL rule even if the ACL rule is referenced.
Use this command with caution, especially when you delete an ACL rule that has
been referenced.
Example
# Add a rule in ACL 2001 to permit the packets from 192.168.32.1.
<HUAWEI> system-view
[HUAWEI] acl 2001
[HUAWEI-acl-basic-2001] rule permit source 192.168.32.1 0
Format
rule [ rule-id ] { deny | permit } [ fragment | logging | source { source-ipv6-
address prefix-length | source-ipv6-address/prefix-length | source-ipv6-address
postfix postfix-length | source-ipv6-address wildcard | any } | time-range time-
name | { vpn-instance vpn-instance-name | public } ] *
undo rule { deny | permit } [ fragment | logging | source { source-ipv6-address
prefix-length | source-ipv6-address/prefix-length | source-ipv6-address postfix
postfix-length | source-ipv6-address wildcard | any } | time-range time-name |
{ vpn-instance vpn-instance-name | public } ] *
undo rule rule-id [ fragment | logging | source | time-range | { vpn-instance |
public } ] *
NOTE
The vpn-instance and public parameter is supported only when a software-based ACL is
applied to the S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H,
S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H,
S6730-S, or S6730S-S. For usage scenarios of software-based ACLs, see "ACL
Implementations" in the S300, S500, S2700, S5700, and S6700 V200R021C10
Configuration Guide - Security ACL Configuration - ACL Fundamentals.
Parameters
Parameter Description Value
Views
Basic ACL6 view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Prerequisites
Precautions
If the specified rule ID already exists and the new rule conflicts with the original
rule, the new rule replaces the original rule.
To modify an existing rule, delete the old rule, and then create a new rule.
Otherwise, the configuration result will be incorrect.
When you use the undo rule command to delete an ACL6 rule, the rule ID must
exist. If the rule ID is unknown, you can use the display acl ipv6 command to
view the rule ID.
The undo rule command deletes an ACL6 rule even if the ACL6 rule is referenced.
Use this command with caution, especially when you delete an ACL6 rule that has
been referenced.
Example
# Add a rule for the ACL6 with a number of 2000 to prohibit the passing of
packets from the source fc00:1::1/64.
<HUAWEI> system-view
[HUAWEI] acl ipv6 2000
[HUAWEI-acl6-basic-2000] rule deny source fc00:1::1/64
Format
rule [ rule-id ] { permit | deny } [ [ ether-ii | 802.3 | snap ] | l2-protocol type-
value [ type-mask ] | destination-mac dest-mac-address [ dest-mac-mask ] |
source-mac source-mac-address [ source-mac-mask ] | vlan-id vlan-id [ vlan-id-
mask ] | 8021p 802.1p-value | cvlan-id cvlan-id [ cvlan-id-mask ] | cvlan-8021p
802.1p-value | double-tag | time-range time-name ] *
undo rule { permit | deny } [ [ ether-ii | 802.3 | snap ] | l2-protocol type-value
[ type-mask ] | destination-mac dest-mac-address [ dest-mac-mask ] | source-
mac source-mac-address [ source-mac-mask ] | vlan-id vlan-id [ vlan-id-mask ] |
8021p 802.1p-value | cvlan-id cvlan-id [ cvlan-id-mask ] | cvlan-8021p 802.1p-
value | double-tag | time-range time-name ] *
undo rule rule-id
NOTE
Parameters
Parameter Description Value
vlan-id vlan-id [ vlan- Indicates the outer VLAN ID The value of vlan-id is
id-mask ] contained in a packet that an integer ranging from
matches the rule. 1 to 4094.
● vlan-id: specifies the The value of the vlan-
number of the VLAN ID. id-mask is a
● vlan-id-mask: specifies hexadecimal number
the mask of the VLAN ranging from 0x0 to
ID. 0xFFF. The default value
is 0xFFF.
Views
layer 2 ACL view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A Layer 2 ACL matches packets based on Layer 2 information of the packets, such
as source MAC addresses, destination MAC addresses, and Layer 2 protocol types.
The rule command defines the time range and flexibly configures the time when
the ACL rules take effect.
Prerequisites
An ACL has been created before the rule is configured.
Precautions
If the specified rule ID already exists, the new rule overwrites the old rule no
matter whether the rules conflict.
To modify an existing rule, delete the old rule, and then create a new rule.
Otherwise, the configuration result will be incorrect.
The undo rule command deletes an ACL rule even if the ACL rule is referenced.
Use this command with caution, especially when you delete an ACL rule that has
been referenced.
Example
# Add a rule to ACL 4001 to match packets with the destination MAC address
being 0000-0000-0001, source MAC address being 0000-0000-0002, and the value
of the Layer 2 protocol type being 0x0800.
<HUAWEI> system-view
[HUAWEI] acl 4001
[HUAWEI-acl-L2-4001] rule permit destination-mac 0000-0000-0001 source-mac 0000-0000-0002 l2-
protocol 0x0800
Format
rule [ rule-id ] { deny | permit } [ [ l2-head | ipv4-head | ipv6-head | l4-head
{ udp | tcp | vxlan } ] { rule-string rule-mask offset } &<1-8> | time-range time-
name ] *
undo rule { deny | permit } [ [ l2-head | ipv4-head | ipv6-head | l4-head { udp |
tcp | vxlan } ] { rule-string rule-mask offset } &<1-8> | time-range time-name ] *
undo rule rule-id
NOTE
The following switch models does not support &<1-8> and ipv6-head: S1720GF, S1720GW-
E, S1720GFR-P, S1720GWR-E, S2720-EI, S5720I-SI, S5720-LI, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1, S300, S5735-L, S5735S-L1, S5735S-L, S5735S-L-M, S5720S-LI, S500, S5735-S,
S5735S-S, S5735-S-I, S5735S-H, S5736-S
The udp, tcp, and vxlan parameters are supported only by the S6735-S.
Parameters
Parameter Description Value
Views
User-defined ACL view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A user-defined ACL defines rules by setting the offset position and value of the
packet. User-defined ACLs are mainly used for matching rules in a traffic classifier.
The rule command defines the time range and flexibly configures the time that
ACL rules take effect.
NOTE
Prerequisites
An ACL has been created before the rule is configured.
Precautions
● If the specified rule-id already exists and the new rule conflicts with the
original one, the new rule replaces the original rule. To modify an existing
rule, delete the old rule, and then create a new one. Otherwise, the
configuration result will be incorrect.
● To change the offset in a user-defined ACL rule, delete the existing rule and
reconfigure a new one.
● The undo rule command can delete an ACL rule even if this rule is
referenced. Use this command with caution, especially when you delete an
ACL rule that has been referenced.
● On the S5735S-H and S5736-S, an ACL rule is specified to perform the offset
matching based on the Layer 2 packet header. In this case, if the packets
passing through the GE electrical interface to which the ACL rule is applied do
not carry tags, a tag needs to be added to the packets before the offset value
is calculated.
● On the S6735-S, the packet type must be specified when an ACL rule is
specified to perform the offset matching based on the Layer 4 packet header.
Example
# Add a rule to ACL 5001 to match a 4-byte character string whose content is
0x0180C200 with a 14-byte offset beginning from the Layer 2 packet header.
<HUAWEI> system-view
[HUAWEI] acl 5001
[HUAWEI-acl-user-5001] rule permit l2-head 0x0180C200 0xFFFFFFFF 14
Function
The rule command configures a user ACL rule.
Format
● When the parameter protocol is specified as the ICMP, the command format is
as follows:
rule [ rule-id ] { permit | deny } { icmp | protocol-number } [ source
{ { source-address source-wildcard | any } | { ucl-group { name source-ucl-
group-name | source-ucl-group-index } } } * | destination { { { destination-
address destination-wildcard | any } | { ucl-group { name destination-ucl-
group-name | destination-ucl-group-index } } } * | fqdn fqdn-name } | icmp-
type { icmp-type [ icmp-code ] | icmp-name } | vpn-instance vpn-instance-
name | time-range time-name ] *
undo rule { permit | deny } { icmp | protocol-number } [ source { { source-
address source-wildcard | any } | { ucl-group { name source-ucl-group-name |
source-ucl-group-index } } } * | destination { { { destination-address
destination-wildcard | any } | { ucl-group { name destination-ucl-group-name
| destination-ucl-group-index } } } * | fqdn fqdn-name } | icmp-type { icmp-
Parameters
Parameter Description Value
source-port { eq port | Specifies the source port The value of port can be
gt port | lt port | range of UDP or TCP packets. a name or a number.
port-start port-end } The value is valid only ● When the value is
when the protocol of expressed as a
packets is TCP or UDP. If number, it ranges
this parameter is not from 0 to 65535 in eq
specified, TCP or UDP port
packets with any source
port are matched. The ● When the value is
operators are as follows: expressed as a
number, it ranges
● eq port: equal from 0 to 65534 in gt
operator. port
● gt port: greater than ● When the value is
operator. expressed as a
● lt port: smaller than number, it ranges
operator. from 1 to 65535 in lt
● range port-start port- port
end: within the The value of port-start
range.port-start and port-end can be a
specifies the start port name or an integer.
number.port-end When the value is
specifies the end port expressed as an integer,
number. it ranges from 0 to
65535.
Table 14-16 Values of ICMP name and the corresponding ICMP type and ICMP
code
ICMP name ICMP type ICMP code
Echo 8 0
Echo-reply 0 0
Fragmentneed-DFset 3 4
Host-redirect 5 1
Host-tos-redirect 5 3
Host-unreachable 3 1
Information-reply 16 0
Information-request 15 0
Net-redirect 5 0
Net-tos-redirect 5 2
Net-unreachable 3 0
Parameter-problem 12 0
Port-unreachable 3 3
Protocol-unreachable 3 2
Reassembly-timeout 11 1
Source-quench 4 0
Source-route-failed 3 5
Timestamp-reply 14 0
Timestamp-request 13 0
Ttl-exceeded 11 0
Views
User ACL view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A user ACL defines rules to filter IPv4 packets based on the source IP addresses or
source User Control List (UCL) groups, destination IP addresses or destination UCL
groups, IP protocol types, ICMP types, TCP source/destination port numbers, UDP
source/destination port numbers, and time ranges.
Currently, the user ACL can be applied only to the UCL groups of the NAC mode.
To control the network access rights of users based on user groups, you can
perform the following operations: configure a UCL group, associate user ACL rules
with the UCL group so that the ACL rules apply to all users in the user group,
configure packet filtering based on the user ACL to make the ACL take effect, and
then apply the UCL group to the AAA service scheme.
Prerequisites
If the ucl-group name source-ucl-group-name or ucl-group name destination-
ucl-group-name parameter is configured for a rule, the source and destination
UCL groups must have been created by the ucl-group command.
Precautions
If the specified rule ID already exists and the new rule conflicts with the original
rule, the new rule replaces the original rule.
The undo rule command deletes an ACL rule even if the ACL rule is referenced. (If
a simplified traffic policy references a specified rule in an ACL, this command does
not take effect.) Before deleting a rule, ensure that the rule is not being
referenced.
Example
# Add a rule to ACL 6000 to reject all the IP packets sent from UCL group group1
to network segment 10.9.9.0/24.
<HUAWEI> system-view
[HUAWEI] ucl-group 1 name group1
[HUAWEI] acl 6000
[HUAWEI-acl-ucl-6000] rule deny ip source ucl-group name group1 destination 10.9.9.0 0.0.0.255
Format
● When the protocol is set to ICMPv6, the command format is as follows:
rule [ rule-id ] { permit | deny } { icmpv6 | protocol-number } [ source
{ { source-ipv6-address prefix-length | source-ipv6-address/prefix-length |
source-ipv6-address postfix postfix-length | source-ipv6-address wildcard |
any } | { ucl-group { name source-ucl-group-name | source-ucl-group-
index } } } * | destination { destination-ipv6-address prefix-length |
destination-ipv6-address/prefix-length | destination-ipv6-address postfix
postfix-length | destination-ipv6-address wildcard | any } | icmp6-type
{ icmp6-type [ icmp6-code ] | icmp6-name } | vpn-instance vpn-instance-
name | time-range time-name ] *
undo rule { permit | deny } { icmpv6 | protocol-number } [ source { { source-
ipv6-address prefix-length | source-ipv6-address/prefix-length | source-ipv6-
address postfix postfix-length | source-ipv6-address wildcard | any } | { ucl-
group { name source-ucl-group-name | source-ucl-group-index } } } * |
destination { destination-ipv6-address prefix-length | destination-ipv6-
address/prefix-length | destination-ipv6-address postfix postfix-length |
destination-ipv6-address wildcard | any } | icmp6-type { icmp6-type [ icmp6-
code ] | icmp6-name } | vpn-instance vpn-instance-name | time-range time-
name ] *
● When the protocol is set to TCP, the command format is as follows:
rule [ rule-id ] { deny | permit } { tcp | protocol-number } [ source { { source-
ipv6-address prefix-length | source-ipv6-address/prefix-length | source-ipv6-
Parameters
Parameter Description Value
source-port { eq port | Specifies the source port The value of port can be
gt port | lt port | range of UDP or TCP packets. a name or a number.
port-start port-end } The value is valid only ● When the value is
when the protocol of expressed as a
packets is TCP or UDP. If number, it ranges
this parameter is not from 0 to 65535 in eq
specified, TCP or UDP port
packets with any source
port are matched. The ● When the value is
operators are as follows: expressed as a
number, it ranges
● eq port: equal from 0 to 65534 in gt
operator. port
● gt port: greater than ● When the value is
operator. expressed as a
● lt port: smaller than number, it ranges
operator. from 1 to 65535 in lt
● range port-start port- port
end: source port The value of port-start
number range. port- and port-end can be a
start specifies the name or an integer.
start port number. When the value is
port-end specifies the expressed as an integer,
end port number. it ranges from 0 to
65535.
Table 14-17 Values of cmp6-name and the corresponding ICMPv6 type and
ICMPv6 code
ICMPv6 Name ICMPv6 Type ICMPv6 Code
Echo 128 0
Echo-reply 129 0
err-Header-field 4 0
frag-time-exceeded 3 1
hop-limit-exceeded 3 0
host-admin-prohib 1 1
host-unreachable 1 3
neighbor-advertisement 136 0
neighbor-solicitation 135 0
network-unreachable 1 0
packet-too-big 2 0
port-unreachable 1 4
redirect 137 0
router-advertisement 134 0
router-solicitation 133 0
unknown-ipv6-opt 4 2
unknown-next-hdr 4 1
Views
User ACL6 view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A user ACL6 defines rules to filter IPv6 packets based on the source IPv6 addresses
or source User Control List (UCL) groups, destination IPv6 addresses, IPv6 protocol
types, ICMPv6 types, TCP source/destination port numbers, UDP source/
destination port numbers, and time ranges.
Currently, the user ACL6 can be applied only to the UCL groups of the NAC mode.
To control the network access rights of users based on user groups, you can
perform the following operations: configure a UCL group, associate user ACL6
rules with the UCL group so that the ACL6 rules apply to all users in the user
group, configure packet filtering based on the user ACL6 to make the ACL6 take
effect, and then apply the UCL group to the AAA service scheme.
Prerequisites
Precautions
If the specified rule ID already exists and the new rule conflicts with the original
rule, the new rule replaces the original rule.
To modify an existing rule, delete the old rule, and then create a new rule.
Otherwise, the configuration result will be incorrect.
The undo rule command deletes an ACL6 rule even if the ACL6 rule is referenced.
Use this command with caution, especially when you delete an ACL6 rule that has
been referenced.
Example
# Add a rule to ACL6 6000 to reject all the IPv6 packets sent from UCL group
group1 to network segment fc00:1::/64.
<HUAWEI> system-view
[HUAWEI] ucl-group 1 name group1
[HUAWEI] acl ipv6 6000
[HUAWEI-acl6-ucl-6000] rule deny ipv6 source ucl-group name group1 destination fc00:1:: 64
Format
rule rule-id description description
undo rule rule-id description
Parameters
Parameter Description Value
Views
ACL view, ACL6 view
Default Level
2: Configuration level
Usage Guidelines
Application Scenarios
The rule-id parameter identifies a rule, but cannot describe the meaning and
usage of the rule. The description with a character string can be used to solve the
problem.
Prerequisites
The ACL rule has been created. If the ACL rule does not exist, the system displays
an error message when you run this command.
Precautions
If the rule description command is run repeatedly, the latest configuration takes
effect.
After you run the undo rule rule-id command, the rule and rule description are
deleted.
Example
# Configure the description for rule 5 in acl 2001, which permits the packets from
192.168.32.1.
<HUAWEI> system-view
[HUAWEI] acl 2001
[HUAWEI-acl-basic-2001] rule 5 permit source 192.168.32.1 0
[HUAWEI-acl-basic-2001] rule 5 description permit 192.168.32.1
[HUAWEI-acl-basic-2001] display acl 2001
Basic ACL 2001, 1 rule
Acl's step is 5
rule 5 permit source 192.168.32.1 0
rule 5 description permit 192.168.32.1
14.1.30 step
Function
The step command sets the step between ACL rule IDs.
The undo step command restores the default step between ACL rule IDs.
By default, the step between ACL rule IDs is 5.
Format
step step
undo step
Parameters
Parameter Description Value
Views
ACL view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The step is the difference between rule IDs when the system automatically assigns
rule IDs. For example, if the ACL step value is set to 5, rules are numbered 5, 10,
15, and so on.
To add a rule between existing rules, you need to reset the step. For example, an
ACL in config mode contains three rules with IDs being 5, 10, and 15. To insert a
new rule after rule 5 (the first rule), run the rule 7 xxxx command to insert rule 7.
If the step value is changed, ACL rule IDs are arranged automatically. For example,
if the original rule IDs are 5, 10, and 15, the rule IDs become 2, 4, and 6 after you
change the step value to 2.
NOTE
The undo step command can be used to realign ACL rule IDs immediately based on the
default step. For example, ACL rule group 3001 contains four rules with IDs being 1, 3, 5,
and 7, and the step is 2. After the undo step command is executed, the rule IDs become 5,
10, 15, and 20 and the step value is restored to 5.
Prerequisites
An ACL has been created by running the acl command.
Precautions
The ACL6 does not support the step.
Example
# Set the step between rules in ACL 3101 to 2.
<HUAWEI> system-view
[HUAWEI] acl 3101
[HUAWEI-acl-adv-3101] step 2
14.1.31 time-range
Function
The time-range command sets a time range.
The undo time-range command deletes a time range.
By default, no time range is set.
Format
time-range time-name { start-time to end-time { days } &<1-7> | from time1
date1 [ to time2 date2 ] }
undo time-range time-name [ start-time to end-time { days } &<1-7> | from
time1 date1 [ to time2 date2 ] ]
Parameters
Parameter Description Value
from time1 date1 Specifies the time for the time1 is in the format of
time range to take hh:mm.
effect. ● hh specifies the hour.
The value is an
integer that ranges
from 0 to 23.
● mm specifies the
minute. The value is
an integer that ranges
from 0 to 59.
date1 is in the format of
yyyy/mm/dd.
● yyyy specifies the
year. The value is an
integer that ranges
from 1970 to 2099.
● mm specifies the
month. The value is
an integer that ranges
from 1 to 12.
● dd specifies the day.
The value is an
integer that ranges
from 1 to 31.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Example
# Set a time range named test that takes effect from 2010-01-01 00:00 to
2010-12-31 23:59.
<HUAWEI> system-view
[HUAWEI] time-range test from 0:0 2010/1/1 to 23:59 2010/12/31
# Set a time range named test that takes effect at 8:00-18:00 from Monday to
Friday.
<HUAWEI> system-view
[HUAWEI] time-range test 8:00 to 18:00 working-day
# Set a time range named test that takes effect from 14:00 to 18:00 on every
Saturday and Sunday.
<HUAWEI> system-view
[HUAWEI] time-range test 14:00 to 18:00 off-day
Function
The auto-defend attack-packet sample command sets the packet sampling ratio
for attack source tracing.
The undo auto-defend attack-packet sample command restores the default
packet sampling ratio.
By default, the packet sampling ratio is 5. That is, one packet is sampled in every 5
packets.
Format
auto-defend attack-packet sample sample-value
undo auto-defend attack-packet sample
Parameters
Parameter Description Value
sample-value Specifies the packet sampling The value is an integer that
ratio for attack source tracing. ranges from 1 to 1024.
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Attack source tracing samples packets to identify attacks. Errors may occur in
attack packet identification or packet rate calculation. A proper packet sampling
ratio can reduce errors. A small sampling ratio makes the attack source tracing
result accurate, but increases CPU usage. For example, when the sampling ratio is
set to 1, every packet is sampled. The attack source tracing result is accurate, but
the CPU usage is high because every packet is resolved.
The auto-defend attack-packet sample command sets the sampling ratio. You
can set a proper value based on the requirements of attack source tracing
precision and CPU usage.
Prerequisites
Attack source tracing has been enabled using the auto-defend enable command.
Precautions
When a smaller attack source tracing threshold is used, the sampling ratio has
greater impact on the attack source tracing result.
Example
# Set the sampling ratio for attack source tracing in the attack defense policy
named test to 2.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
[HUAWEI-cpu-defend-policy-test] auto-defend attack-packet sample 2
Format
auto-defend enable
undo auto-defend enable
Parameters
None
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A large number of attack packets may attack the device CPU. Attack source
tracing enables the device to trace attack sources and send logs or alarms to
notify the administrator so that the administrator can take measures to defend
against the attacks. By default, logs are sent to notify the administrator if attack
source tracing is enabled.
After automatic attack source tracing is enabled, the device traces the source of
the specified packets sent to the CPU. The packet type can be set using the auto-
defend protocol command.
Precautions
Attack source tracing configured in an attack defense policy takes effect only
when the attack defense policy is applied in the system view.
Example
# Enable attack source tracing in the attack defense policy named test.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
The undo auto-defend action command disables the attack source punish
function.
Format
auto-defend action { deny [ timer time-length ] | error-down }
Parameters
Parameter Description Value
timer time-length Specifies the period during which The value ranges from
packets sent from an identified 1 to 86400, in
attack source are discarded. seconds. The default
value is 300.
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The attack source tracing process consists of four phases: packet parsing, traffic
analysis, attack source identification, and taking attack source punish actions. The
auto-defend action command is applied to taking attack source punish actions.
The device discards the packets sent from the identified source or sets the
interface receiving attack packets to the error-down state.
NOTE
If the auto-defend action is set to error-down, run the error-down auto-recovery cause auto-
defend interval interval-value command to set a recovery delay before the device is attacked.
This command is invalid for the interface in error-down state.
Prerequisites
Attack source tracing has been enabled using the auto-defend enable command.
Precautions
If you run the auto-defend action command multiple times, only the latest
configuration takes effect.
After the auto-defend action is set to deny, the device discards packets when
being attacked. The configuration result can be verified using the display auto-
defend attack-source command.
The device does not take punish actions on attack sources of whitelist users.
Attack source tracing configured in an attack defense policy takes effect only
when the attack defense policy is applied in the system view.
NOTICE
If the device sets the interface that receives the attack packets to the error-down
state, services of authorized users on the interface are interrupted. Exercise
caution when you configure the device to set the interface to the error-down
state.
Example
# Configure the device to discard packets from the identified source every 10
seconds.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
[HUAWEI-cpu-defend-policy-test] auto-defend action deny timer 10
Info: This configuration may cause packet loss.
Function
The auto-defend alarm enable command enables the event reporting function
for attack source tracing.
The undo auto-defend alarm enable command disables the event reporting
function for attack source tracing.
By default, the event reporting function for attack source tracing is disabled.
Format
auto-defend alarm enable
Parameters
None
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Prerequisites
Attack source tracing has been enabled using the auto-defend enable command.
Follow-up Procedure
Run the auto-defend threshold command to set the event reporting threshold for
attack source tracing.
Example
# Enable the event reporting function in the attack defense policy test.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
[HUAWEI-cpu-defend-policy-test] auto-defend alarm enable
Format
auto-defend protocol { all | { 8021x | arp | dhcp | dhcpv6 | icmp | icmpv6 | igmp
| mld | nd | tcp | tcpv6 | telnet | ttl-expired | udp | udpv6 }* }
undo auto-defend protocol { 8021x | arp | dhcp | dhcpv6 | icmp | icmpv6 | igmp
| mld | nd | tcp | tcpv6 | telnet | ttl-expired | udp | udpv6 }*
NOTE
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The attack source tracing process consists of four phases: packet parsing, traffic
analysis, attack source identification, and taking attack source punish actions. The
Example
# Delete IGMP and TTL-expired packets from the list of traced packets.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
[HUAWEI-cpu-defend-policy-test] undo auto-defend protocol igmp ttl-expired
Format
auto-defend threshold threshold
undo auto-defend threshold
Parameters
Parameter Description Value
threshold Specifies the checking threshold and The value is an integer that
event reporting threshold for attack ranges from 1 to 65535, in
source tracing. pps.
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After attack source tracing is enabled, you can set the checking threshold and
event reporting threshold for attack source tracing. When the number of sent
protocol packets from an attack source in a specified period exceeds the checking
threshold, the device traces and logs the attack source.
Prerequisites
Attack source tracing has been enabled using the auto-defend enable command.
Precautions
If you run the auto-defend threshold command in the same attack defense policy
view multiple times, only the latest configuration takes effect.
After the auto-defend enable command is executed, the device traces the attack
source based on the default threshold even if the auto-defend threshold
command is not used.
Example
# Set the checking threshold and event reporting threshold for attack source
tracing in the attack defense policy named test to 200 pps.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
[HUAWEI-cpu-defend-policy-test] auto-defend threshold 200
Function
The auto-defend trace-type command configures an attack source tracing mode.
By default, attack source tracing is based on source IP addresses and source MAC
addresses.
Format
auto-defend trace-type { source-mac | source-ip | source-portvlan } *
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After enabling attack source tracing, you can specify one or more attack source
tracing modes. The device then uses the specified modes to trace attack sources.
The device supports the following attack source tracing modes:
● Source IP address-based tracing: defends against Layer 3 attack packets.
● Source MAC address-based tracing: defends against Layer 2 attack packets
with a fixed source MAC address.
● Source port+VLAN based tracing: defends against Layer 2 attack packets with
different source MAC addresses.
Prerequisites
Attack source tracing has been enabled using the auto-defend enable command.
Precautions
In VXLAN scenarios, the source port+VLAN based tracing mode is not supported.
In addition, for the S6735-S, S6720-EI and S6720S-EI, the source IP address-based
tracing mode is not supported.
Table 14-18 lists the attack source tracing modes supported for different types of
packets.
Table 14-18 Attack source tracing modes supported for different types of packets
ARP, DHCP, IGMP, ND, DHCPv6, MLDv6 Based on source MAC addresses, based
on IP addresses, and based on source
ports+VLANs
If you run this command multiple times, only the latest configuration takes effect.
A switch supports different numbers if attack source tracing modes for different
protocol packets. For details, see the default modes described above.
After the attack source tracing function is enabled on the device, you can run the
display auto-defend attack-source command to view attack source tracing
information if an attack occurs.
When the attack source tracing mode is source-ip and action is error-down, if
multiple interfaces receive the attack packets with the same source IP address and
the packet rate exceeds the threshold, the switch shuts down only one interface,
and then checks packet rate again. If the packet rate is still higher than the
threshold, the switch shuts down another interface. The switch repeats the
operations until the packet rate falls below the threshold.
Example
# Configure attack source tracing based on source MAC addresses.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
[HUAWEI-cpu-defend-policy-test] undo auto-defend trace-type source-ip source-portvlan
Function
The auto-defend whitelist command configures an attack source tracing
whitelist. The switch does not trace the source of users in the whitelist.
● If an application uses the TCP protocol and has set up a TCP connection with
the switch, the switch will not consider TCP packets with the matching source
IP address as attack packets. If no TCP packets match a source IP address
within 1 hour, the rule that specifies this source IP address will be aged out.
● If an interface has been configured as a DHCP trusted interface using the
dhcp snooping trusted command, the switch will not consider DHCP packets
received from this interface as attack packets.
● If an interface has been configured as a MAC forced forwarding (MFF)
network-side interface using the mac-forced-forwarding network-port
command, the switch will not consider ARP packets received from this
interface as attack packets.
For the preceding conditions, the switch supports a maximum of 16 whitelist
matching rules based on source IP addresses and interfaces, and a maximum of 8
whitelist matching rules based on source IP addresses of TCP packets.
Format
auto-defend whitelist whitelist-number { acl acl-number | interface interface-
type interface-number }
undo auto-defend whitelist whitelist-number [ acl acl-number | interface
interface-type interface-number ]
Parameters
Parameter Description Value
whitelist-number Specifies the number of a The value is an integer that
whitelist. ranges from 1 to 16.
acl acl-number Specifies the number of an The value is an integer that
ACL referenced by a whitelist. ranges from 2000 to 4999.
● 2000 to 2999: basic ACLs
● 3000 to 3999: advanced
ACLs
● 4000 to 4999: Layer 2 ACLs
interface Specifies the interface to -
interface-type which the whitelist is applied.
interface-number ● interface-type specifies the
interface type.
● interface-number specifies
the interface number.
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Attack source tracing helps locate and punish sources of denial of service (DoS)
attacks. If some users do not need to be traced regardless of whether an attack
occurs, run the auto-defend whitelist command to configure a whitelist for users.
Prerequisites
Attack source tracing has been enabled using the auto-defend enable command.
Precautions
Before referencing an ACL in a whitelist, create the ACL and configure rules.
If the ACL referenced by the whitelist specifies some protocols, ensure that packets
of these protocols can be traced. You can run the display auto-defend
configuration command to view the protocols supported by attack source tracing.
If a protocol is not supported by attack source tracing, you can run the auto-
defend protocol command to configure attack source tracing to support the
protocol.
Example
# Add source IP addresses 10.1.1.1 and 10.1.1.2 to the attack source tracing
whitelist.
<HUAWEI> system-view
[HUAWEI] acl 2000
[HUAWEI-acl-basic-2000] rule permit source 10.1.1.1 0
[HUAWEI-acl-basic-2000] rule permit source 10.1.1.2 0
[HUAWEI-acl-basic-2000] quit
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-defend enable
[HUAWEI-cpu-defend-policy-test] auto-defend whitelist 1 acl 2000
Function
The auto-port-defend aging-time command configures the aging time for port
attack defense.
By default, the aging time for port attack defense is 300 seconds.
Format
auto-port-defend aging-time time
Parameters
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After a device with port attack defense function enabled detects an attack on a
port, the device traces the source and limits the rate of the attack packets on the
port within the aging time (T seconds). When the aging time expires, the device
calculates the protocol packet rate on the port again. If the rate is still above the
protocol rate threshold, the device keeps tracing the source and limits the rate of
the attack packets; otherwise, the device stops the operations.
If the aging time is too short, the device frequently starts packet rate detection on
ports, which consumes CPU resources. If the aging time is too long, protocol
packets cannot be promptly processed by the CPU, which affects services.
Therefore, you need to run the auto-port-defend aging-time command to set an
appropriate aging time according to the CPU usage and service status.
Prerequisites
The port attack defense function has been enabled using the auto-port-defend
enable command.
Precautions
Example
# Set the aging time in the attack defense policy test view to 350 seconds.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-port-defend enable
[HUAWEI-cpu-defend-policy-test] auto-port-defend aging-time 350
Format
auto-port-defend alarm enable
undo auto-port-defend alarm enable
Parameters
None
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If a port undergoes a DoS attack, the malicious attack packets sent from this port
to the CPU occupy bandwidth. As a result, the CPU cannot process the protocol
packets sent from other ports, and services are interrupted. In this situation, you
can enable the report of port attack defense events. When the rate of protocol
packets on a port exceeds the check threshold, the switch reports an event to
notify the network administrator, so that the administrator can promptly take
measures to protect the switch.
Prerequisites
The port attack defense function has been enabled using the auto-port-defend
enable command.
Follow-up Procedure
Run the auto-port-defend protocol threshold command to set the threshold for
protocol packet check in port attack defense.
Example
# Enable the report of port attack defense events in the attack defense policy test.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-port-defend enable
[HUAWEI-cpu-defend-policy-test] auto-port-defend alarm enable
Function
The auto-port-defend enable command enables the port attack defense function.
The undo auto-port-defend enable command disables the port attack defense
function.
Format
auto-port-defend enable
Parameters
None
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an attacker initiates a DoS attack on a port, the malicious attack packets sent
from this port to the CPU occupy bandwidth. As a result, the CPU cannot process
the protocol packets sent from other ports, and services are interrupted.
The port attack defense function effectively limits the number of packets sent to
the CPU, and prevents DoS attacks aiming at the CPU.
Precautions
After the port attack defense function is enabled in an attack defense policy, the
attack defense policy must be applied in the system view.
Example
# Enable the port attack defense function in the attack defense policy test view.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-port-defend enable
Function
The auto-port-defend protocol command specifies the types of protocol packets
to which port attack defense is applied.
The undo auto-port-defend protocol command cancels port attack defense for
certain types of protocol packets.
By default, port attack defense is applicable to ARP Request, Unicast ARP Request
packets, ARP Reply, DHCP, ICMP, IGMP, IP fragment, and ND packets.
Format
auto-port-defend protocol { all | { arp-request | arp-request-uc | arp-reply |
dhcp | icmp | igmp | ip-fragment | nd } * }
NOTE
● S2720-EI, S5720-LI, S5720S-LI, S5720I-SI, S5735S-H, and S5736-S do not support arp-
request-uc parameter.
● S2720-EI, S5720-LI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L,
S5735S-L1, S5735S-L-M, S5720S-LI, S5735-S, S500, S5735S-S, S5735-S-I, S5720I-SI,
S5735S-H, and S5736-S do not support icmp and ip-fragment parameter.
● S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-
L-M, S5735-S, S500, S5735-S-I, and S5735S-S do not support nd parameter.
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, the device calculates the rate of all protocol packets, including ARP
Request, ARP Reply, DHCP, ICMP, IGMP, and IP fragment packets, received by a
port, and traces the source and limits the rate of attack packets. If the packets
exceeding protocol rate threshold contain only a few attack packets, you can run
the undo auto-port-defend protocol command to cancel port attack defense for
unneeded protocol types. If the device limits the rate of too many protocols,
services are affected.
Prerequisites
The port attack defense function has been enabled using the auto-port-defend
enable command.
Precautions
If you run this command multiple times in the same attack defense policy view,
only the latest configuration takes effect.
After port attack defense is applied to a type of protocol packets, the display
auto-port-defend attack-source command can display the attack source tracing
information if the port is attacked by the specified protocol packets.
Example
# In the attack defense policy test, cancel port attack defense for ARP Reply
packets.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-port-defend enable
[HUAWEI-cpu-defend-policy-test] undo auto-port-defend protocol arp-reply
ip-fragment 30 pps
Format
auto-port-defend protocol { all | arp-request | arp-request-uc | arp-reply | dhcp
| icmp | igmp | ip-fragment | nd } threshold threshold
undo auto-port-defend protocol { all | arp-request | arp-request-uc | arp-reply
| dhcp | icmp | igmp | ip-fragment | nd } threshold [ threshold ]
NOTE
● S2720-EI, S5720-LI, S5720S-LI, S5720I-SI, S5735S-H, and S5736-S do not support arp-
request-uc parameter.
● S2720-EI, S5720-LI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L,
S5735S-L1, S5735S-L-M, S5720S-LI, S5735-S, S500, S5735S-S, S5735-S-I, S5720I-SI,
S5735S-H, and S5736-S do not support icmp and ip-fragment parameter.
● S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-
L-M, S5735-S, S500, S5735-S-I, and S5735S-S do not support nd parameter.
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After port attack defense is enabled on a port, the device calculates the rate of
affected protocol packets received by the port. If the packet rate exceeds the
protocol rate threshold, the device considers that an attack occurs. Then the device
traces the source and limits the rate of attack packets on the port, and records a
log. The device moves the packets within the protocol rate limit (CPCAR in attack
defense policies) to the low-priority queue, and then sends them to the CPU.Port
Attack Defense The device discards the excess packets.
You need to set an appropriate rate threshold for port attack defense according to
service requirements. If the CPU fails to process many protocol packets promptly
after port attack defense is enabled, set a large packet rate threshold. If the CPU is
busy processing the packets of a protocol, set a small rate threshold for this
protocol to avoid impact on other services.
Prerequisites
The port attack defense function has been enabled using the auto-port-defend
enable command.
Precautions
If you run the auto-port-defend protocol threshold command multiple times in
the same attack defense policy view, only the latest configuration takes effect.
Example
# In the attack defense policy test, set the rate threshold for ARP Request packets
to 40 pps.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-port-defend enable
[HUAWEI-cpu-defend-policy-test] auto-port-defend protocol arp-request threshold 40
Format
auto-port-defend sample sample-value
undo auto-port-defend sample [ sample-value ]
Parameters
Parameter Description Value
sample sample- Specifies the protocol packet The value is an integer
value sampling ratio for port attack that ranges from 1 to
defense. 1024.
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A device with port attack defense enabled identifies attacks by analyzing sampled
packets. There may be errors in attack packet identification or packet rate
calculation. Errors influence the attack defense effect. An appropriate sampling
ratio helps you control attack defense accuracy.
A small sampling ratio improves attack defense accuracy, but consumes more CPU
resources. When the sampling ratio is set to 1, the device analyzes every packet.
The attack packets can be detected quickly, but CPU usage becomes high and
services are affected. Therefore, make a balance between the attack defense
requirement and CPU usage to decide a sampling ratio.
Prerequisites
The port attack defense function has been enabled using the auto-port-defend
enable command.
Precautions
If the protocol packet rate threshold for port attack defense is set to a small value,
the attack identification error caused by packet sampling ratio is large.
Example
# Set the protocol packet sampling ratio to 4 in the attack defense policy test
view.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-port-defend enable
[HUAWEI-cpu-defend-policy-test] auto-port-defend sample 4
Function
The auto-port-defend whitelist command configures a whitelist for port attack
defense.
Format
auto-port-defend whitelist whitelist-number { acl acl-number | interface
interface-type interface-number }
undo auto-port-defend whitelist whitelist-number [ acl acl-number | interface
interface-type interface-number ]
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The port attack defense function is enabled by default on the device, so the device
calculates protocol packet rates on all interfaces, and traces the source and limits
the rate of attack packets. In some services, network-side interfaces need to
receive a lot of valid protocol packets. You should add these interfaces or network
nodes connecting to these interfaces to the whitelist. The device does not trace
the source or limit the rate of protocol packets received by the interfaces in the
whitelist.
Prerequisites
The port attack defense function has been enabled using the auto-port-defend
enable command.
Precautions
To define the whitelist using an ACL, you must create an ACL and configure rules
for the ACL.
Before configuring an ACL whitelist for some protocols, ensure that the port attack
defense function supports these protocols. Use the auto-port-defend protocol
command to specify the protocols to which port attack defense is applied.
Example
# In the attack defense policy test, configure a whitelist that references an ACL.
The ACL permits the packets from the users with IP addresses 10.1.1.1 and
10.1.1.2.
<HUAWEI> system-view
[HUAWEI] acl 2000
[HUAWEI-acl-basic-2000] rule permit source 10.1.1.1 0
[HUAWEI-acl-basic-2000] rule permit source 10.1.1.2 0
[HUAWEI-acl-basic-2000] quit
# In the attack defense policy test, add interface GE0/0/1 to the whitelist for port
attack defense.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] auto-port-defend enable
[HUAWEI-cpu-defend-policy-test] auto-port-defend whitelist 1 interface gigabitethernet 0/0/1
14.2.17 blacklist
Function
The blacklist command configures a blacklist.
Format
IPv4 blacklist:
IPv6 blacklist:
Blacklist that discards the packets matching ACL rules in the forwarding chip:
NOTE
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
To defend against malicious packet attacks, the device uses ACLs to add users with
the specific characteristic into a blacklist and discards the packets from the users
in the blacklist. In addition, for S1720GF, S1720GW, S1720GFR-P, S1720GW-E,
S1720GWR, S1720GWR-E, S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5735S-H, and
S5736-S, packets matching the IPv4 blacklist are sent to the CPU first, and then
discarded. To discard the packets directly without sending them to the CPU, you
can run the blacklist blacklist-id acl acl-number3 hard-drop command. This
function can reduce impact of malicious packets on the CPU usage, and applies to
only IPv4 packets.
An attack defense policy can contain a maximum of eight blacklists (including
IPv4 and IPv6 blacklists and the blacklist that discards the packets matching ACL
rules).
For S6735-S, S6720-EI, and S6720S-EI, packets sent from blacklisted users are
discarded after traffic statistics are collected; therefore, you can run the display
Example
# Specify ACL 2001 as the rule of blacklist 2.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] blacklist 2 acl 2001
Info: This configuration may cause packet loss.
# Apply ACL 3006 to blacklist 5 to discard the packets matching ACL 3006 in the
forwarding chip.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] blacklist 5 acl 3006 hard-drop
Info: This configuration may cause packet loss.
Function
The car command sets the rate limit for packets sent to the CPU.
The undo car command restores the default rate limit for packets sent to the CPU.
By default, the CIR value for user-defined flows is 64 kbit/s. You can run the
display cpu-defend configuration command to check the CAR values for protocol
packets.
Format
car { packet-type packet-type | user-defined-flow flow-id } cir cir-value [ cbs
cbs-value ]
Parameters
packet-type Specifies the type The supported packet type depends on the
packet-type of packets. device.
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The switch has default CAR values for each type of protocol packet. You can adjust
CAR values for specified types of protocol packets based on services and network
environment.
After an attack defense policy is created, you can limit the rate of protocol packets
using the policy:
● Reduce the CAR values in the following situation: When a network undergoes
an attack, reduce the CAR values of the corresponding protocol, to reduce
impact on the system CPU.
● Increase the CAR values in the following situation: When service traffic
volume on the network increases, a large number of protocol packets need to
be sent to the CPU. Increase the CAR values of the corresponding protocols to
meet service requirements.
NOTICE
Improper CPCAR settings will affect services on your network. If you need to
adjust CPCAR settings, you are advised to contact technical support personnel for
help.
portal 152
dhcp-server 374
sip 800
Precautions
If you run the deny command and then the car command, the car command
takes effect; if you run the car command, and then the deny command, the deny
command takes effect.
NOTE
When the actual and configured rates of packets sent to the CPU are large, the CPU usage
may be high and the performance may deteriorate. In the worst situation, the stack breaks.
The S1720GF, S1720GW-E, S1720GFR-P, S1720GWR-E, S2720-EI, S5720I-SI, S5720-LI,
S5720S-LI, S5735S-H, and S5736-S use the CAR values configured for FIB-hit packets to
limit the rate of ND packets destined for the MAC address of the local switch, and limit
rates of BPDU and CDP packets by using the CPCAR configured by the car packet-type
bpdu-tunnel cir cir-value [ cbs cbs-value ] command.
Example
# Set the rate limit in the attack defense policy named test for ARP Reply packets:
set the CIR value to 64 kbit/s and the CBS value to 33000 bytes.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] car packet-type arp-reply cir 64 cbs 33000
Warning: Improper parameter settings may affect stable operating of the system. Use this command under
Function
The cpu-defend application-apperceive enable command enables active link
protection (ALP). After the ALP is enabled, the CAR values of protocol packets set
using linkup-car can take effect.
By default, ALP is enabled on FTP, IPv6 FTP, HTTP, HTTPS, IP-CLOUD, IKE, IPSEC-
ESP, SSH, TELNET, and TFTP packets and disabled on BGP, BGP4+, ISIS, OSPF, and
OSPFv3 packets.
Format
cpu-defend application-apperceive [ bgp | bgp4plus | ftp | ftpv6 | http | https |
ike | ip-cloud | ipsec-esp | isis | ospf | ospfv3 | ssh | telnet | tftp ] enable
NOTE
● Only the S5735S-H, S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S5735-S,
S500, S5735S-S, S5735-S-I, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S,
and S6730S-S support the bgp parameter.
● Only the S1720GF, S1720GW-E, S1720GFR-P, S1720GWR-E, S2720-EI, S5720I-SI, S5720-
LI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1,
S5735S-L-M, S5720S-LI, S5735-S, S500, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S6735-
S, S6720-EI, and S6720S-EI support the ike parameter.
● Only the S2720-EI, S5720I-SI, S5720-LI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300,
S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5720S-LI, S5735-S, S500, S5735S-S, S5735-
S-I, S5735S-H, S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S,
S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the ipsec-esp
parameter.
● Only the S1720GF, S1720GFR-P, S1720GW-E, S1720GWR-E, S2720-EI, S5720-LI, S1730S-
H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M,
S5735-S, S500, S5735S-S, S5735-S-I, S5720S-LI, S5735S-H, S5736-S, S5731-H, S5731-S,
S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H,
S6730-S, and S6730S-S support the ospf parameter.
● Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-
EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the bgp4plus and isis
parameter.
● Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-
EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the ospfv3 parameter.
● Only the S1720-10GF-2P, S1720-10GF-PWR-2P, S1720-28GFR-4P, S1720-28GFR-PWR-4P,
S1720-52GFR-4P, S1720-52GFR-PWR-4P, S1730S-H, S1730S-S1, S200, S5720I-SI, S5720-
LI, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M,
S5720S-LI, S500, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H, S5731S-H,
S5732-H, S5731-S, S5731S-S, S6730-S, S6730S-S, S6735-S, S6720-EI, S6720S-EI, S6730-
H, S6730S-H support the ip-cloud parameter.
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The default CAR value of BGP, BGP4+, FTP, IPv6 FTP, HTTP, HTTPS, IP-CLOUD, ISIS,
OSPFv3, OSPF, IKE, IPSEC-ESP, SSH, TFTP, or TELNET protocol is small. When a
switch uses these protocols to transfer files or set up connections with other hosts
or devices, the number of protocol packets sharply increases in a short period.
When the packet rate exceeds the limit, the protocol packets are dropped. The
switch may also undergo attacks of other protocols. This affects data transmission
and causes service interruption.
You can run the cpu-defend application-apperceive command to enable ALP for
above protocols, ensuring normal operation of these related services when attacks
occur. When a connection is set up, the switch sends packets at the rate of the
CPCAR value configured using the linkup-car command. The CPCAR value can be
set as required.
Precautions
To enable the ALP function for a certain protocol, run the cpu-defend
application-apperceive enable command to enable ALP globally. For example,
before enabling ALP for the TFTP protocol, run the cpu-defend application-
apperceive enable command, and then the cpu-defend application-apperceive
tftp enable command to make the configuration take effect.
Example
# Enable ALP on BGP packets and set the CIR value to 256 kbit/s.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] linkup-car packet-type bgp cir 256
[HUAWEI-cpu-defend-policy-test] quit
[HUAWEI] cpu-defend application-apperceive enable
[HUAWEI] cpu-defend application-apperceive bgp enable
Function
The cpu-defend dynamic-adjust enable command enables adaptive CPCAR
adjustment for protocol packets.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support this function.
Format
cpu-defend dynamic-adjust [ packet-type { arp-reply | arp-request | arp-
request-uc | dhcp-client | dhcp-server | igmp | nd } ] enable
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The default CPCAR values for protocol packets may not meet the dynamic
requirements on the rate of sending protocol packets to the CPU. To resolve this
problem, you can run this command to enable the adaptive CPCAR adjustment
function for protocol packets.
After adaptive CPCAR adjustment is enabled for a specified type of protocol
packets, the device periodically detects whether the protocol packets are lost. If
packet loss occurs in the last detection period, the device adjusts the CPCAR value
of the protocol packets according to the CPU usage. If the CPU usage is low, the
device increases the CPCAR value. If the CPU usage is high, the device decreases
the CPCAR value. The new CPCAR values must be within the allowed range. If
packet loss occurs due to congestion in the queue of protocol packets, the device
restores the default CPCAR value of the protocol packets. You can run the display
cpu-defend dynamic-adjust history-record command to view the historical
adaptive CPCAR adjustment records.
The following table lists the supported protocol packet types and the maximum
CPCAR values allowed after adjustment.
Precautions
● This function takes effect only when the default CPCAR values of protocol
packets are not manually modified.
● After adaptive CPCAR adjustment for protocol packets is enabled globally, this
function takes effect for all supported types of protocol packets.
● If this command is configured together with the cpu-defend dynamic-car
enable command for the same type of protocol packets, this command takes
effect.
Example
# Enable adaptive CPCAR adjustment for ARP request packets.
<HUAWEI> system-view
[HUAWEI] cpu-defend dynamic-adjust packet-type arp-request enable
Function
The cpu-defend dynamic-car enable command enables a switch to dynamically
adjust the default CIR value for protocol packets.
By default, dynamic adjustment of the default CIR value is enabled globally, but
the switch is disabled from dynamically adjusting the default CIR value for VRRP
and ARP protocol packets.
NOTE
Only the S5720I-SI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-
L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H, S5731-S,
S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and
S6730S-S support this command.
Format
cpu-defend dynamic-car [ arp | vrrp ] enable
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A fixed default CIR value may not adapt to dynamic requirements on rate limiting
for protocol packets. The cpu-defend dynamic-car enable command enables a
switch to dynamically adjust the default CIR value for protocol packets.
If the default CIR value for a protocol has never been changed, the switch
dynamically adjusts the default CIR value for the protocol packets based on service
scale (for example, number of dynamic ARP entries) and CPU usage to meet
various service requirements. For details, see Table 14-19.
X ≤ 512 Unchanged
NOTE
When the number of entries increases, the CPCAR value is dynamically increased. When the
CPU usage is between 70% to 98%, the dynamic CPCAR adjustment stops. If the CPU usage
is greater than 98%, the default CPCAR value is used.
Precautions
The switch dynamically adjusts the default CIR value for VRRP or ARP protocol
packets only when the function is enabled globally and on VRRP or ARP protocol
packets.
The default CIR value dynamically adjusted only takes effect when the CIR value
of the protocol packet is not manually changed.
After the default CPCAR setting is modified for ARP, only the CIR value for ARP
reply, Unicast ARP request, and ARP request packets is adjusted.
Example
# Enable the switch to dynamically adjust the default CIR value for ARP protocol
packets.
<HUAWEI> system-view
[HUAWEI] cpu-defend dynamic-car enable
[HUAWEI] cpu-defend dynamic-car arp enable
Function
The cpu-defend host-car command specifies the packet type to which the user-
level rate limiting is applied.
By default, the user-level rate limiting can apply to ARP Request, ARP Reply, ND,
DHCP Request, DHCPv6 Request, and 8021x packets, but does not apply to IGMP
and HTTPS-SYN packets.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
cpu-defend host-car { { arp | dhcp-request | dhcpv6-request | igmp | nd | 8021x
| https-syn } * | all }
Parameters
Parameter Description Value
arp Applies user-level rate limiting to ARP packets. -
dhcp-request Applies user-level rate limiting to DHCP Request -
packets.
dhcpv6-request Applies user-level rate limiting to DHCPv6 Request -
packets.
igmp Applies user-level rate limiting to IGMP packets. -
nd Applies user-level rate limiting to ND packets. -
8021x Applies user-level rate limiting to 8021x packets. -
https-syn Applies user-level rate limiting to HTTPS-SYN packets. -
all Applies user-level rate limiting to ARP, DHCP Request, -
DHCPv6 Request, IGMP, ND, 8021x, and HTTPS-SYN
packets.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, the switch limits the rates of the ARP, ND, DHCP Request, DHCPv6
Request, and 8021x packets received from user MAC addresses, including wired
and wireless users, and discards excessive packets when the packet rates exceed
the rate limit. If you need to limit the rate of only IGMP and HTTPS-SYN packets
or packets of the specified types, specify the packet type.
Precautions
● Before using this command, run the cpu-defend host-car enable command
to enable user-level rate limiting.
● If the command is run multiple times, the user-level rate limiting applies to
the packet type specified in the last command. For example, if the command
specifying ARP and DHCP Request packets is run, and then the cpu-defend
host-car arp command is run, the user-level rate limiting applies to only ARP
packets.
● After the cpu-defend host-car all command is run, the configuration file
displays cpu-defend host-car 8021x arp dhcp-request dhcpv6-request
https-syn igmp nd.
Example
# Apply user-level rate limiting to ARP, DHCP Request, DHCPv6 Request, IGMP,
and ND packets.
<HUAWEI> system-view
[HUAWEI] cpu-defend host-car arp dhcp-request dhcpv6-request igmp nd
Function
The cpu-defend host-car drop-packet cir command sets a rate limit for sending
packets that are discarded due to user-level rate limiting to the CPU.
The undo cpu-defend host-car drop-packet cir command restores the default
rate limit.
By default, the CIR and CBS for sending packets that are discarded due to user-
level rate limiting to the CPU are 64 kbit/s and 12032 bytes, respectively.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
cpu-defend host-car drop-packet cir cir-value [ cbs cbs-value ]
Parameters
Parameter Description Value
cir-value Specifies the CIR value. The value is an integer in the range from
64 to 4096, in kbit/s.
cbs cbs-value Specifies the CBS value. The value is an integer in the range from
10000 to 800000, in bytes.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the undo cpu-defend host-car drop-packet monitor disable command is
run to enable monitoring for packets discarded due to user-level rate limiting, the
discarded packets are sent to the CPU. You can run the cpu-defend host-car
drop-packet cir command to adjust the rate limit for sending these discarded
packets to the CPU.
Prerequisites
Monitoring for packets discarded due to user-level rate limiting has been enabled
using the undo cpu-defend host-car drop-packet monitor disable command.
Example
# Set the CIR and CBS for sending packets that are discarded due to user-level rate
limiting to the CPU to 128 kbit/s and 16384 bytes, respectively.
<HUAWEI> system-view
[HUAWEI] cpu-defend host-car enable
[HUAWEI] undo cpu-defend host-car drop-packet monitor disable
[HUAWEI] cpu-defend host-car drop-packet cir 128 cbs 16384
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
cpu-defend host-car drop-packet monitor disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After user-level rate limiting is enabled, the switch discards the excess packets if
the rate of packets from the same source MAC address exceeds the rate limit
within a specified period of time. To check the information about discarded
packets, you can run the cpu-defend host-car drop-packet monitor disable
command to enable monitoring for packets discarded due to user-level rate
limiting.
Prerequisites
User-level rate limiting has been enabled using the cpu-defend host-car enable
command.
Precautions
After you run the cpu-defend host-car drop-packet monitor disable command
to disable monitoring for packets discarded due to user-level rate limiting, the
cpu-defend host-car drop-packet cir command configuration is deleted.
Example
# Enable monitoring for packets discarded due to user-level rate limiting.
<HUAWEI> system-view
[HUAWEI] cpu-defend host-car enable
[HUAWEI] undo cpu-defend host-car drop-packet monitor disable
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
cpu-defend host-car enable
undo cpu-defend host-car enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
User-side hosts are prone to virus attacks. Infected hosts may send a large number
of protocol packets to network devices, causing a high CPU usage and degraded
performance on the devices and affecting services. You can configure the user-
level rate limiting to resolve this problem. User-level rate limiting identifies users
by user MAC addresses and limits the rates of specified packets for both wired and
wireless users. By default, the threshold for each user MAC address is 10 pps.
The user-level rate limiting is more precise than CPCAR (based on switches) and
port attack defense (based on interfaces) because it is user-specific and has little
impact on online users.
Precautions
● After you run the undo cpu-defend host-car enable command to disable
user-level rate limiting, all configurations related to user-level rate limiting are
deleted or restored to the default values.
● You are advised to disable user-level rate limiting on network-side ports of
access switches and network interconnection interfaces of gateway switches.
● During user-level rate limiting, the system performs a hash calculation for the
source MAC addresses of specified packets, and places the packets into
different buckets. Therefore, multiple users may share the rate limit. When
the traffic volume is heavy on the network, packets may be dropped. If you
confirm that these users are authorized, run the cpu-defend host-car mac-
address mac-address command to increase the rate threshold for the
specified MAC addresses.
Example
# Disable user-level rate limiting.
<HUAWEI> system-view
[HUAWEI] undo cpu-defend host-car enable
Function
The cpu-defend host-car pps command sets the rate limit for the user-level rate
limiting.
The undo cpu-defend host-car command restores the default rate limit for the
user-level rate limiting.
By default, the rate limit for the user-level rate limiting is 10 pps.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
cpu-defend host-car [ mac-address mac-address | car-id car-id ] pps pps-value
Parameters
mac-address mac- Sets the rate limit for The value is in the H-H-H format.
address the specified MAC H is a hexadecimal number of 1
address. to 4 digits.
car-id car-id Sets the rate limit for The value is an integer that
the specified bucket. ranges from 0 to 8191.
pps pps-value Indicates the rate limit. The value is an integer that
ranges from 1 to 128.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
User-level rate limiting identifies users by user MAC addresses and limits the rates
of specified packets (ARP, ND, DHCP Request, DHCPv6 Request, IGMP, 802.1X, and
HTTPS-SYN packets) for both wired and wireless users. By default, the user-level
rate limit is 10 pps. You can set a rate limit based on user.
Precautions
● Before using this command, run the cpu-defend host-car enable command
to enable user-level rate limiting.
● If the rate limit is too high, attacks cannot be prevented and CPU may be
overloaded.
● If both the cpu-defend host-car mac-address mac-address pps pps-value
and cpu-defend host-car pps pps-value commands are run, the rate limit for
the specified MAC address is determined by the former command, and the
rate limit for other MAC addresses is determined by the latter command.
● The user-level rate limiting performs a hash calculation for the source MAC
addresses of specified packets, and places the packets into different buckets.
When two user MAC addresses are mapped to the same bucket index, the
two users share the same rate limit (in pps mode). If the two users modify
the rate limit for the bucket simultaneously, the setting will be overwritten. To
avoid this situation, the rate limit for the specified MAC address cannot be set
upon hash conflict.
● When the cpu-defend host-car mac-address mac-address pps pps-value and
cpu-defend host-car pps pps-value commands are run to configure the rate
limit for multiple MAC addresses, the settings are displayed in the alphabetic
order in the configuration file.
Example
# Set the rate limit for MAC address 00e0-fc0b-000c to 20 pps.
<HUAWEI> system-view
[HUAWEI] cpu-defend host-car mac-address 00e0-fc0b-000c pps 20
By default, the default attack defense policy exists on the device and is applied to
the device. The default attack defense policy cannot be deleted or modified.
Format
cpu-defend policy policy-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A large number of packets including malicious attack packets are sent to the CPU
on a network. If excess packets are sent to the CPU, the CPU usage becomes high
and CPU performance deteriorates. The attack packets affect services and may
even cause system breakdown. To solve the problem, create an attack defense
policy and configure CPU attack defense and attack source tracing in the attack
defense policy.
Precautions
When the default attack defense policy is used, protocol packets sent to the CPU
are limited based on the default CIR value.
Example
# Create an attack defense policy named test.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test]
14.2.28 cpu-defend-policy
Function
The cpu-defend-policy command applies an attack defense policy.
Format
The stack-incapable models support the following commands:
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After an attack defense policy is created, you must apply the policy in the system
view. Otherwise, the attack defense policy does not take effect.
Prerequisites
An attack defense policy has been created by using the cpu-defend policy
command.
Example
# Apply the attack defense policy named test to all devices.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] quit
[HUAWEI] cpu-defend-policy test global
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I,
S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this
command.
Format
cpu-defend trap drop-packet
undo cpu-defend trap drop-packet
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To protect the CPU, a switch limits the rate of protocol packets sent to the CPU
based on the CPCAR. If the rate of protocol packets exceeds the CPCAR, excess
protocol packets are dropped. As a result, the corresponding service may not run
normally. To quickly detect packet loss caused by CPCAR exceeding, you can use
this command to enable alarm reporting for this event. After this function is
enabled, the switch checks for packet loss caused by CPCAR at 10-minute
intervals. If the switch finds that the number of dropped packets of a protocol
increases, the switch reports a packet loss alarm.
Precautions
After this alarm reporting function is enabled, the switch reports packet loss
alarms based on protocol types. That is, if the rates of packets of multiple
protocols exceed the CPCAR values set for these protocols, the switch reports an
alarm for each protocol.
Example
# Enable alarm reporting for packet loss caused by CPCAR exceeding.
<HUAWEI> system-view
[HUAWEI] cpu-defend trap drop-packet
14.2.30 deny
Function
The deny command configures the device to discard packets sent to the CPU.
The undo deny command restores the default action taken for the packets sent to
the CPU.
By default, the device does not discard packets sent to the CPU. Instead, the device
limits the rate of packets sent to the CPU and user-defined flows using the default
rate. You can check the CAR values of each type of packets using the display cpu-
defend configuration command.
Format
deny { packet-type packet-type | user-defined-flow flow-id }
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After an attack defense policy is created, if the device receives attack packets of a
specified type or a large number of packets sent to the CPU, run the deny
command to configure the device to discard packets of the specified type sent to
the CPU.
Precautions
If you run the deny command, and then the car command, the car command
takes effect; if you run the car command, and then the deny command, the deny
command takes effect. After the undo deny command is executed, the default
action for packets sent to the CPU is restored, that is, CIR and CBS actions are
performed.
Example
# Configure the drop action taken for ARP Reply packets to be sent to the CPU in
the attack defense policy test.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] deny packet-type arp-reply
Function
The description command configures the description of an attack defense policy.
Format
description text
undo description
Parameters
Parameter Description Value
text Specifies the content of a It is a string of 1 to 63 case-sensitive
description. characters with spaces.
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
If you run the description command in the same attack defense policy view
multiple times, only the latest configuration takes effect.
Example
# Configure the description defend_arp_attack for the attack defense policy
named test.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] description defend_arp_attack
Function
The display auto-defend attack-source command displays the attack sources.
Format
display auto-defend attack-source [ history [ begin begin-date begin-time ]
[ slot slot-id ] | [ slot slot-id ] [ detail ] ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display auto-defend attack-source command displays the attack sources.
In a stack, the attack source list can be saved on each member switch. The display
auto-defend attack-source slot slot-id command displays the attack source list
on the specified member switch.
Example
# Display the attack source list.
<HUAWEI> display auto-defend attack-source
Attack Source User Table (slot 0):
-----------------------------------------------------------------------------
MacAddress InterfaceName Vlan:Outer/Inner TotalPackets
-----------------------------------------------------------------------------
xxxx-xxxx-xxxx GigabitEthernet0/0/1 100 1395
-----------------------------------------------------------------------------
Total: 1
Total: 1
S : start time
E : end time
Attack History User Information about attack sources on the device, which is
Table (slot 0) distinguished according to attackers.
Attack History Port Information about attack sources on the device, which is
Table (slot 0) distinguished according to attacked interfaces.
Format
display auto-defend configuration [ cpu-defend policy policy-name ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After attack source tracing is configured in an attack defense policy, you can run
the display auto-defend configuration command to view the attack source
tracing configuration.
Example
# Display the attack source tracing configuration.
<HUAWEI> display auto-defend configuration
----------------------------------------------------------------------------
Name : test
Related slot : <0>
auto-defend : enable
auto-defend attack-packet sample : 5
auto-defend threshold : 60 (pps)
auto-defend alarm : enable
auto-defend trace-type : source-mac source-ip
auto-defend protocol : arp icmp dhcp igmp tcp telnet 8021x nd dhcpv6 mld icmpv6 tcpv6
auto-defend action : deny (Expired time : 300 s)
auto-defend whitelist 1 : acl number 2002
----------------------------------------------------------------------------
NOTE
The preceding information is an example. The displayed information depends on the actual
situation.
auto-defend attack- Packet sampling ratio for attack source tracing. To set
packet sample the packet sampling ratio for attack source tracing, run
the auto-defend attack-packet sample command.
auto-defend alarm Whether the alarm function for attack source tracing is
enabled. To enable the alarm function for attack source
tracing, run the auto-defend alarm enable command.
Item Description
auto-defend action Action taken on the attack source. The value can be:
● deny (Expired time: 300s): indicates that the device
discards all attack packets in 300s.
● error-down: indicates that the inbound interfaces of
attack packets are shut down.
To configure the punish action, run the auto-defend
action command.
Function
The display auto-defend whitelist command displays information about the
attack source tracing whitelist.
Format
display auto-defend whitelist [ slot slot-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After the whitelist for attack source tracing is configured or when you locate faults
on network, run the display auto-defend whitelist command to verify whitelist
information. If no whitelist is configured, the command displays no whitelist
information.
Example
# Display information about the attack source tracing whitelist on the switch.
<HUAWEI> display auto-defend whitelist
Protocol Interface IP ACL Status
-------------------------------------------------------------------------------
DHCP GE0/0/1 -- -- auto
DHCP GE0/0/2 -- -- auto
Format
display auto-port-defend attack-source [ slot slot-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The source tracing information helps you locate attack sources.
Example
# Display the source tracing information on the interfaces of the device.
<HUAWEI> display auto-port-defend attack-source
Attack source table on slot 0:
Total : 1
--------------------------------------------------------------------------------
Interface VLAN Protocol Expire(s) PacketRate(pps)
LastAttackTime
--------------------------------------------------------------------------------
GE0/0/1 NA arp-request 297 12 2013-07-06 17:36:54
--------------------------------------------------------------------------------
Item Description
Function
The display auto-port-defend configuration command displays the configuration
of port attack defense.
Format
display auto-port-defend configuration
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To view the configuration of port attack defense, use this command.
Example
# Display the configuration of port attack defense on the local device.
<HUAWEI> display auto-port-defend configuration
--------------------------------------------------------------------------------
Name : test
Related slot : <0>
Auto-port-defend : enable
Auto-port-defend sample :5
Auto-port-defend aging-time : 300 second(s)
Auto-port-defend arp-request threshold : 120 pps(enable)
Auto-port-defend arp-request-uc threshold : 120 pps(enable)
Auto-port-defend arp-reply threshold : 120 pps(enable)
Auto-port-defend dhcp threshold : 120 pps(enable)
Auto-port-defend icmp threshold : 120 pps(enable)
Auto-port-defend igmp threshold : 120 pps(enable)
Auto-port-defend ip-fragment threshold : 30 pps(enable)
Auto-port-defend nd threshold : 120 pps(enable)
Auto-port-defend alarm : disable
--------------------------------------------------------------------------------
NOTE
The preceding information is an example. The displayed information depends on the actual
situation.
Item Description
Item Description
Function
The display auto-port-defend statistics command displays packet statistics
about port attack defense.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S,
S5735-S-I, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S
support this command.
Format
display auto-port-defend statistics [ slot slot-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to view statistics about the packets discarded and
accepted in the port attack defense service. The statistics help you understand
protocol packet processing status and promptly adjust the attack defense policy.
Example
# Display packet statistics on the interfaces of the device.
<HUAWEI> display auto-port-defend statistics
Statistics on MPU:
--------------------------------------------------------------------------------
Protocol Vlan Queue Cir(Kbps) Pass(Packet/Byte) Drop(Packet/
Byte)
--------------------------------------------------------------------------------
icmp NA 2 256 23095 3
NA NA
--------------------------------------------------------------------------------
NOTE
The preceding information is an example. The displayed packet type depends on the actual
situation.
Item Description
Format
display auto-port-defend whitelist [ slot slot-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After the whitelist for port attack defense is configured or when you locate faults
on network, run the display auto-port-defend whitelist command to verify
whitelist information. If no whitelist is configured, the command displays no
whitelist information.
Example
# Display information about the interface attack defense whitelist.
<HUAWEI> display auto-port-defend whitelist
Protocol Interface IP ACL Status
-------------------------------------------------------------------------------
-- Eth-Trunk0 -- -- auto
-- GE0/0/1 -- -- manual
-- -- -- 2000 manual
Item Description
Format
display cpu-defend applied [ packet-type packet-type ] { mcu | slot slot-id | all }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The actual CAR values may be different from the configured CAR values. The
possible causes are as follows:
● The CIR value specified in the car packet-type packet-type cir cir-value [ cbs
cbs-value ] command is a consecutive range. However, the actual CIR value is
discrete, depending on chip granularity. For example, if the CIR value range is
set to 65 to 128 with the granularity 64 kbit/s, the actual CIR value may be 64
or 128, which depends on product models.
● The configured CIR value exceeds the chip capacity and the upper threshold.
For example, the CIR value is set to 10000, but the chip does not support CIR
value 1000. Then the actual CIR value cannot reach 10000.
You can run the display cpu-defend applied command to view the actual CAR
values for protocol packets.
NOTE
When too much output information is to be displayed, specify the begin, exclude, or include
parameter to display only the required information.
Example
# Display the actual CAR values for ARP Request messages sent from the switch.
<HUAWEI> display cpu-defend applied packet-type arp-request slot 0
Applied Car on slot 0:
-------------------------------------------------------------------------------
Packet Type Cir(Kbps) Cbs(Byte) Applied Cir(Kbps) Applied Cbs(Byte)
-------------------------------------------------------------------------------
arp-request 65 10000 128 10000
-------------------------------------------------------------------------------
Applied Car on slot 0 CAR value for protocol packets sent by a specified
stack.
Format
The stack-incapable models support the following commands:
display cpu-defend configuration [ packet-type packet-type ] [ all | slot slot-
id ]
Other models support the following format:
display cpu-defend configuration [ packet-type packet-type ] { all | slot slot-id |
mcu }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run the display cpu-defend configuration command to view the rate
limit of protocol packets sent to the CPU. By default, the rate limit of protocol
packets in the default policy is displayed.
In a stack, you can run the cpu-defend-policy global command to bind all
switches to the same attack defense policy. Then you can run the display cpu-
defend configuration all command to view the same CAR configuration of all
switches in the stack.
Example
# Display the CAR configurations.
<HUAWEI> display cpu-defend configuration all
Car configurations on mainboard.
----------------------------------------------------------------------
Packet Name Status Cir(Kbps) Cbs(Byte)
----------------------------------------------------------------------
Linkup Information:
--------------------------------------------------------------------------------
Packet Name : ftp
Cir(Kbps)/Cbs(Byte) : 4096/770048
SIP(SMAC) : 10.1.2.1
DIP(DMAC) : 10.1.3.1
Port(S/C) : 42372/22
--------------------------------------------------------------------------------
Car configurations on slot 0.
----------------------------------------------------------------------
Packet Name Status Cir(Kbps) Cbs(Byte) Queue Port-Type
----------------------------------------------------------------------
8021x Disabled 128 24064 3 NA
arp-mff Disabled 64 12032 3 NA
arp-miss Enabled 64 12032 3 NA
arp-reply Enabled 128 24064 3 UNI
arp-request Enabled 128 24064 3 UNI
bfd Disabled 64 12032 5 NNI
Linkup Information:
--------------------------------------------------------------------------------
Packet Name : ftp
Cir(Kbps)/Cbs(Byte) : 4096/770048
SIP(SMAC) : 10.1.2.1
DIP(DMAC) : 10.1.3.1
Port(S/C) : 42372/22
--------------------------------------------------------------------------------
NOTE
The preceding information is an example. The displayed packet type depends on the actual
situation.
Item Description
Item Description
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support this function.
Format
display cpu-defend dynamic-adjust history-record [ packet-type { arp-reply |
arp-request | arp-request-uc | dhcp-client | dhcp-server | igmp | nd } ] { all |
mcu | slot slot-id }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After adaptive CPCAR adjustment for protocol packets is enabled, you can run this
command to view the historical adaptive CPCAR adjustment records of protocol
packets. The information includes the adjustment time, CPCAR adjustments, and
reason for the adjustments.
You can use this command to check a maximum of 100 latest historical records.
Example
# Display historical adaptive CPCAR adjustment records of protocol packets.
<HUAWEI> display cpu-defend dynamic-adjust history-record all
Dynamic-adjust history-record on mainboard:
----------------------------------------------------------------------------------------
Item Item
NOTE
Only the S5720I-SI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-
L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H, S5731-S,
S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and
S6730S-S support this command.
Format
display cpu-defend dynamic-car history-record
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After the default CIR value is set, you can run this command to view the historical
records of adjusting the CPCAR value of protocol packets from 64 kbit/s to a
specific value.
The granularity of each adjustment is 64 kbit/s on the switch. If the default CPCAR
value is greater than 64 kbit/s, the adjustments from 64 kbit/s to the default
CPCAR value are only recorded but do not take effect.
You can use this command to check a maximum of 100 latest historical records.
Example
# Display the historical records on dynamic adjustment of the default CIR value of
protocol packets.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
display cpu-defend host-car [ mac-address mac-address ] statistics [ slot slot-
id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
To view the number of packets discarded in the user-level rate limiting, run this
command.
Precautions
● Before using this command, run the cpu-defend host-car enable command
to enable user-level rate limiting.
● If the number of discarded packets is 0, the index is not displayed.
Example
# Display the number of packets discarded in the user-level rate limiting.
<HUAWEI> display cpu-defend host-car statistics
slot 0
car-id car-drop
--------------------------------------------
3192 740385
3347 7
4133 529474
4471 529477
5075 529476
5836 529474
6046 1001218
Format
display cpu-defend policy [ policy-name ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After an attack defense policy is created, you can run the display cpu-defend
policy command to view the stack ID that the attack defense policy is applied to
and configurations of the attack defense policy.
Example
# Display information about all attack defense policies.
<HUAWEI> display cpu-defend policy
----------------------------------------------------------------
Name : default
Related slot : <3>
----------------------------------------------------------------
Name : test
Description : defend_arp_attack
Related slot : <mcu>
Port-type eni packet-type arp- ARP Request packets are sent to the CPU
request through ENI ports.
NOTE
Format
display cpu-defend port-type slot slot-id
Parameters
Parameter Description Value
slot slot-id ● This parameter specifies the slot ID if The value must be set
stacking is not configured. according to the device
● This parameter specifies the stack ID configuration.
if a stack is configured.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After specifying interfaces types for sending protocol packets using the port type
{ uni | eni | nni } and port-type { uni | eni | nni } packet-type type commands,
you can run the display cpu-defend port-type command to view types of
interfaces on the device.
Example
# Display interface types in stack 0.
<HUAWEI> display cpu-defend port-type slot 0
Uni Port :
Eni Port :
Nni Port :GigabitEthernet0/0/1-22
Item Description
Function
The display cpu-defend rate command displays the rate of sending protocol
packets to the CPU.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I,
S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this
command.
Format
display cpu-defend rate [ packet-type packet-type ] [ all | slot slot-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run the display cpu-defend rate command to view the rate of sending
protocol packets to the CPU when checking the configuration of an attack defense
policy. In this way, you can determine which type of protocols may attack the CPU
based on the rate.
NOTE
To ensure normal operation of other services and protect the CPU, the rate of incremental
protocol packets is calculated only in a specified period after you run the display cpu-defend
rate command and displayed on the terminal. After you run this command, a message is
displayed to wait for a while.
Example
# Display the rate of ARP Reply packets sent from the switch to the CPU.
<HUAWEI> display cpu-defend rate packet-type arp-reply slot 0
Info: Please wait for a moment....
Cpu-defend rate on slot 0:
-------------------------------------------------------------------------------
Packet Type Pass(bps) Drop(bps) Pass(pps) Drop(pps)
-------------------------------------------------------------------------------
arp-reply 49504 86496 91 159
-------------------------------------------------------------------------------
Format
display cpu-defend statistics [ packet-type packet-type ] [ all | slot slot-id ]
NOTE
The S1720GF, S1720GFR-P, S1720GW-E, and S1720GWR-E do not support this command.
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
The display cpu-defend statistics command displays statistics about packets sent
to the CPU, including forwarded and discarded packets. This helps network
administrators configure attack defense policies.
Precautions
If all and slot are not specified, CAR statistics about packets sent to the CPU on
the master switch in a stack are displayed.
Example
# Display statistics about packets sent to the CPU on the switch, for example.
<HUAWEI> display cpu-defend statistics
Statistics on slot 0:
--------------------------------------------------------------------------------
Packet Type Pass(Packet/Byte) Drop(Packet/Byte) Last-dropping-time
--------------------------------------------------------------------------------
arp-miss 0 0 -
0 0
arp-reply 0 0 -
0 0
arp-request 0 0 -
0 0
......
# Display statistics about CAR packets sent to the CPU on the switch, for example,
the S5720-LI.
<HUAWEI> display cpu-defend statistics
Statistics on mainboard:
--------------------------------------------------------------------------------
Packet Type Pass(Packet) Drop(Packet)
--------------------------------------------------------------------------------
8021x 0 0
arp-reply 0 0
arp-request 0 0
bpdu 0 0
bpdu-tunnel 0 0
capwap-ctrl 0 0
dhcp-client 0 0
dhcp-server 0 0
eth-ring 0 0
fib-hit 0 0
ftp 0 0
https 0 0
icmp 0 0
igmp 0 0
ip-cloud 0 0
lacp 0 0
ldt 0 0
lnp 0 0
nd 0 0
ospf 0 0
pim 0 0
pppoe 0 0
rip 0 0
sip 0 0
telnet 0 0
vrrp 0 0
----------------------------------------------------------------------
# Display CAR statistics about Telnet packets of the switch, for example.
# Display CAR statistics about Telnet packets sent to the CPU on the switch, for
example, the S5720-LI.
<HUAWEI> display cpu-defend statistics packet-type telnet
Statistics on mainboard:
--------------------------------------------------------------------------------
Packet Type Pass(Packet) Drop(Packet)
--------------------------------------------------------------------------------
telnet 0 0
--------------------------------------------------------------------------------
NOTE
The preceding information is an example. The displayed packet type depends on the actual
situation.
Item Description
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
host-car disable
Parameters
None
Views
GE interface view, MultiGE interface view, XGE interface view, 25GE interface view,
40GE interface view, 100GE interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, the switch performs user-level rate limiting on the users connecting to
all interfaces. If you are sure that the users connecting to an interface are secure,
you can disable user-level rate limiting on this interface.
Precautions
● Before using this command, run the cpu-defend host-car enable command
to enable user-level rate limiting.
● After user-level rate limiting is disabled on an interface, the switch does not
limit the rate of packets received from the specified user MAC address and
cannot protect the interface against attacks. In addition, the packets of the
same type sent from other users may be affected.
Example
# Disable user-level rate limiting on the interface.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] host-car disable
14.2.49 linkup-car
Function
The linkup-car command sets the CPCAR value for packets of a protocol
connection, including the Committed Information Rate (CIR) and Committed Burst
Size (CBS).
The undo linkup-car command restores the default CPCAR rate limit.
Table 14-38 lists the default CIR and CBS values for the setup of BGP, BGP4+, FTP,
IPv6 FTP, HTTP, HTTPS, IKE, IPSEC-ESP, ISIS, OSPF, OSPFv3, SSH, TELNET, and TFTP
connections; the CIR and CBS for sending packets of IP-CLOUD connections are
2048 kbit/s and 385024 bytes respectively.
Format
linkup-car packet-type { bgp | bgp4plus | ftp | ftpv6 | http | https | ike | ip-
cloud | ipsec-esp | isis | ospf | ospfv3 | ssh | telnet | tftp } cir cir-value [ cbs cbs-
value ]
undo linkup-car packet-type { bgp | bgp4plus | ftp | ftpv6 | http | https | ike |
ip-cloud | ipsec-esp | isis | ospf | ospfv3 | ssh | telnet | tftp }
NOTE
● Only the S5735S-H, S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S5735-S,
S500, S5735S-S, S5735-S-I, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S,
and S6730S-S support the bgp parameter.
● Only the S5735S-H, S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-
H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M,
S5735-S, S500, S5735S-S, S5735-S-I, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H,
S6730-S, and S6730S-S support the https parameter.
● Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-
EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the bgp4plus and isis
parameter.
● Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-
EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the ospfv3 parameter.
● Only the S1720GF, S1720GW-E, S1720GFR-P, S1720GWR-E, S2720-EI, S5720I-SI, S5720-
LI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1,
S5735S-L-M, S5720S-LI, S5735-S, S500, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S6735-
S, S6720-EI, and S6720S-EI support the ike parameter.
● Only the S2720-EI, S5720I-SI, S5720-LI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300,
S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5720S-LI, S5735-S, S500, S5735S-S, S5735-
S-I, S5735S-H, S5736-S, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S,
S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the ipsec-esp
parameter.
● Only the S1720GF, S1720GFR-P, S1720GW-E, S1720GWR-E, S2720-EI, S5720-LI, S1730S-
H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M,
S5735-S, S500, S5735S-S, S5735-S-I, S5720S-LI, S5735S-H, S5736-S, S5731-H, S5731-S,
S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H,
S6730-S, and S6730S-S support the ospf parameter.
● Only the S1720-10GF-2P, S1720-10GF-PWR-2P, S1720-28GFR-4P, S1720-28GFR-PWR-4P,
S1720-52GFR-4P, S1720-52GFR-PWR-4P, S1730S-H, S1730S-S1, S200, S5720I-SI, S5720-
LI, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M,
S5720S-LI, S500, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H, S5731S-H,
S5732-H, S5731-S, S5731S-S, S6730-S, S6730S-S, S6735-S, S6720-EI, S6720S-EI, S6730-
H, S6730S-H support the ip-cloud parameter.
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The default CPCAR value of BGP, BGP4+, FTP, IPv6 FTP, HTTP, HTTPS, IP-CLOUD,
ISIS, OSPFv3, OSPF, IKE, IPSEC-ESP, SSH, TFTP, or TELNET protocol is small. When a
switch uses these protocols to transfer files or set up connections with other hosts
or devices, the number of protocol packets sharply increases in a short period.
When the packet rate exceeds the limit, the protocol packets are dropped. The
switch may also undergo attacks of other protocols. This affects data transmission
and causes service interruption.
You can run the cpu-defend application-apperceive command to enable active
link protection, ensuring normal operation of these protocols related services
when attacks occur. When a connection is set up, the switch sends packets at the
rate of the CPCAR value configured using the linkup-car command. The CPCAR
value can be set as required.
Follow-up Procedure
Run the cpu-defend application-apperceive enable command to enable ALP to
enable the rate limit set using the linkup-car command. By default, ALP is
enabled on FTP, IPv6 FTP, HTTP, IP-CLOUD, HTTPS, IKE, IPSEC-ESP, TFTP, SSH, and
TELNET packets and disabled on BGP, BGP4+, ISIS, OSPF, and OSPFv3 packets.
Precautions
You are advised to run the display cpu-defend configuration command to check
the CIR value supported by the protocol being used before running the linkup-car
command to set the rate limit.
BGP, BGP4+, ISIS, OSPF, and OSPFv3 are disabled when the configuration is
initialized. You can set the rate limit using the car command before the protocols
are enabled and the linkup-car command after connections are set up and ALP is
enabled.
You can set a shared CPCAR value for packets of FTP, IPv6 FTP, SSH, TFTP
connections on S1720GF, S1720GW-E, S1720GFR-P, S1720GWR-E, S2720-EI,
S5720I-SI, S5720-LI, S5720S-LI, S5735S-H, and S5736-S. For example, the linkup-
car packet-type ftp cir cir-value [ cbs cbs-value ] command specifies the CPCAR
value for FTP packets when an FTP connection is set up, and also specifies the
CPCAR value for packets of IPv6 FTP, SSH, TFTP connections.
S1720GW, ● FTP, IPv6 FTP, HTTP, ● FTP, IPv6 FTP, HTTP, SSH,
S1720GWR, SSH, TFTP: 1024 TFTP: 192512 bytes
S1720GF, S1720GW- kbit/s ● IKE: 12032 bytes
E, S1720GFR-P, ● IKE: 64 kbit/s
S1720GWR-E, ● IPSEC-ESP: 60160 bytes
S5720-LI, S5720S-LI ● IPSEC-ESP: 320 kbit/s ● OSPF: 96256 bytes
● OSPF: 512 kbit/s ● TELNET: 12032 bytes
● TELNET: 64 kbit/s
S5720I-SI ● FTP, IPv6 FTP, HTTP, ● FTP, IPv6 FTP, HTTP, SSH,
SSH, TFTP: 1024 TFTP: 192512 bytes
kbit/s ● IKE: 12032 bytes
● IKE: 64 kbit/s ● IPSEC-ESP: 60160 bytes
● IPSEC-ESP: 320 kbit/s ● TELNET: 12032 bytes
● TELNET: 64 kbit/s
S1730S-H, S2730S-S, ● FTP, IPv6 FTP, HTTP, ● FTP, IPv6 FTP, HTTP,
S5735-L-I, S5735- HTTPS, SSH, TFTP: HTTPS, SSH, TFTP:
L1,S300, S5735-L, 1536kbit/s 288768bytes
S5735S-L, S5735S- ● IKE: 64kbit/s ● IKE: 12032bytes
L1, S5735S-L-M
● IPSEC-ESP: 800kbit/s ● IPSEC-ESP: 150400bytes
● OSPF: 512kbit/s ● OSPF: 96256bytes
● TELNET: 64kbit/s ● TELNET: 12032bytes
S2720-EI ● FTP, IPv6 FTP, HTTP, ● FTP, IPv6 FTP, HTTP, SSH,
SSH, TFTP: 1024 TFTP: 192512 bytes
kbit/s ● IKE: 12032 bytes
● IKE: 64 kbit/s ● IPSEC-ESP: 60160 bytes
● IPSEC-ESP: 320 kbit/s ● OSPF: 96256 bytes
● OSPF: 512 kbit/s ● TELNET: 12032 bytes
● TELNET: 64 kbit/s
Example
# Set the CIR and CBS for sending packets of FTP connections to 1000 kbit/s and
100000 bytes.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] linkup-car packet-type ftp cir 1000 cbs 100000
Function
The port type command configures the interface type. The interface type can be
Network-to-Network Interface (NNI), User-to-Network Interface (UNI), or
Enhanced Network Interface (ENI).
NOTE
Format
port type { uni | eni | nni }
Parameters
Parameter Description Value
Views
40GE interface view, GE interface view, XGE interface view, port group view, Eth-
Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Generally, protocol packets that can be sent to the CPU are controlled by an ACL.
If protocol packets are sent to the device, packets received by interfaces cannot be
differentiated.
If an interface is attacked and the user disables the device to send packets,
packets cannot be sent from other interfaces, affecting communications of the
device. If an interface is attacked and the user does not disable the device to send
packets, attack packets occupy resources and valid packets cannot be sent.
For example, OSPF is enabled on an interface and OSPF packets are sent to the
device. If a non-OSPF interface is attacked, attack packets will occupy resources
Example
# Configure GE0/0/1 as an NNI.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port type nni
14.2.51 port-type
Function
The port-type command maps interfaces to protocol types. The type can be User-
to-Network Interface (UNI), Enhanced Network Interface (ENI), or Network-to-
Network Interface (NNI).
The undo port-type command cancels the configuration.
By default, the type of interface sending protocol packets to the CPU is displayed
using the display cpu-defend configuration command.
NOTE
Format
port-type { uni | eni | nni } packet-type packet-type
undo port-type [ uni | eni | nni ] packet-type packet-type
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Generally, protocol packets that can be sent to the CPU are controlled by an ACL.
If protocol packets are sent to the device, packets received by interfaces cannot be
differentiated.
If an interface is attacked and the user disables the device to send packets,
packets cannot be sent from other interfaces, affecting communications of the
device. If an interface is attacked and the user does not disable the device to send
packets, attack packets occupy resources and valid packets cannot be sent.
The port-type command maps interfaces to protocol types. The port type
command specifies the interface types according to port locations. By using the
two commands, the interfaces send only the packets of the supported protocols.
This reduces the workload of CPU and provides ways to flexibly protect the CPU.
NOTE
Protocol packets are not supported by the UNI, ENI, or NNI interfaces. These protocol
packets are sent to the CPU for processing from any interface on the device.
Procedure
After you run the port type command to configure interface types, run the port-
type command to specify the protocols supported by the interfaces and the
method to process the protocol packets.
Precautions
If you run the port-type command multiple times, only the latest configuration
takes effect because a protocol is mapped to only one interface type.
Follow-up Procedure
This command differentiates packets from different types of interfaces so that the
attack packets are denied and valid packets are forwarded. If an attack occurs, you
can run the deny command to discard a specified type of packets. When receiving
packets of the type, the interfaces discard these packets. You can also run the car
(attack defense policy view) command to limit the rate of attack packets of a
specified type.
Example
# Configure UNI interfaces to send ARP Reply packets to the CPU.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] port-type uni packet-type arp-reply
[HUAWEI-cpu-defend-policy-test] quit
[HUAWEI] cpu-defend-policy test global
Format
reset auto-defend attack-source [ history ] [ slot slot-id ]
Parameters
Parameter Description Value
slot slot-id ● This parameter specifies the slot ID if The value must be
stacking is not configured. set according to the
● This parameter specifies the stack ID if device configuration.
stacking is enabled.
If slot slot-id is not specified, information
about attack sources is cleared.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To view the latest attack source information on the device, run the reset auto-
defend attack-source command to delete the existing attack source information,
wait for a period, and run the display auto-defend attack-source command.
To delete history attack source information, run the reset auto-defend attack-
source history command.
Precautions
Example
# Delete existing attack source information on the device.
<HUAWEI> system-view
[HUAWEI] reset auto-defend attack-source
Format
reset auto-defend attack-source trace-type { source-mac [ mac-address ] |
source-ip [ ipv4-address | ipv6 ipv6-address ] | source-portvlan [ interface
Parameters
Parameter Description Value
source-mac Clears the counter of packets The value of mac-address is
[ mac-address ] traced after attack source tracing in H-H-H format. An H
based on source MAC addresses is contains 1 to 4
configured. hexadecimal numbers.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To view information about attack sources in a specified period, run the reset auto-
defend attack-source command to clear existing information about attack
sources and run the display auto-defend attack-source command. However, the
reset auto-defend attack-source clears information about all attack sources. You
can run the reset auto-defend attack-source trace-type command to clear
information about specified attack sources.
Precautions
Example
# Clear the counter of traced packets sent from IP address 10.1.1.1.
<HUAWEI> system-view
[HUAWEI] reset auto-defend attack-source trace-type source-ip 10.1.1.1
Function
The reset auto-port-defend statistics command deletes packet statistics on port
attack defense.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S,
S5735-S-I, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S
support this command.
Format
reset auto-port-defend statistics [ all | slot slot-id ]
Parameters
Parameter Description Value
slot slot-id ● The value indicates the slot ID if stacking is The value depends
not configured. on the device
● The value indicates the stack ID when stack is configuration.
configured.
Views
All views
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Before viewing packet statistics of port attack defense in a certain period, delete
existing packet statistics, and then run the display auto-port-defend statistics
command to collect the latest statistics.
Precautions
Example
# Delete packet statistics on the interfaces of the device.
<HUAWEI> reset auto-port-defend statistics
Function
The reset cpu-defend dynamic-car history-record command clears history
records on dynamic adjustment of the default CIR value of protocol packets.
NOTE
Only the S5720I-SI, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-
L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S5731-H, S5731-S,
S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and
S6730S-S support this command.
Format
reset cpu-defend dynamic-car history-record
Parameters
None
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can run the reset cpu-defend dynamic-car history-record command to clear
the previous records and run the display cpu-defend dynamic-car history-record
command to view the history records on dynamic adjustment of the default CIR
value of protocol packets in a specified period.
Precautions
The reset cpu-defend dynamic-car history-record command clears history
records on dynamic adjustment of the default CIR value of protocol packets and
the records cannot be restored.
Example
# Clear the history records on dynamic adjustment of the default CIR value of
protocol packets.
<HUAWEI> reset cpu-defend dynamic-car history-record
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Format
reset cpu-defend host-car [ mac-address mac-address ] statistics [ slot slot-id ]
Parameters
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Before viewing the latest packet statistics in the user-level rate limiting, run this
command to clear existing packet statistics.
NOTICE
Packet statistics cannot be restored after they are deleted. Exercise caution when
you use the command.
Example
# Clear packet statistics in user-level rate limiting.
<HUAWEI> reset cpu-defend host-car statistics
Function
The reset cpu-defend statistics command clears statistics on packets sent to the
CPU.
Format
reset cpu-defend statistics [ packet-type packet-type ] [ all | slot slot-id ]
NOTE
The S1720GF, S1720GFR-P, S1720GW-E, and S1720GWR-E do not support this command.
Parameters
Parameter Description Value
slot slot-id ● This parameter specifies the slot ID if The value must be
stacking is not configured. set according to
● This parameter specifies the stack ID if the device
stacking is enabled. configuration.
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To view statistics on the packets sent to the CPU in a specified period, run the
reset cpu-defend statistics command to clear existing statistics and run the
display cpu-defend statistics command.
Precautions
The deleted packet statistics cannot be restored.
Example
# Clear statistics on BGP packets sent to the CPU.
<HUAWEI> reset cpu-defend statistics packet-type bgp slot 0
14.2.58 user-defined-flow
Function
The user-defined-flow command configures a user-defined flow.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.
Format
user-defined-flow flow-id acl acl-number
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When unknown attacks occur on the network, you can run the user-defined-flow
command to bind an ACL rule with a user-defined flow. Then you can run the car
user-defined-flow flow-id cir cir-value [ cbs cbs-value ] command to limit the
rate of flows with the specific characteristic or run the deny user-defined-flow
flow-id command to discard these flows.
Precautions
If an ACL containing the deny action is applied to the user-defined flow, packets
matching the ACL are discarded.
Example
# Specify ACL 2001 as the rule of user-defined flow 2.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] user-defined-flow 2 acl 2001
14.2.59 whitelist
Function
The whitelist command configures a whitelist.
The undo whitelist command deletes a whitelist.
By default, no whitelist is configured.
Format
whitelist whitelist-id acl acl-number
undo whitelist whitelist-id
Parameters
Parameter Description Value
Views
Attack defense policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can create a whitelist and add users with specified characteristic to the
whitelist. The device processes packets sent from users in the whitelist first. You
can set the attributes of the whitelist flexibly by defining ACL rules.
Precautions
If an ACL containing the deny action is applied to the whitelist, packets sent from
users in the whitelist are discarded.
For X series cards, the packets from users in the whitelist are preferentially sent to
the CPU at a high rate, and the display cpu-defend statistics command cannot
collect statistics on these packets.
Example
# Specify ACL 2002 as the rule of whitelist 2.
<HUAWEI> system-view
[HUAWEI] cpu-defend policy test
[HUAWEI-cpu-defend-policy-test] whitelist 2 acl 2002
Function
The display mac-forced-forwarding command displays the MFF configuration.
Format
display mac-forced-forwarding { network-port | vlan vlan-id }
Parameters
Parameter Description Value
vlan vlan-id Displays the MFF configuration in The value is an integer that
a specified VLAN. ranges from 1 to 4094.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display mac-forced-forwarding command displays the MFF network
interface information and MFF configuration in a specified VLAN.
NOTE
When the user-bind static command is executed to configure a static binding entry for a non-
DHCP user, at least ip-address and vlan vlan-id [ ce-vlan ce-vlan-id ] must be specified. In this
case, the MFF entry that has the same IP address and VLAN ID as the static binding entry can
be deleted when the static binding entry is deleted.
Example
# Display information about the MFF network interface.
<HUAWEI> display mac-forced-forwarding network-port
--------------------------------------------------------------------------------
VLAN ID Network-ports
--------------------------------------------------------------------------------
VLAN 10 GigabitEthernet0/0/1
GigabitEthernet0/0/2
GigabitEthernet0/0/3
VLAN 100 GigabitEthernet0/0/4
GigabitEthernet0/0/5
Item Description
Item Description
Function
The mac-forced-forwarding arp-trigger command enables an EAN to add or
update an MFF entry when receiving an ARP packet from a user.
By default, the EAN does not add or update an MFF entry when receiving an ARP
packet from a user.
Format
mac-forced-forwarding arp-trigger
undo mac-forced-forwarding arp-trigger
Parameters
N/A
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
In a data center, users and virtual machine (VM) servers are isolated at Layer 2 on
EAN devices using MFF. If a VM connects to another EAN and does not send DHCP
request packets after migrating between servers, the backup binding table may
exist on the new EAN device and the original EAN may still reserve the MFF entry.
This cannot ensure security of Layer 2 isolation and Layer 3 communication
between users and servers. Run the mac-forced-forwarding arp-trigger
command on the new EAN to enable it to check binding entries when receiving an
ARP packet from the user. If an entry matches the user, the EAN updates the MFF
entry. If no entry matches the user, the EAN adds a new entry. The EAN broadcasts
the ARP packet to all network interfaces when receiving the first ARP packet
regardless of whether the user entry exists.
Prerequisite
MFF has been enabled in the system view and VLAN view using the mac-forced-
forwarding enable command.
Example
# Enable the EAN to add or update the MFF entries when receiving an ARP packet
from a user in VLAN 100.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-forced-forwarding enable
[HUAWEI-vlan100] mac-forced-forwarding arp-trigger
Format
mac-forced-forwarding dumb-terminal-compatible
undo mac-forced-forwarding dumb-terminal-compatible
Parameters
None
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the MFF device connects to dumb terminals (which do not actively send
ARP request packets or send ARP request packets at a long interval), the MFF
device must transparently transmit the ARP packets from gateway to dumb
terminals after the MFF entries are aged out; otherwise, the user ARP entries on
gateway are aged out and user services are interrupted. Therefore, when the MFF
device connects to dumb terminals, the MFF device needs to be configured to
transparently transmit the ARP packets from gateway to dumb terminals.
Prerequisites
Global MFF has been enabled using the mac-forced-forwarding enable
command.
Precautions
After the MFF device is configured to transparently transmit ARP packets to dumb
terminals, run the mac-forced-forwarding static-gateway command to configure
an IP address for the static gateway; otherwise, this function does not take effect.
After this function is enabled, the MFF device searches the static binding table
when receiving ARP request packets from the gateway (configured using the user-
bind static command):
● If the outbound interface is found in the static binding table, the device
forwards the ARP request packets through this interface.
● If the outbound interface is not found in the static binding table, the device
broadcasts the ARP request packets in the VLAN. In this situation, all users in
the VLAN can receive the ARP packets.
Example
# Configure a device to transparently transmit ARP packets from gateway to
dumb terminals in VLAN 100.
<HUAWEI> system-view
[HUAWEI] mac-forced-forwarding enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-forced-forwarding enable
[HUAWEI-vlan100] mac-forced-forwarding dumb-terminal-compatible
Format
mac-forced-forwarding enable
Parameters
None
Views
System view, VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Many networks require that the gateway monitor data traffic and isolate users.
MFF isolates users at Layer 2 and connects users at Layer 3 on the same network
segment. MFF enables traffic to be forwarded through the gateway. This
implements traffic monitoring and accounting and ensures network security.
Precautions
You can run the mac-forced-forwarding enable command in the VLAN view and
perform other configurations only after you enable MFF globally in the system
view.
After MFF is disabled in the system view, other MFF configurations are
automatically deleted.
MFF cannot be enabled in a VLAN where the super VLAN or VLANIF interface is
configured.
MFF cannot be enabled in a sub-VLAN where the super VLAN and VLANIF
interface are configured.
The MFF function is implemented based on ARP proxy, whereas the EAI function is
implemented based on ARP request packet forwarding. Therefore, the two
functions conflict with each other. If you have enabled both MFF and EAI in the
same VLAN, the MFF function takes effect.
NOTE
When you enable MFF, if ACL resources are insufficient, the MFF function does not take
effect.
MFF cannot be configured in the super-VLAN.
When DHCP relay is configured in a super VLAN, MFF cannot be enabled in its sub-VLANs.
Example
# Enable MFF in VLAN 100.
<HUAWEI> system-view
[HUAWEI] mac-forced-forwarding enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-forced-forwarding enable
Function
The mac-forced-forwarding gateway-detect command enables timed gateway
detection and sets the gateway detection interval.
By default, timed gateway detection is enabled and the default gateway detection
interval is 30s.
Format
mac-forced-forwarding gateway-detect [ interval interval-time ]
Parameters
Parameter Description Value
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
On a practical network, services may be interrupted for a long time because the
MFF-enabled device cannot immediately detect the gateway MAC address change.
Timed gateway detection can solve this problem. After the detection function is
enabled (enabled by default), the MFF-enabled device scans recorded gateway
information every interval-time seconds. For each gateway recorded, the MFF-
enabled device uses user information to construct an ARP request packet and
sends it to the network interface. The MFF-enabled device then learns the
gateway MAC address from the ARP reply packet. If the gateway MAC address
changes, the MFF-enabled device immediately updates the gateway information
and broadcasts gratuitous ARP packets to users. Users can update the gateway
address.
Prerequisites
Precautions
After MFF is enabled, timed gateway detection does not take effect if no ARP
request packet is received from the user or gateway or if no user is authorized by
the DHCP server to access the network.
If a gateway fails, traffic between users will be blocked. To avoid this situation, the
device considers a gateway invalid if it does not receive a response from the
gateway after five detection attempts. The device then deletes the MAC address
entry of the invalid gateway. If the gateway detection interval is changed during a
detection, the number of detection times is accumulated.
Example
# Enable timed gateway detection in VLAN 10.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] mac-forced-forwarding enable
[HUAWEI-vlan10] mac-forced-forwarding gateway-detect
Function
The mac-forced-forwarding igmp-query discard command configures an MFF-
enabled device to discard the IGMP Query messages from users when both MFF
and IGMP snooping are enabled in a VLAN.
The undo mac-forced-forwarding igmp-query discard command disables an
MFF-enabled device from discarding the IGMP Query messages from users when
both MFF and IGMP snooping are enabled in a VLAN.
By default, an MFF-enabled device does not discard the IGMP Query messages
from users when both MFF and IGMP snooping are enabled in a VLAN.
Format
mac-forced-forwarding igmp-query discard
undo mac-forced-forwarding igmp-query discard
Parameters
None.
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
After MFF and IGMP snooping are enabled in a VLAN, the IGMP Query messages
are broadcast in the VLAN. To prevent IGMP Query message broadcasting, use the
mac-forced-forwarding igmp-query discard command.
Example
# Configure an MFF-enabled device to discard the IGMP Query messages from
users in VLAN10.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] mac-forced-forwarding igmp-query discard
By default, the user-side inbound interface on a device does not discard IPv6
packets from users.
Format
mac-forced-forwarding ipv6-isolate
undo mac-forced-forwarding ipv6-isolate
Parameters
None.
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the mac-forced-forwarding ipv6-isolate command is used, the user-side
inbound interface on a device discards the IPv6 packets from users to prevent IPv6
packets from being broadcast on the VLAN. If the device does not discard IPv6
packets, users can learn the MAC addresses of each other, which makes MFF user
isolation function invalid.
Prerequisites
The MFF function has been enabled in the system view and the VLAN view.
The VLAN contains at least one network-side interface.
Example
# Configure the user-side inbound interface on a device to discard IPv6 packets
from users.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-forced-forwarding enable
[HUAWEI-vlan100] mac-forced-forwarding ipv6-isolate
Format
mac-forced-forwarding network-port
undo mac-forced-forwarding network-port
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To make MFF in a VLAN effective, ensure that at least one network interface
belongs to the VLAN. Therefore, configure network interfaces for MFF.
The interface that is connected to the gateway and other network devices is
configured as a network interface.
Precautions
MFF has been enabled in the system view using the mac-forced-forwarding
enable command. Regardless of whether MFF is enabled in the VLAN that an
interface belongs to, the interface can be configured as a network interface.
Multiple interfaces can be configured as network interfaces.
Example
# Configure GE0/0/1 as a network interface.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] mac-forced-forwarding network-port
Info: This operation may take a few seconds. Please wait for a moment.....
By default, the network interface on an EAN does not delete the MFF entry when
receiving an ARP packet.
Format
mac-forced-forwarding network-port-arp-trigger
Parameters
N/A
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
In a data center, users and VM servers are isolated at Layer 2 on EAN devices
using MFF. If a VM connects to another EAN after migrating between servers, and
the binding table on the original EAN is not aged out, the original EAN considers
the VM an MFF host. If an attacker accesses users or sends ARP request packets
using the IP address and MAC address of the VM, the original EAN allows the
request. Attacks are not defended. After you run the mac-forced-forwarding
network-port-arp-trigger command on the original EAN, the original EAN
determines that the VM has migrated to another EAN and deletes the MFF entry
mapping the VM when receiving ARP packets from this VM.
Prerequisites
MFF has been enabled in the system view and VLAN view using the mac-forced-
forwarding enable command.
Example
# Enable the network interface on an EAN to delete an MFF entry when receiving
an ARP packet.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-forced-forwarding enable
[HUAWEI-vlan100] mac-forced-forwarding network-port-arp-trigger
Function
The mac-forced-forwarding server command configures the IP address for a
server on the MFF network.
Format
mac-forced-forwarding server server-ip &<1–10>
Parameters
Parameter Description Value
server-ip Specifies the IP address The value is in dotted decimal notation.
for a server. NOTE
This IP address must be a class A, B, or C
address. If the IP address is a class A address,
it cannot be in the format 0.x.x.x.
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
NOTE
This command is required only when the application servers and clients are in the same VLAN.
Example
# Configure IP address 192.168.1.2 for a server in VLAN 100.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-forced-forwarding enable
[HUAWEI-vlan100] mac-forced-forwarding server 192.168.1.2
Format
mac-forced-forwarding static-gateway ip-address &<1-16>
undo mac-forced-forwarding static-gateway { ip-address | all }
Parameters
Parameter Description Value
ip-address Specifies the static gateway IP The value is in dotted decimal
address in a VLAN. A maximum of notation.
16 static gateway IP addresses in a NOTE
VLAN can be specified in this This IP address must be a class A,
command. B, or C address. If the IP address is
a class A address, it cannot be in
the format 0.x.x.x.
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The static gateway is applicable when users are configured with static IP
addresses. These users cannot dynamically obtain gateway information through
DHCP packets. In this case, configure a static gateway address for each VLAN.
After you run the mac-forced-forwarding static-gateway command, the users
who are not authorized by the DHCP server can use the static gateway address to
access the network. The users who are authorized by the DHCP server can still
access the original gateway.
Prerequisites
Global MFF has been enabled using the mac-forced-forwarding enable
command.
Precautions
If a static gateway IP address is changed, users will fail to access the network. The
MAC address in the ARP table on the client belongs to the old gateway. After a
new gateway is configured, the ARP entry on client is not updated immediately
(that is, the MAC address in ARP table is not updated to the new gateway's MAC
address). Therefore, the user cannot access the network.
Example
# Configure static gateway IP address 10.1.1.10 in VLAN 100.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] mac-forced-forwarding enable
[HUAWEI-vlan100] mac-forced-forwarding static-gateway 10.1.1.10
Format
mac-forced-forwarding user-detect transparent
Parameters
None
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
In MFF networking, if the gateway performs accounting for users based on the
online duration, the gateway must know whether a user is online at a specified
moment. By default, the MFF-enabled device sends ARP reply packets in response
to ARP request packets sent from the gateway. The MFF-enabled device can
always send ARP reply packets as long as the MFF entry is not aged out. As a
result, the gateway always considers users online even if they have gone offline.
Prerequisites
Precautions
Example
# Enable transparent transmission of ARP request packets in VLAN 10.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] mac-forced-forwarding enable
[HUAWEI-vlan10] mac-forced-forwarding user-detect transparent
Function
The anti-attack abnormal enable command enables defense against malformed
packet attacks.
The undo anti-attack abnormal enable command disables defense against
malformed packet attacks.
The anti-attack abnormal disable command disables defense against malformed
packet attacks.
By default, defense against malformed packet attacks is enabled.
Format
anti-attack abnormal enable
undo anti-attack abnormal enable
anti-attack abnormal disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The malformed packet attack is to send malformed IP packets to the system. If
such an attack occurs, the system may break down when processing the
malformed IP packets. To prevent the system from breaking down and to ensure
The device detects malformed packets after defense against malformed packets is
enabled.
Precautions
You can also run the anti-attack enable command in the system view to enable
attack defense against all attack packets including malformed packets.
Example
# Enable defense against malformed packet attacks.
<HUAWEI> system-view
[HUAWEI] anti-attack abnormal enable
Function
The anti-attack enable command enables defense against all attack packets.
The undo anti-attack enable command disables defense against all attack
packets.
The anti-attack disable command disables defense against all attack packets.
Format
anti-attack enable
anti-attack disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Example
# Enable defense against all attack packets.
<HUAWEI> system-view
[HUAWEI] anti-attack enable
Function
The anti-attack fragment enable command enables defense against packet
fragment attacks.
Format
anti-attack fragment enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The device detects error packet fragments after defense against error packet
fragments is enabled. If the device detects error packet fragments, the device
limits the rate of these fragments to ensure that the device CPU works properly.
Precautions
You can also run the anti-attack enable command in the system view to enable
attack defense against all attack packets including packet fragments.
Example
# Enable defense against packet fragment attacks.
<HUAWEI> system-view
[HUAWEI] anti-attack fragment enable
Function
The anti-attack fragment car command sets the rate limit of packet fragments.
The undo anti-attack fragment car command restores the rate limit of packet
fragments.
Format
anti-attack fragment car cir cir
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After defense against packet fragment attacks is enabled, run the anti-attack
fragment car command to set the rate limit of packet fragments. If the rate of
received packet fragments exceeds the rate limit, the device discards excess packet
fragments to ensure that the device CPU works properly.
Prerequisites
Defense against packet fragment attacks has been enabled using the anti-attack
fragment enable command.
Example
# Set the rate limit of packet fragments to 8000 bit/s.
<HUAWEI> system-view
[HUAWEI] anti-attack fragment enable
[HUAWEI] anti-attack fragment car cir 8000
Function
The anti-attack icmp-flood enable command enables defense against ICMP
flood attacks.
Format
anti-attack icmp-flood enable
undo anti-attack icmp-flood enable
anti-attack icmp-flood disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an attacker sends a large number of ICMP request packets to the target host in
a short time, the target host is busy with these ICMP request packets. As a result,
the target host is overloaded and cannot process normal services. To prevent ICMP
flood attacks, run the anti-attack icmp-flood enable command to enable defense
against ICMP flood attacks.
The device detects ICMP flood attack packets after defense against ICMP flood
attacks is enabled. If the device detects ICMP flood attack packets, the device
limits the rate of these ICMP flood attack packets to ensure that the device CPU
works properly.
Precautions
You can also run the anti-attack enable command in the system view to enable
attack defense against all attack packets including ICMP flood attack packets.
Example
# Enable defense against ICMP flood attacks.
<HUAWEI> system-view
[HUAWEI] anti-attack icmp-flood enable
Function
The anti-attack icmp-flood car command sets the rate limit of ICMP flood attack
packets.
The undo anti-attack icmp-flood car command restores the default rate limit of
ICMP flood attack packets.
By default, the rate limit of ICMP flood attack packets is 155000000 bit/s.
Format
anti-attack icmp-flood car cir cir
undo anti-attack icmp-flood car
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After defense against ICMP flood attacks is enabled, run the anti-attack icmp-
flood car command to set the rate limit of ICMP flood attack packets. If the rate
of received ICMP flood attack packets exceeds the rate limit, the device discards
excess ICMP flood attack packets to ensure that its CPU works properly.
Prerequisites
Defense against ICMP flood attacks has been enabled using the anti-attack icmp-
flood enable command.
Example
# Set the rate limit of ICMP flood attack packets to 8000 bit/s.
<HUAWEI> system-view
[HUAWEI] anti-attack icmp-flood enable
[HUAWEI] anti-attack icmp-flood car cir 8000
Function
The anti-attack tcp-syn enable command enables defense against TCP SYN flood
attacks.
The undo anti-attack tcp-syn enable command disables defense against TCP
SYN flood attacks.
The anti-attack tcp-syn disable command disables defense against TCP SYN
flood attacks.
By default, defense against TCP SYN flood attacks is enabled.
Format
anti-attack tcp-syn enable
undo anti-attack tcp-syn enable
anti-attack tcp-syn disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
An attacker sends a SYN packet to a target host to initiate a TCP connection but
does not respond to the SYN-ACK sent from the target host. If the target host
receives no ACK packet from the attacker, it keeps waiting for the ACK packet. A
half-open connection is formed. The attacker keeps sending SYN packets, so many
half-open connections are set up on the target host. This wastes a large number
of resources. To prevent TCP SYN flood attacks, run the anti-attack tcp-syn
enable command to enable defense against TCP SYN flood attacks.
The device detects TCP SYN flood attack packets after defense against TCP SYN
flood attacks is enabled. If the device detects TCP SYN flood attack packets, the
device limits the rate of these TCP SYN flood attack packets to ensure that the
device CPU works properly.
Precautions
You can also run the anti-attack enable command in the system view to enable
attack defense against all attack packets including TCP SYN flood attack packets.
Example
# Enable defense against TCP SYN flood attacks.
<HUAWEI> system-view
[HUAWEI] anti-attack tcp-syn enable
Function
The anti-attack tcp-syn car command sets the rate limit at which TCP SYN
packets are received.
The undo anti-attack tcp-syn car command restores the default rate limit at
which TCP SYN packets are received.
By default, the rate limit at which TCP SYN packets are received is 155000000
bit/s.
Format
anti-attack tcp-syn car cir cir
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After defense against TCP SYN flood attacks is enabled, run the anti-attack tcp-
syn car command to set the rate limit at which TCP SYN packets are received. If
the rate of received TCP SYN attack packets exceeds the rate limit, the device
discards excess TCP SYN flood attack packets to ensure that the device CPU works
properly.
Prerequisites
Defense against TCP SYN flood attacks has been enabled using the anti-attack
tcp-syn enable command.
Example
# Set the rate limit at which TCP SYN packets are received to 8000 bit/s.
<HUAWEI> system-view
[HUAWEI] anti-attack tcp-syn enable
[HUAWEI] anti-attack tcp-syn car cir 8000
Function
The anti-attack udp-flood enable command enables defense against UDP flood
attacks.
The undo anti-attack udp-flood enable command disables defense against UDP
flood attacks.
The anti-attack udp-flood disable command disables defense against UDP flood
attacks.
By default, defense against UDP flood attacks is enabled.
Format
anti-attack udp-flood enable
undo anti-attack udp-flood enable
anti-attack udp-flood disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an attacker sends a large number of UDP packets to the target host in a short
time, the target host is busy with these UDP packets. As a result, the target host is
overloaded and cannot process normal services. To prevent UDP flood attacks, run
the anti-attack udp-flood enable command to enable defense against UDP flood
attacks.
The device detects UDP flood attack packets after defense against UDP flood
attacks is enabled. The device directly discards UDP flood attack packets.
Precautions
You can also run the anti-attack enable command in the system view to enable
attack defense against all attack packets including UDP flood attack packets.
Example
# Enable defense against UDP flood attacks.
<HUAWEI> system-view
[HUAWEI] anti-attack udp-flood enable
Function
The display anti-attack statistics command displays statistics about attack
packets of a specified type.
Format
display anti-attack statistics [ abnormal | fragment | tcp-syn | udp-flood |
icmp-flood ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display anti-attack statistics command displays statistics on attack packets
of the following types: malformed packet attack, packet fragment attack, TCP SYN
flood attack, UDP flood attack, ICMP flood attack.
Example
# Display attack defense statistics.
<HUAWEI> display anti-attack statistics
Packets Statistic Information:
-------------------------------------------------------------------------------
AntiAtkType TotalPacketNum DropPacketNum PassPacketNum
(H) (L) (H) (L) (H) (L)
-------------------------------------------------------------------------------
URPF 0 0 0 0 0 0
Abnormal 0 0 0 0 0 0
Fragment 0 0 0 0 0 0
Tcp-syn 0 58 0 0 0 58
Udp-flood 0 0 0 0 0 0
Icmp-flood 0 0 0 0 0 0
-------------------------------------------------------------------------------
Item Description
Item Description
Function
The reset anti-attack statistics command clears attack defense statistics.
Format
reset anti-attack statistics [ abnormal | fragment | tcp-syn | udp-flood | icmp-
flood ]
Parameters
Parameter Description Value
Views
All views
Default Level
2: Configuration level
Usage Guidelines
If no attack defense is specified, statistics about all types of attack defense are
cleared.
NOTICE
The cleared statistics cannot be restored. Exercise caution when you use the
command.
Example
# Clear statistics about defense against malformed packets.
<HUAWEI> reset anti-attack statistics abnormal
Format
broadcast-suppression { percent-value | cir cir-value [ cbs cbs-value ] | packets
packets-per-second }
undo broadcast-suppression
Parameters
Parameter Description Value
cbs cbs-value Specifies the committed burst The value is an integer. For the
size (CBS), which is the S1730S-H, S2730S-S, S5735-L-
maximum size of traffic that I, S5735-L1,S300, S5735-L,
can pass through. S5735S-L, S5735S-L1, S5735S-
L-M, S5735-S, S500, S5735-S-I,
and S5735S-S: The value
ranges from 10000 to 65535,
in bytes. For other models: The
value ranges from 10000 to
4294967295, in bytes. By
default, the CBS value is 188
times the CIR value.
packets packets-per-second Specifies the number of The value is an integer and the
packets transmitted per value range is as follows:
second. ● Ethernet interface: 0 to
NOTE 148810
To specify the packets parameter,
ensure that the traffic suppression ● GE interface: 0 to 1488100
mode set in the system view is ● XGE interface: 0 to
packets. 14881000
● MultiGE interface: 0 to X. X
indicates the negotiated
bandwidth
● 25GE interface: 0 to
37202500
● 40GE interface: 0 to
59524000
● 100GE interface: 0 to
148810000
● Port group: 0 to 148810000
NOTE
● For S5731-H, S5731-S,
S5731S-H, S5731S-S, S5732-H,
S6730-H, S6730S-H, S6730-S,
and S6730S-S, if the
configured value is less than
24, traffic suppression is
performed based on 24. If the
configured value is greater
than or equal to 24, traffic
suppression is performed
based on the configured value.
● When an interface is
configured with an optical
module, the value range is
determined by the rate of the
optical module. For example,
when an XGE interface is
configured with a GE optical
module, the value range is 0
to 1488100.
Views
Ethernet interface view, 40GE interface view, 100GE interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, port group
view, Eth-Trunk member interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Guidelines
The accumulating broadcast packets on the network occupy more and more
network resources. This affects normal operation of services on the network.
Precautions
If the rate limit in bit/s is set for a type of packets on an interface, the rate limit in
pps cannot be set for other types of packets on the same interface. In a similar
manner, if the rate limit in pps is set for a type of packets on an interface, the rate
limit in bit/s cannot be set for other types of packets on the same interface.
Setting the bandwidth percentage is the same as setting the rate limit in pps. Take
an interface of 1 Gbit/s as an example. If the bandwidth percentage is set to 50%,
the device converts the bandwidth percentage to rate limit in pps as follows:
(1000 x (50/100) x 1000 x 1000)/(84 x 8). In the preceding formula, 84 is the
average length of packets (including the 60-byte packet body, 20-byte frame
spacing, and 4-byte check information), and 8 is the number of bits in a byte.
NOTE
If a packet rate limit is configured for a type of packets on an interface, the percentage rate
limit for other types of packets is converted into the packet rate limit.
Example
# Set the broadcast packet rate to 100000 pps on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] broadcast-suppression packets 100000
Function
The broadcast-suppression block outbound command blocks outgoing broadcast
packets on an interface.
Format
broadcast-suppression block outbound
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Guidelines
After an interface receives a broadcast packet, it broadcasts the packet to all users
in the same VLAN. This may cause information leak. For example, if an
unauthorized user is connected to an interface in a VLAN, an unauthorized user
obtains a host's address from broadcast packets and uses the address to attack the
host. To prevent information leak, use the broadcast-suppression block
outbound command to block outgoing broadcast packets on an interface if users
connected to the interface do not need to receive broadcast packets. For example,
if users on an interface seldom change and require high security, you can use this
command on the interface.
Precautions
Example
# Block outgoing broadcast packets on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] broadcast-suppression block outbound
Function
The broadcast-suppression command sets the rate limit for broadcast packets in
a VLAN.
Format
broadcast-suppression threshold-value
undo broadcast-suppression
Parameters
Parameter Description Value
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
The accumulating broadcast packets on the network occupy more and more
network resources. This affects normal operation of services on the network.
After you run the broadcast-suppression command, the device limits the rate of
broadcast packets based on the configured rate limit. If the rate limit is exceeded,
the device discards excess broadcast packets.
Example
# Set the rate limit to 1000 kbit/s for broadcast packets in VLAN 10.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] broadcast-suppression 1000
Format
display flow-suppression interface interface-type interface-number
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command can display the traffic suppression for broadcast, unknown
multicast, known multicast, unknown unicast, and known unicast packets on the
interface, including rate limiting mode and rate limit value.
Example
# Display the traffic suppression configuration on GE0/0/1.
<HUAWEI> display flow-suppression interface gigabitethernet 0/0/1
storm type rate mode set rate value
-------------------------------------------------------------------------------
unknown-unicast percent percent: 90%
multicast percent percent: 90%
broadcast percent percent: 90%
known-unicast percent percent: 100%
known-multicast percent percent: 100%
-------------------------------------------------------------------------------
Item Description
set rate value Configured rate limit. The rate can be set by the
following commands:
● broadcast-suppression
● multicast-suppression
● unicast-suppression
● known-unicast-suppression
● known-multicast-suppression
Format
display storm-control [ interface interface-type interface-number ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command can display the storm control for broadcast, unknown multicast,
and unknown unicast packets on the interface, such as packet mode, storm
control action, and packet status.
Example
# Display information about storm control on GE0/0/1.
<HUAWEI> display storm-control interface gigabitethernet 0/0/1
PortName Type Rate Mode Action Punish- Trap Log Int Last-
(Min/Max) Status Punish-Time
--------------------------------------------------------------------------------
GE0/0/1 Multicast 1000 Pps Block Normal Off On 90 -
/2000
GE0/0/1 Broadcast 1000 Pps Block Normal Off On 90 -
/2000
GE0/0/1 Unicast 1000 Pps Block Normal Off On 90 -
/2000
Item Description
Function
The icmp rate-limit command sets the rate threshold of ICMP packets.
The undo icmp rate-limit command restores the default rate threshold of ICMP
packets.
By default, the rate limits of ICMP packets in the system and on an interface
depend on the product model. The value is 128 on the S5731-H, S5731-S, S5731S-
H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-
S, and S6730S-S, and 190 on the other models, in pps.
Format
icmp rate-limit { total | interface interface-type interface-number1 [ to
interface-number2 ] } threshold threshold-value
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Guidelines
A network often undergoes ICMP packet attacks. If a switch receives a large
number of broadcast ICMP request packets on user-side interfaces, these packets
are sent to the switch CPU for processing. Then the CPU usage becomes high,
affecting other services on the switch. You can use the icmp rate-limit command
to prevent the switch from being attacked by ICMP packets.
After the rate limit function is configured for ICMP packets on an interface, the
system automatically discards excess ICMP packets when the number of ICMP
packets sent by an interface every second exceeds the rate threshold.
Precautions
Before setting the rate threshold of ICMP packets, use the icmp rate-limit enable
command to enable the rate limit function for ICMP packets.
Example
# Set the rate threshold of ICMP packets on GE0/0/1 to GE0/0/5 to 20 pps.
<HUAWEI> system-view
[HUAWEI] icmp rate-limit interface gigabitethernet 0/0/1 to 0/0/5 threshold 20
Function
The icmp rate-limit enable command enables the traffic suppression function for
ICMP packets.
The undo icmp rate-limit enable command disables the traffic suppression
function for ICMP packets.
By default, the traffic suppression function for ICMP packets is disabled.
Format
icmp rate-limit enable
undo icmp rate-limit enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Attackers may send a large number of ICMP packets to attack a network. If the
device sends all the received ICMP packets to the CPU for processing, a lot of CPU
usage resources are occupied and other services may be abnormal. To prevent
ICMP packet attacks, you can configure the device to suppress ICMP packets.
Before configuring traffic suppression for ICMP packets on an interface, run the
undo icmp-reply fast command to disable the ICMP reply fast function.
Example
# Enable the traffic suppression function for ICMP packets.
<HUAWEI> system-view
[HUAWEI] icmp rate-limit enable
14.5.9 known-multicast-suppression
Function
The known-multicast-suppression command sets the maximum traffic volume of
known multicast packets that can pass through an interface.
The undo known-multicast-suppression allows all known multicast packets to
pass.
By default, known multicast packets are not suppressed.
NOTE
Format
known-multicast-suppression { percent-value | cir cir-value [ cbs cbs-value ] |
packets packets-per-second }
undo known-multicast-suppression
Parameters
Parameter Description Value
Views
Ethernet interface view, 40GE interface view, 100GE interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, port group
view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Setting the bandwidth percentage is the same as setting the rate limit in pps. Take
an interface of 1 Gbit/s as an example. If the bandwidth percentage is set to 50%,
the device converts the bandwidth percentage to rate limit in pps as follows:
(1000 x (50/100) x 1000 x 1000)/(84 x 8). In the preceding formula, 84 is the
average length of packets (including the 60-byte packet body, 20-byte frame
spacing, and 4-byte check information), and 8 is the number of bits in a byte.
NOTE
If a packet rate limit is configured for a type of packets on an interface, the percentage rate
limit for other types of packets is converted into the packet rate limit.
Example
# known Set the maximum known multicast packet rate to 100000 pps on
GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] known-multicast-suppression packets 100000
14.5.10 known-unicast-suppression
Function
The known-unicast-suppression command sets the maximum traffic volume of
known unicast packets that can pass through an interface.
NOTE
Format
known-unicast-suppression { percent-value | cir cir-value [ cbs cbs-value ] |
packets packets-per-second }
undo known-unicast-suppression
Parameters
Parameter Description Value
Views
Ethernet interface view, 40GE interface view, 100GE interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, port group
view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can use the known-unicast-suppression command to set the threshold of
known multicast traffic that an interface allows to pass through. When the known
unicast traffic rate exceeds the rate limit, the system discards excess known
unicast packets to control the traffic volume in a proper range.
Precautions
Setting the bandwidth percentage is the same as setting the rate limit in pps. Take
an interface of 1 Gbit/s as an example. If the bandwidth percentage is set to 50%,
the device converts the bandwidth percentage to rate limit in pps as follows:
(1000 x (50/100) x 1000 x 1000)/(84 x 8). In the preceding formula, 84 is the
average length of packets (including the 60-byte packet body, 20-byte frame
spacing, and 4-byte check information), and 8 is the number of bits in a byte.
NOTE
If a packet rate limit is configured for a type of packets on an interface, the percentage rate
limit for other types of packets is converted into the packet rate limit.
Example
#Set the maximum known unicast packet rate to 100000 pps on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] known-unicast-suppression packets 100000
Format
multicast-suppression { percent-value | cir cir-value [ cbs cbs-value ] | packets
packets-per-second }
undo multicast-suppression
Parameters
Parameter Description Value
Views
Ethernet interface view, 40GE interface view, 100GE interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, port group
view, Eth-Trunk member interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Setting the bandwidth percentage is the same as setting the rate limit in pps. Take
an interface of 1 Gbit/s as an example. If the bandwidth percentage is set to 50%,
the device converts the bandwidth percentage to rate limit in pps as follows:
(1000 x (50/100) x 1000 x 1000)/(84 x 8). In the preceding formula, 84 is the
average length of packets (including the 60-byte packet body, 20-byte frame
spacing, and 4-byte check information), and 8 is the number of bits in a byte.
NOTE
If a packet rate limit is configured for a type of packets on an interface, the percentage rate
limit for other types of packets is converted into the packet rate limit.
Example
# Set the maximum unknown multicast packet rate to 100000 pps on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] multicast-suppression packets 100000
Format
multicast-suppression block outbound
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Example
# Block outgoing unknown multicast packets onGE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] multicast-suppression block outbound
14.5.13 storm-control
Function
The storm-control command enables storm control for broadcast packets,
unknown multicast packets, and unknown unicast packets on an interface.
The undo storm-control command disables storm control.
By default, storm control is disabled on interfaces.
Format
storm-control { broadcast | multicast | unicast } min-rate min-rate-value max-
rate max-rate-value
storm-control { broadcast | multicast | unicast } min-rate cir min-rate-value-cir
max-rate cir max-rate-value-cir (Only the S5731-H, S5731-S, S5731S-H, S5731S-S,
S5732-H, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L,
S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I, S6735-S, S6720-EI,
S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.)
storm-control { broadcast | multicast | unicast } min-rate percent min-rate-
value-percent max-rate percent max-rate-value-percent (Only the S5731-H,
S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I, S5735-
L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S,
S5735-S-I, S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and
S6730S-S support this command.)
undo storm-control { broadcast | multicast | unicast | all-packets }
Parameters
Parameter Description Value
Views
Ethernet interface view, 40GE interface view, 100GE interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, port group
view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the average rate of receiving packets on an interface is greater than the
value of max-rate-value, max-rate-value-cir, or max-rate-value-percent in storm
detection, storm control is performed on the packets.
NOTE
The storm detection interval can be set using the storm-control interval command.
Storm control actions include block and shutdown, which can be configured
using the storm-control action command. If the action is block on an interface,
packets on the interface are unblocked when the rate of receiving packets on the
interface is smaller than the value of min-rate-value, min-rate-value-cir or min-
rate-value-percent; if the action is shutdown on an interface, run the undo
shutdown command to enable the interface.
Precautions
For S1720GF, S1720GW-E, S1720GFR-P, S1720GWR-E, S2720-EI, S5720I-SI, S5720-
LI, S5720S-LI, S5735S-H, S5736-S, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300,
S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, and S5735-
S-I, when detecting unicast packets, a switch does not distinguish unknown
unicast packets from known unicast packets. The packet rate detected is the sum
of the rates of unknown and known unicast packets. When the storm control
action is block, the switch blocks only the unknown unicast packets. This rule also
applies to multicast packets.
You cannot configure storm control and traffic suppression simultaneously on an
interface. For example, if you configure traffic suppression for unknown multicast
packets, unknown unicast packets, or broadcast packets (including 100% traffic
suppression for broadcast packets) on an interface, then you cannot configure
storm control for broadcast packets simultaneously on the interface.
After storm control is configured on an interface, the device does not check the
VLAN IDs of packets when performing check on the packets. That is, the device
performs storm control on all the packets no matter whether the VLANs of the
packets are allowed by the interface.
Example
# Perform storm control on broadcast packets received on GE0/0/1. In the storm
detection interval, perform storm control on packets when the rate of receiving
packets on an interface is greater than 8000 pps and forward packets when the
rate of receiving packets on an interface is smaller than 5000 pps.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] storm-control broadcast min-rate 5000 max-rate 8000
Function
The storm-control action sets the storm control action to error-down or block.
Format
storm-control action { block | error-down }
NOTE
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
You can control data packets and prevent flooding by running the storm-control
action command to configure a storm control action and the storm-control
command to set the upper and lower thresholds.
In a storm detection interval, when the average rate of receiving broadcast
packets, unknown multicast packets, and unknown unicast packets is greater than
the value of the specified upper threshold, packets are blocked or the interface is
shut down.
If the storm control action on an interface is block, the interface is restored when
the traffic falls below the lower threshold.
If the storm control action is error-down, the interface can be recovered using
either of the following methods:
● Manual recovery (after an Error-Down event occurs):
If a few interfaces need to be recovered, run the shutdown and undo
shutdown commands in the interface view. Alternatively, run the restart
command in the interface view to restart the interfaces.
● Automatic recovery (before an Error-Down event occurs):
If a large number of interfaces need to be recovered, manual recovery is time
consuming and some interfaces may be omitted. To avoid this problem, run
the error-down auto-recovery cause storm-control interval interval-value
command in the system view to enable automatic interface recovery and set
the recovery delay time. Run the display error-down recovery command to
view information about automatic interface recovery.
NOTE
This method does not take effect on interfaces that are already in Error-Down state. It
is effective only on interfaces that enter the Error-Down state after this configuration
is complete.
Precautions
For S1720GF, S1720GW-E, S1720GFR-P, S1720GWR-E, S2720-EI, S5720I-SI, S5720-
LI, S5720S-LI, S5735S-H, S5736-S, S1730S-H, S2730S-S, S5735-L-I, S5735-L1,S300,
S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, and S5735-
S-I, when detecting unicast packets, a switch does not distinguish unknown
unicast packets from known unicast packets. The packet rate detected is the sum
of the rates of unknown and known unicast packets. When the storm control
action is block, the switch blocks only the unknown unicast packets. This rule also
applies to multicast packets.
Example
# Configure the storm control action is block on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] storm-control action block
Format
storm-control enable { log | trap }
undo storm-control enable { log | trap }
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
After storm control is configured, the switch monitors the broadcast, unknown
multicast, and unknown unicast packets received on an interface. When the
packet rate within a detection interval exceeds the upper limit, the switch executes
the storm control action (block packets or shut down the interface) on the
interface. This may affect services. You can configure the log or trap for storm
control so that the administrator can quickly take actions to protect the switch.
● After the logging function is enabled for storm control, the storm control log
information is recorded in the STORMCTRL log of the SECE module.
● After the trap function is enabled for storm control, the trap is
SECE_1.3.6.1.4.1.2011.5.25.32.4.1.14.1 hwXQoSStormControlTrap.
Example
# Enable the trap reporting function during storm control on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] storm-control broadcast min-rate 3000 max-rate 5000
[HUAWEI-GigabitEthernet0/0/1] storm-control action block
[HUAWEI-GigabitEthernet0/0/1] storm-control enable trap
Format
storm-control interval interval-value
undo storm-control interval
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Before using the storm-control interval command to set the storm detection
interval, run the storm-control command in the interface view to configure storm
control. Otherwise, the storm detection interval does not take effect.
Example
# Configure storm control and set the storm detection interval to 10 seconds on
GE0/0/1. Block broadcast packets when the rate of receiving broadcast packets is
greater than 5000 pps and forward the packets when the rate of receiving
broadcast packets is smaller than 3000 pps in 10 seconds.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] storm-control broadcast min-rate 3000 max-rate 5000
[HUAWEI-GigabitEthernet0/0/1] storm-control action block
[HUAWEI-GigabitEthernet0/0/1] storm-control interval 10
NOTE
Format
storm-control whitelist protocol { arp-request | bpdu | dhcp | igmp | rip }*
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To free specified protocol packets from traffic suppression and storm control, you
can run the storm-control whitelist protocol command to add these packets to
the traffic suppression and storm control whitelist.
Precautions
Example
# Add BPDU packets to the traffic suppression and storm control whitelist.
<HUAWEI> system-view
[HUAWEI] storm-control whitelist protocol bpdu
Function
The suppression mode command sets the global traffic suppression mode.
The undo suppression mode command restores the default traffic suppression
mode.
NOTE
Format
suppression mode { by-packets | by-bits }
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
If the packets mode has been set on an interface and the bits mode is set in the
system view, the device automatically converts the traffic rate values and
suppresses traffic based on bits. For example, if the maximum rate of broadcast
packets allowed by a GE interface is set to 1000 pps, the device converts the traffic
rate value as follows: 1000 x 84 x 8 = 672000 bits = 672 Kbit. In the preceding
formula, 84 is the average length of packets (including the 60-byte packet body,
20-byte frame spacing, and 4-byte check information), and 8 is the number of bits
in a byte.
If the traffic suppression mode set in the system view is packets, the cir
parameter cannot be specified when you set the maximum traffic rate on an
interface.
If the traffic suppression mode set in the system view is bits, the packets
parameter cannot be specified when you set the maximum traffic rate on an
interface.
Example
# Set the traffic suppression mode to by-bits.
<HUAWEI> system-view
[HUAWEI] suppression mode by-bits
Warning: All Interface supression mode will be changed. Continue? [Y/N]:y
Format
unicast-suppression { percent-value | cir cir-value [ cbs cbs-value ] | packets
packets-per-second }
undo unicast-suppression
Parameters
Parameter Description Value
Views
Ethernet interface view, 40GE interface view, 100GE interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, port group
view, Eth-Trunk member interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Setting the bandwidth percentage is the same as setting the rate limit in pps. Take
an interface of 1 Gbit/s as an example. If the bandwidth percentage is set to 50%,
the device converts the bandwidth percentage to rate limit in pps as follows:
(1000 x (50/100) x 1000 x 1000)/(84 x 8). In the preceding formula, 84 is the
average length of packets (including the 60-byte packet body, 20-byte frame
spacing, and 4-byte check information), and 8 is the number of bits in a byte.
NOTE
If a packet rate limit is configured for a type of packets on an interface, the percentage rate
limit for other types of packets is converted into the packet rate limit.
Example
#Set the maximum unknown unicast packet rate to 100000 pps on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] unicast-suppression packets 100000
Function
The unicast-suppression block outbound command configures an interface to
block outgoing unknown unicast packets.
Format
unicast-suppression block outbound
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Example
# Block outgoing multicast packets on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] unicast-suppression block outbound
The undo arp anti-attack check user-bind alarm enable command disables the
alarm function for ARP packets discarded by DAI.
By default, the alarm function for ARP packets discarded by DAI is disabled.
Format
arp anti-attack check user-bind alarm enable
Parameters
None
Views
Ethernet interface view, GE interface view, 40GE interface view, XGE interface view,
25GE interface view, 100GE interface view, MultiGE interface view, port group
view, Eth-Trunk interface view, VLAN view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DAI is enabled, if you want to receive an alarm when a large number of ARP
packets are discarded by DAI, you can run the arp anti-attack check user-bind
alarm enable command. After the alarm function is enabled, the device sends an
alarm when the number of discarded ARP packets exceeds the threshold.
Prerequisites
DAI has been enabled using the arp anti-attack check user-bind enable
command in the corresponding view.
Follow-up Procedure
The alarm threshold is set by the arp anti-attack check user-bind alarm
threshold command.
Precautions
If you run this command in multiple views, the configuration will takes effect in
the following sequence: BD view > interface view > VLAN view.
Example
# Enable the alarm function for ARP packets discarded by DAI on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack check user-bind enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack check user-bind alarm enable
Format
arp anti-attack check user-bind alarm threshold threshold
undo arp anti-attack check user-bind alarm threshold
Parameters
Parameter Description Value
threshold Specifies the alarm threshold for The value is an integer that
the ARP packets discarded by DAI. ranges from 1 to 1000.
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, 40GE interface view, 100GE interface view, MultiGE interface view,
port group view, Eth-Trunk interface view, VLAN view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can use this command to set the alarm threshold for ARP packets discarded
by DAI. After the alarm threshold is set, the device sends an alarm when the
number of ARP packets discarded by DAI exceeds this threshold.
Prerequisites
DAI has been enabled using the arp anti-attack check user-bind enable
command in the corresponding view, and the alarm function for ARP packets
discarded by DAI has been enabled using the arp anti-attack check user-bind
alarm enable command in the corresopinding view.
Precautions
The arp anti-attack check user-bind alarm threshold command takes effect in
the system view only when DAI and the alarm function for ARP packets discarded
by DAI are enabled in the interface, BD, or VLAN view. The global alarm threshold
takes effect on all nterfaces, BDs, or VLANs enabled with the two functions.
The priority configured in the nterface, BD, or VLAN view is higher than that
configured globally. If the alarm threshold on an interface is not configured, the
global alarm threshold is used.
Example
# Set the alarm threshold for ARP packets discarded by DAI on GE0/0/1 to 200.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack check user-bind enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack check user-bind alarm enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack check user-bind alarm threshold 200
Function
The arp anti-attack check user-bind check-item command configures check
items for ARP packet check based on binding entries on an interface.
The undo arp anti-attack check user-bind check-item command restores the
default check items.
By default, the check items consist of IP address, MAC address, and VLAN ID.
Format
arp anti-attack check user-bind check-item { ip-address | mac-address | vlan } *
Parameters
Parameter Description Value
vlan Indicates that the device checks VLAN IDs in ARP packets. -
Views
Ethernet interface view, GE interface view, 40GE interface view, XGE interface view,
25GE interface view, 100GE interface view, MultiGE interface view, port group
view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a device receives an ARP packet, it compares the source IP address, source
MAC address, and VLAN ID of the ARP packet with binding entries. If the ARP
packet matches a binding entry, the device considers the ARP packet valid and
allows the packet to pass through. If the ARP packet matches no binding entry,
the device considers the ARP packet invalid and discards the packet.
To allow some special ARP packets that match only one or two items in binding
entries to pass through, use the arp anti-attack check user-bind check-item
command to configure the device to check ARP packets according to one or two
specified items in binding entries.
Prerequisites
DAI has been enabled on the interface using the arp anti-attack check user-bind
enable command.
Precautions
Check items configured for ARP packet check based on binding entries do not take
effect on hosts that are configured with static binding entries. These hosts check
ARP packets based on all items in static binding entries.
Example
# Configure GE0/0/1 to check IP addresses in ARP packets.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
Format
arp anti-attack check user-bind check-item { ip-address | mac-address |
interface } *
undo arp anti-attack check user-bind check-item
Parameters
Parameter Description Value
Views
VLAN view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a device receives an ARP packet, it compares the source IP address, source
MAC address, and interface number of the ARP packet with binding entries. If the
ARP packet matches a binding entry, the device considers the ARP packet valid
and allows the packet to pass through. If the ARP packet matches no binding
entry, the device considers the ARP packet invalid and discards the packet.
To allow some special ARP packets that match only one or two items in binding
entries to pass through, configure the device to check ARP packets according to
one or two specified items in binding entries.
Prerequisites
DAI has been enabled in the VLAN or BD using the arp anti-attack check user-
bind enable command.
Precautions
Check items configured for ARP packet check based on binding entries do not take
effect on hosts that are configured with static binding entries. These hosts check
ARP packets based on all items in static binding entries.
Example
# Configure the device to check IP addresses in ARP packets from VLAN 100.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] arp anti-attack check user-bind enable
[HUAWEI-vlan100] arp anti-attack check user-bind check-item ip-address
Function
The arp anti-attack check user-bind enable command enables dynamic ARP
inspection (DAI) for an interface, BD, or VLAN to check ARP packets against
binding entries.
The undo arp anti-attack check user-bind enable command disables DAI for an
interface, BD, or VLAN.
Format
arp anti-attack check user-bind enable
Parameters
None
Views
Ethernet interface view, GE interface view, 40GE interface view, XGE interface view,
25GE interface view, 100GE interface view, MultiGE interface view, port group
view, Eth-Trunk interface view, BD view, VLAN view
NOTE
DAI can be enabled in the BD view only for the S5731-H, S5731S-H, S5732-H, S5731-S,
S5731S-S, S6730-H, S6730S-H, S6730-S, and S6730S-S.
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To defend against MITM attacks and prevent authorized users' data from being
intercepted, run the arp anti-attack check user-bind enable command to enable
DAI. When a device receives an ARP packet, it compares the source IP address,
source MAC address, interface number, BD, and VLAN ID of the ARP packet with
binding entries. If the ARP packet matches a binding entry, the device considers
the ARP packet valid and allows the packet to pass through. If the ARP packet
matches no binding entry, the device considers the ARP packet invalid and discards
the packet.
DAI can be enabled in the interface view, BD view, or VLAN view. When DAI is
enabled in the interface view, the device checks all ARP packets received on the
interface against binding entries. When DAI is enabled in the VLAN view or BD
view, the device checks ARP packets received on interfaces belong to the VLAN or
BD based on binding entries.
Follow-up Procedure
Run the arp anti-attack check user-bind check-item (interface view) or arp
anti-attack check user-bind check-item (VLAN or BD view) command to
configure check items for ARP packet check based on binding entries.
Precautions
When resources are sufficient, DAI can be enabled in a maximum of 400 VLANs.
After DAI is configured, the function of disabling the VLANIF interface from
sending ARP packets destined for other devices to the CPU is ineffective on the
VLANIF interface.
Example
# Enable DAI on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack check user-bind enable
Function
The arp anti-attack entry-check enable command enables ARP entry fixing.
The undo arp anti-attack entry-check enable command disables ARP entry
fixing.
Format
arp anti-attack entry-check { fixed-mac | fixed-all | send-ack } enable
Parameters
Parameter Description Value
fixed-mac Indicates ARP entry fixing in fixed-mac mode. -
Views
System view, VLANIF interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To defend against ARP address spoofing attacks, enable ARP entry fixing. The
fixed-mac, fixed-all, and send-ack modes are applicable to different scenarios
and are mutually exclusive:
● The fixed-mac mode applies to networks where user MAC addresses are
unchanged but user access locations often change. When a user connects to a
different interface on the device, the device updates interface information in
the ARP entry of the user timely.
● The fixed-all mode applies to networks where user MAC addresses and user
access locations are fixed.
● The send-ack mode applies to networks where user MAC addresses and user
access locations often change.
Precautions
After ARP entry fixing is enabled, the function that updates ARP entries when
MAC address entries change (configured by the mac-address update arp
command) becomes invalid.
In send-ack mode, the device can record a maximum of 100 ARP entries in the
ARP Request packets intended to trigger ARP entry modification.
If you run the arp anti-attack entry-check enable command in the system view,
ARP entry fixing is enabled on all interfaces. If you run the arp anti-attack entry-
check enable command in the interface view, ARP entry fixing is enabled on the
specified interface.
If ARP entry fixing is enabled globally and on a VLANIF interface simultaneously,
the configuration on the VLANIF interface takes precedence over the global
configuration.
Example
# Enable ARP entry fixing and specify the fixed-mac mode.
<HUAWEI> system-view
[HUAWEI] arp anti-attack entry-check fixed-mac enable
Format
arp anti-attack gateway-duplicate enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an attacker forges the gateway address to send ARP packets with the source IP
address being the gateway IP address on the LAN where the gateway is located,
ARP entries on hosts in the LAN record the incorrect gateway address. As a result,
all traffic from user hosts to the gateway is sent to the attacker and the attacker
can intercept user data, causing network access failures of these hosts.
To defend against attacks from bogus gateways, run the arp anti-attack
gateway-duplicate enable command to enable ARP gateway anti-collision on
gateways to which user hosts directly connect. A gateway considers that an ARP
gateway collision occurs when it receives an ARP packet meeting either of the
following conditions:
● The source IP address of the ARP packet is the same as the IP address of the
VLANIF interface matching the inbound interface of the packet.
● The source IP address of the ARP packet is the virtual IP address of the
inbound interface, but the source MAC address is not the VRRP virtual MAC
address.
The gateway generates an ARP anti-collision entry and discards the received ARP
packets with the same source MAC address and VLAN ID as those of the ARP
packet within a specified period of time. This function prevents ARP packets with a
bogus gateway address from being broadcast in a VLAN.
Precautions
The device supports a maximum of 100 ARP anti-collision entries. When the
maximum number is exceeded, the gateway cannot prevent new ARP gateway
collision attacks.
After DAI is configured, the function of disabling the VLANIF interface from
sending ARP packets destined for other devices to the CPU is ineffective on the
VLANIF interface.
Example
# Enable ARP gateway anti-collision.
<HUAWEI> system-view
[HUAWEI] arp anti-attack gateway-duplicate enable
Function
The arp anti-attack log-trap-timer command sets the interval for sending ARP
alarms.
The undo arp anti-attack log-trap-timer command restores the default setting.
The default interval for sending alarms is 0, indicating that the device does not
send ARP alarms.
Format
arp anti-attack log-trap-timer time
undo arp anti-attack log-trap-timer
Parameters
Parameter Description Value
time Specifies the interval for The value is an integer that ranges
sending ARP alarms. from 0 to 1200, in seconds.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After rate limiting on ARP packets based on source IP addresses is enabled, if the
number of ARP packets the device receives per second exceeds the limit, the
device discards the excess ARP packets. The device considers the excess ARP
packets as potential attacks. The device sends ARP alarms indicating potential
attacks to the NMS. To avoid excessive alarms when ARP attacks occur, reduce the
alarm quantity by setting a proper interval for sending alarms.
Precautions
In the insecure environment, you are advised to extend the interval for sending
ARP alarms. This prevents excessive ARP alarms. In the secure environment, you
are advised to shorten the interval for sending ARP alarms. This facilitates fault
rectification in real time.
After the interval is set, the device discards alarms generates in this interval;
therefore, some faults cannot be rectified in real time.
The command takes effect only on the alarm for ARP rate limit based on source IP
addresses (corresponding to arp speed-limit source-ip). The other ARP alarms are
generated at a fixed interval of 5 seconds.
Example
# Set the interval for sending ARP alarms to 20 seconds.
<HUAWEI> system-view
[HUAWEI] arp anti-attack log-trap-timer 20
Function
The arp anti-attack packet-check command enables ARP packet validity check
and specifies check items.
The undo arp anti-attack packet-check command disables ARP packet validity
check.
By default, ARP packet validity check is disabled.
Format
arp anti-attack packet-check { ip | dst-mac | sender-mac } *
Parameters
Parameter Description Value
ip Indicates ARP packet validity check based on the IP address. -
dst-mac Indicates ARP packet validity check based on the destination -
MAC address.
sender-mac Indicates ARP packet validity check based on the source -
MAC address.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To avoid ARP attacks, you can use the arp anti-attack packet-check command to
enable ARP packet validity check on an access device or a gateway to filters out
ARP packets with invalid IP addresses or MAC addresses. The device checks validity
of an ARP packet based on each or any combination of the following items:
● Source and destination IP addresses: The device checks the source and
destination IP addresses in an ARP packet. If the source or destination IP
address is all 0s, all 1s, or a multicast IP address, the device discards the
packet as an invalid packet. The device checks both the source and
destination IP addresses in an ARP Reply packet but checks only the source IP
address in an ARP Request packet.
● Source MAC address: The device compares the source MAC address in an ARP
packet with that in the Ethernet frame header. If they are the same, the
packet is valid. If they are different, the device discards the packet.
● Destination MAC address: The device compares the destination MAC address
in an ARP packet with that in the Ethernet frame header. If they are the same,
the packet is valid. If they are different, the device discards the packet.
Precautions
Generally, packets with different source and destination MAC addresses in the ARP
packet and Ethernet frame header are allowed by the ARP protocol. When an
attack occurs, capture and analyze packets. If the attack is initiated by using
inconsistent source or destination MAC addresses in the ARP packet and Ethernet
frame header, enable ARP packet validity check based on the source or destination
MAC address.
If you run the arp anti-attack packet-check sender-mac command multiple
times, all the check items specified in these commands take effect.
Example
# Enable ARP packet validity check and configures the device to check the source
MAC address in an ARP packet.
<HUAWEI> system-view
[HUAWEI] arp anti-attack packet-check sender-mac
Format
System view, VLAN view
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, port group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After rate limit on ARP packets is enabled, run the arp anti-attack rate-limit
command to set the maximum rate and rate limiting duration of ARP packets
globally, in a VLAN, or on an interface. In the rate limiting duration, if the number
of received ARP packets exceeds the limit, the device discards the excess ARP
packets.
If the parameter block-timer timer is specified, the device discards all ARP packets
received in the duration specified by timer.
Prerequisites
Rate limit on ARP packets has been enabled globally, in a VLAN, or on an interface
using the arp anti-attack rate-limit enable command.
Precautions
If the maximum rate and rate limiting duration are configured in the system view,
VLAN view, and interface view at the same time, the device uses the
configurations in the interface view, VLAN view, and system view in order.
NOTE
The arp anti-attack rate-limit command takes effect only on ARP packets sent to the CPU
for processing in none-block mode, and does not affect ARP packet forwarding by the chip.
In block mode, the device discards subsequent ARP packets on an interface only when the
number of ARP packets sent to the CPU exceeds the limit.
Example
# Configure Layer 2 interface GE0/0/1 to allow 200 ARP packets to pass through
in 10 seconds, and configure GE0/0/1 to discard all ARP packets in 60 seconds
when the number of ARP packets exceeds the limit.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit packet 200 interval 10 block-timer 60
# Configure Layer 3 interface GE0/0/1 to allow 200 ARP packets to pass through
in 10 seconds, and configure GE0/0/1 to discard all ARP packets in 60 seconds
when the number of ARP packets exceeds the limit.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit packet 200 interval 10 block-timer 60
Function
The arp anti-attack rate-limit alarm enable command enables the alarm
function for ARP packets discarded when the rate of ARP packets exceeds the
limit.
The undo arp anti-attack rate-limit alarm enable command disables the alarm
function for ARP packets discarded when the rate of ARP packets exceeds the
limit.
By default, the alarm function for ARP packets discarded when the rate of ARP
packets exceeds the limit is disabled.
Format
arp anti-attack rate-limit alarm enable
Parameters
None
Views
System view, VLAN view, Ethernet interface view, GE interface view, 40GE interface
view, XGE interface view, 25GE interface view, 100GE interface view, MultiGE
interface view, port group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After rate limit on ARP packets is enabled, if you want the device to generate
alarms for excessive discarded ARP packets, run the arp anti-attack rate-limit
alarm enable command. When the number of discarded ARP packets exceeds the
alarm threshold, the device generates an alarm.
You can set the alarm threshold using the arp anti-attack rate-limit alarm
threshold command.
Prerequisites
Rate limit on ARP packets has been enabled using the arp anti-attack rate-limit
enable command.
Example
# Enable rate limit on ARP packets globally and enable the alarm function.
<HUAWEI> system-view
[HUAWEI] arp anti-attack rate-limit enable
[HUAWEI] arp anti-attack rate-limit alarm enable
# Enable rate limit for the ARP packets on Layer 2 interface GE0/0/1 and enable
the alarm function.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit alarm enable
# Enable rate limit for the ARP packets on Layer 3 interface GE0/0/1 and enable
the alarm function.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit alarm enable
Function
The arp anti-attack rate-limit alarm threshold command sets the alarm
threshold of ARP packets discarded when the rate of ARP packets exceeds the
limit.
The undo arp anti-attack rate-limit alarm threshold command restores the
default alarm threshold.
By default, the alarm threshold of ARP packets discarded when the rate of ARP
packets exceeds the limit is 100.
Format
arp anti-attack rate-limit alarm threshold threshold
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, 40GE interface
view, XGE interface view, 25GE interface view, 100GE interface view, MultiGE
interface view, port group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can use the arp anti-attack rate-limit alarm threshold command to set the
alarm threshold. When the number of discarded ARP packets exceeds the alarm
threshold, the device generates an alarm.
Prerequisites
Rate limit on ARP packets has been enabled using the arp anti-attack rate-limit
enable command, and the alarm function has been enabled using the arp anti-
attack rate-limit alarm enable command.
Example
# Enable rate limit on ARP packets globally, enable the alarm function, and set the
alarm threshold to 50.
<HUAWEI> system-view
[HUAWEI] arp anti-attack rate-limit enable
[HUAWEI] arp anti-attack rate-limit alarm enable
[HUAWEI] arp anti-attack rate-limit alarm threshold 50
# Enable rate limit for the ARP packets on Layer 2 interface GE0/0/1, enable the
alarm function, and set the alarm threshold to 50.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit alarm enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit alarm threshold 50
# Enable rate limit for the ARP packets on Layer 3 interface GE0/0/1, enable the
alarm function, and set the alarm threshold to 50.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit alarm enable
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit alarm threshold 50
Format
arp anti-attack rate-limit enable
undo arp anti-attack rate-limit enable
Parameters
None
Views
System view, VLAN view, Ethernet interface view, GE interface view, 40GE interface
view, XGE interface view, 25GE interface view, 100GE interface view, MultiGE
interface view, port group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
The device has no sufficient CPU resource to process other services when
processing a large number of ARP packets. To protect CPU resources of the device,
limit the rate of ARP packets.
You can run the arp anti-attack rate-limit enable command to enable rate limit
on ARP packets. When the rate of ARP packets exceeds the limit, excess ARP
packets are discarded. To set the rate limit and rate limiting duration of ARP
packets, run the arp anti-attack rate-limit command.
After the optimized ARP reply function (disabled by default) is enabled using the
undo arp optimized-reply disable command, rate limiting on ARP packets
globally, in a VLAN, or on an Interface does not take effect.
Example
# Enable rate limit on ARP packets globally.
<HUAWEI> system-view
[HUAWEI] arp anti-attack rate-limit enable
# Enable rate limit for the ARP packets on Layer 2 interface GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
# Enable rate limit for the ARP packets on Layer 3 interface GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] arp anti-attack rate-limit enable
Format
arp trust source ip-address
undo arp trust source { ip-address | all }
Parameters
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an attacker poses as a gateway to send ARP packets, other users on the network
consider the attacker to be a gateway, causing a communication interruption
between authorized users and gateway. This situation will also happen if a user
incorrectly sets the host IP address as the gateway address. To prevent such bogus
gateway attacks, configure ARP gateway protection on the device's interfaces
connected to the gateway. When the ARP packets from a gateway address reach a
device:
● The interfaces with gateway protection enabled can receive and forward the
ARP packets.
● The interfaces without gateway protection enabled discard the ARP packets.
Precautions
Example
# Enable ARP gateway protection on GE0/0/1 and set the protected gateway IP
address to 10.10.10.1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp trust source 10.10.10.1
Format
arp gratuitous-arp send enable
undo arp gratuitous-arp send enable
Parameters
None
Views
System view, VLANIF interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an attacker forges the gateway address to send ARP packets to other user hosts,
ARP entries on the hosts record the incorrect gateway address. As a result, the
gateway cannot receive data sent from the hosts. You can enable gratuitous ARP
packet sending on the gateway. Then the gateway sends gratuitous ARP packets
at intervals to update the ARP entries of authorized users so that the ARP entries
contain the correct MAC address of the gateway.
By default, the device sends a gratuitous ARP packet every 60 seconds after this
function is enabled. You can also set the interval using the arp gratuitous-arp
send interval command.
Precautions
After you run the arp gratuitous-arp send enable command in the system view,
gratuitous ARP packet sending is enabled on all VLANIF interfaces.
After you run the undo arp gratuitous-arp send enable command in the system
view, gratuitous ARP packet sending is disabled on all VLANIF interfaces.
Example
# Enable gratuitous ARP packet sending on VLANIF 10.
<HUAWEI> system-view
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] arp gratuitous-arp send enable
Format
arp gratuitous-arp send interval interval-time
undo arp gratuitous-arp send interval
Parameters
Parameter Description Value
Views
System view, VLANIF interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, the device sends a gratuitous ARP packet every 60 seconds after
gratuitous ARP sending is enabled. You can set the interval for sending gratuitous
ARP packets using the arp gratuitous-arp send interval command.
If you set the interval in the system view, the configuration takes effect on all
VLANIF interfaces. If you set the interval in both the system view and VLANIF
interface view, the configuration on the VLANIF interface takes precedence over
the global configuration.
Prerequisites
Gratuitous ARP packet sending has been enabled using the arp gratuitous-arp
send enable command.
Example
# Set the interval for sending gratuitous ARP packets to 100 seconds on VLANIF
10.
<HUAWEI> system-view
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] arp gratuitous-arp send enable
[HUAWEI-Vlanif10] arp gratuitous-arp send interval 100
Format
arp learning dhcp-trigger
undo arp learning dhcp-trigger
Parameters
None
Views
VLANIF interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When many DHCP users connect to a network device, the device needs to learn
and maintain many ARP entries. This affects device performance.
To address this issue, you can configure ARP learning triggered by DHCP on the
gateway. When the DHCP server assigns an IP address to a user, the device
generates a DHCP snooping binding table and generates an ARP entry for the user
based on the binding table. When DHCP snooping binding entries are deleted, ARP
entries are also deleted.
Prerequisites
● DHCP has been enabled globally using the dhcp enable command in the
system view.
● DHCP snooping has been enabled globally using the dhcp snooping enable
command in the system view.
● DHCP snooping has been enabled using the dhcp snooping enable command
in the view of the interface or VLAN through which a user goes online.
Precautions
When both VRRP and DHCP relay are configured on the network, neither the dhcp
snooping enable command nor the arp learning dhcp-trigger command can be
configured on the VRRP master and backup devices.
The VLANIF interface must be assigned an IP address on the same network
segment as that of a user.
DHCP snooping for wireless users is deployed on APs. The AC enabled with DHCP
snooping does not process DHCP packets of wireless users. Therefore, ARP
learning takes effect only for wired users.
Example
# Enable ARP learning triggered by DHCP on VLANIF 100 and assign an IP address
on the same network segment as that of a user.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] dhcp snooping enable
[HUAWEI] quit
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.1.0.1 255.255.255.0
[HUAWEI-Vlanif100] arp learning dhcp-trigger
Format
arp learning disable
undo arp learning disable
Parameters
None
Views
VLANIF interface view, VBDIF interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To ensure security and facilitate management, you can enable an interface to
learn or disable an interface from learning dynamic ARP entries. You can also use
the arp learning strict or arp learning strict commands to strictly control ARP
entry learning on an interface.
Precautions
If an interface is disabled from learning ARP entries, the network will be
interrupted.
If an interface has learned some dynamic ARP entries, the system does not delete
these entries after the interface is disabled from learning dynamic ARP entries. You
can manually delete or reserve these learned dynamic ARP entries (deleted by the
reset arp command).
Example
# Disable VLANIF10 from learning dynamic ARP entries.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] quit
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] arp learning disable
Function
The arp learning strict command enables strict ARP learning on the interface.
The undo arp learning strict command restores the global configuration on the
interface.
By default, strict ARP learning is disabled on the interface.
Format
arp learning strict { force-enable | force-disable | trust }
undo arp learning strict
Parameters
Parameter Description Value
Views
Interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To avoid the preceding problems, enable strict ARP learning on the gateway. This
function indicates that the device learns only ARP entries for ARP Reply packets in
response to ARP Request packets sent by itself, but does not allow the device to
learn the ARP entries for the ARP packets received from other devices. In this way,
the device can defend against most ARP attacks.
Prerequisites
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3
modes.
Precautions
When ARP attacks occur on many interfaces of the device, you can run the arp
learning strict command to enable strict ARP learning globally.
Example
# Enable strict ARP learning on VLANIF 100.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] quit
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] arp learning strict force-enable
Function
The arp learning strict command enables strict ARP learning.
The undo arp learning strict command disables strict ARP learning.
By default, strict ARP learning is disabled.
Format
arp learning strict
undo arp learning strict
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If many user hosts send a large number of ARP packets to a device
simultaneously, or attackers send bogus ARP packets to the device, the following
problems occur:
● Processing ARP packets consumes many CPU resources. The device learns
many invalid ARP entries, which exhaust ARP entry resources and prevent the
device from learning ARP entries for ARP packets from authorized users.
Consequently, communication of authorized users is interrupted.
● After receiving bogus ARP packets, the device incorrectly modifies the ARP
entries. As a result, authorized users cannot communicate with each other.
To avoid the preceding problems, enable strict ARP learning on the gateway. This
function indicates that the device learns only ARP entries for ARP Reply packets in
response to ARP Request packets sent by itself. In this way, the device can defend
against most ARP attacks.
Precautions
The configuration on an interface takes precedence over the global configuration.
Example
# Enable strict ARP learning.
<HUAWEI> system-view
[HUAWEI] arp learning strict
Format
arp optimized-passby enable
undo arp optimized-passby enable
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Parameters
None
Views
VLANIF interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an interface receives a large number of ARP packets whose destination IP
addresses are different from the IP address of this interface and sends these ARP
packets to the CPU for processing, the CPU usage is high and the CPU cannot
process services properly.
To prevent this issue, you can configure the device to directly forward ARP packets
destined for other devices without sending them to the CPU. This improves the
device's capability of defending against ARP flood attacks.
Precautions
If any of the following configurations is performed, the configuration of disabling
the device from sending ARP packets destined for other devices to the CPU does
not take effect on a VLANIF interface:
● Run the arp anti-attack gateway-duplicate enable to enable ARP gateway
anti-collision.
● Run the arp ip-conflict-detect enable command to enable IP address conflict
detection.
● Run the arp anti-attack check user-bind enable command to enable the
dynamic ARP inspection (DAI) function.
● Run the dhcp snooping arp security enable command to enable the egress
ARP inspection (EAI) function.
● Run the arp over-vpls enable command to enable proxy ARP on a VPLS
network.
● Run the arp-proxy enable command to enable routed proxy ARP.
● Run the arp-proxy inner-sub-vlan-proxy enable command to enable intra-
VLAN proxy ARP.
● Run the arp-proxy inter-sub-vlan-proxy enable command to enable inter-
VLAN proxy ARP.
● Perform an NAC-related configuration. For details, see the User Access and
Authentication Configuration Guide.
Example
# Configure the device to send ARP packets destined for other devices to the CPU.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] undo arp optimized-passby enable
Format
arp optimized-reply disable
undo arp optimized-reply disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a stack of multiple switches functions as an access gateway, the stack can
receive a large number of ARP packets requesting for the stack's interface MAC
address. If all these ARP Request packets are sent to the master switch, the CPU
usage of the switch increases, and other services are affected.
To address the preceding problem, enable optimized ARP reply, which improves
the switch's capability of defending against ARP flood attack. After this function is
enabled, the stack performs the following operations:
● When receiving an ARP Request packet of which the destination IP address is
the local interface address, the switch where the interface is located directly
returns an ARP Reply packet.
● When a stack system receives an ARP Request packet of which the destination
IP address is not the local interface address and intra-VLAN proxy ARP is
enabled on the master switch, the switch where the interface is located
checks whether the ARP Request packet meets the proxy condition. If so, the
switch returns an ARP Reply packet. If not, the switch discards the packet.
NOTE
The optimized ARP reply function can be configured on a stand-alone fixed switch, but does
not take effect.
By default, the optimized ARP reply function is enabled. After a device receives an
ARP Request packet, the device checks whether an ARP entry corresponding to the
source IP address of the ARP Request packet exists.
● If there is a corresponding ARP entry, the stack performs optimized ARP reply
to this ARP Request packet.
● If there is no corresponding ARP entry, the stack does not perform optimized
ARP reply to this ARP Request packet.
Precautions
● The optimized ARP reply function does not take effect for ARP Request
packets with double VLAN tags.
● The optimized ARP reply function takes effect for ARP Request packets sent
by wireless users.
● The optimized ARP reply function takes effect only for the ARP Request
packets received by VLANIF interfaces, VBDIF interfaces, Eth-Trunk sub-
interfaces, and physical sub-interfaces. The optimized ARP reply function does
not take effect for the ARP Request packets sent from the VLANIF interfaces
of super VLANs. The optimized ARP reply function takes effect for the ARP
Request packets sent from the VLANIF interfaces of MUX VLANs, but it do not
take effect when the ARP request packet carries the Group VLAN or Separate
VLAN.
NOTE
The optimized ARP reply function takes effect only for the ARP Request packets
received by the Eth-Trunk sub-interfaces and physical sub-interfaces of the S5731-H,
S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S, and S6730S-S.
● The optimized ARP reply function does not take effect globally or on
interfaces after you run any of the following commands:
– ip address ip-address { mask | mask-length } sub: configures secondary
IP addresses for interfaces.
– arp anti-attack gateway-duplicate enable: enables the ARP gateway
anti-collision function.
– arp ip-conflict-detect enable: enables IP address conflict detection.
– arp anti-attack check user-bind enable: enables dynamic ARP
inspection (DAI).
NOTE
When DAI is enabled in the physical interface view, the optimized ARP reply
function does not take effect on the device where the physical interface resides.
When DAI is enabled in the Eth-Trunk view or VLAN view, the optimized ARP
reply function does not take effect globally.
– dhcp snooping arp security enable: enables egress ARP inspection (EAI).
– arp over-vpls enable: enables ARP proxy on the device on a VPLS
network.
– arp-proxy enable: configures the routed ARP proxy function.
– arp-proxy inter-sub-vlan-proxy enable configures inter-VLAN proxy ARP
function.
● After the optimized ARP reply function is enabled, the following functions
become invalid:
– ARP rate-limiting based on source MAC addresses (configured using the
arp speed-limit source-mac command)
– ARP rate-limiting based on source IP addresses (configured using the arp
speed-limit source-ip command)
– Global ARP rate-limiting, ARP rate-limiting in VLANs, as well as ARP rate-
limiting on interfaces (configured using the arp anti-attack rate-limit
enable command)
Example
# Disable the optimized ARP reply function.
<HUAWEI> system-view
[HUAWEI] arp optimized-reply disable
Function
The arp over-vpls enable command enables ARP proxy on a device in a VPLS
network.
The undo arp over-vpls enable command disables ARP proxy on a device in a
VPLS network.
NOTE
Only the S5731-H, S5731S-H, S5732-H, S6730S-H, and S6730-H support this command.
Format
arp over-vpls enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To prevent bogus ARP packets at the PW side from being broadcast to the AC side
on a VPLS network, enable ARP proxy over VPLS on a PE.
ARP packets at the PW side are sent to the CPU for processing.
● If the ARP packets are ARP request packets and the destination IP addresses
in the packets match DHCP snooping binding entries, the device constructs
ARP reply packets based on the DHCP snooping binding entries and sends
them to the requester at the PW side.
● If the ARP packets are not ARP request packets or the destination IP addresses
in the packets match no DHCP snooping binding entry, the device forwards
these ARP packets to the destination.
Precautions
Before using this command, ensure that DHCP snooping on the device in a VPLS
network is enabled using the dhcp snooping over-vpls enable command.
After DAI is configured, the function of disabling the VLANIF interface from
sending ARP packets destined for other devices to the CPU is ineffective on the
VLANIF interface.
Example
# Enable ARP proxy on a device in a VPLS network.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping over-vpls enable
[HUAWEI] arp over-vpls enable
Function
The arp snooping anti-attack check enable command enables ARP snooping
detection on an interface.
The undo arp snooping anti-attack check enable command disables ARP
snooping detection on an interface.
Format
arp snooping anti-attack check enable
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group interface
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Prerequisites
Before running this command, ensure that you have completed the following
configurations:
1. Run the arp snooping enable command in the system view to enable ARP
snooping globally.
2. Run the arp snooping anti-attack entry-check enable command in the
system view to enable ARP snooping entry fixing.
3. Run the arp snooping enable command in the interface view to enable ARP
snooping on an interface.
Example
# Enable ARP snooping detection on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] arp snooping enable
[HUAWEI] arp snooping anti-attack entry-check fixed-mac enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp snooping enable
[HUAWEI-GigabitEthernet0/0/1] arp snooping anti-attack check enable
Function
The arp snooping anti-attack entry-check enable command enables ARP
snooping entry fixing.
The undo arp snooping anti-attack entry-check enable command disables ARP
snooping entry fixing.
Format
arp snooping anti-attack entry-check { fixed-mac | fixed-all | send-ack }
enable
undo arp snooping anti-attack entry-check [ fixed-mac | fixed-all | send-ack ]
enable
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If an attacker forges ARP packets, the device learns incorrect ARP snooping entries.
As a result, users cannot receive data packets. To prevent this problem, you can
enable the ARP snooping entry fixing function on the device. Once the device
enabled with this function learns an ARP snooping entry, it does not update the
ARP snooping entry, only updates some information in the ARP snooping entry, or
sends a unicast ARP Request packet to check the validity of the new ARP snooping
entry. The device provides three ARP snooping entry fixing modes, which are
applicable to different scenarios.
● fixed-mac: This mode applies to networks where user MAC addresses are
unchanged but user access locations often change. When a user connects to a
different interface on the device, the device updates interface information in
the ARP snooping entry of the user timely.
● fixed-all: This mode applies to networks where user MAC addresses and user
access locations are fixed.
● send-ack: This mode applies to networks where user MAC addresses and user
access locations often change.
Prerequisites
ARP snooping has been enabled by running the arp snooping enable command
in the system view.
Precautions
● An ARP snooping entry is created based on the source IP address and VLAN
information of an ARP packet. Therefore, ARP snooping entry fixing is
performed only when the source IP address and VLAN information of an ARP
packet are the same as those in an existing ARP snooping entry.
● The three ARP snooping entry fixing modes are mutually exclusive.
● Before disabling ARP snooping entry fixing, ensure that ARP snooping
detection is disabled on all interfaces.
Example
# Enable ARP snooping entry fixing and specify the fixed-mac mode.
<HUAWEI> system-view
[HUAWEI] arp snooping enable
[HUAWEI] arp snooping anti-attack entry-check fixed-mac enable
Function
The arp snooping enable command enables ARP snooping.
Format
arp snooping enable
undo arp snooping enable
Parameters
None
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
During video network O&M, the NMS needs to obtain the IP addresses and MAC
addresses of NEs to draw a network topology for subsequent O&M. For LLDP-
incapable NEs, you can configure the ARP snooping function on the access switch.
This function enables the device to obtain the IP addresses and MAC addresses of
NEs from the ARP packets sent from the NEs, and generate ARP snooping entries.
After ARP snooping is enabled, the device sends the received ARP packets to the
CPU. The CPU analyzes the ARP packets to obtain the source IP address, source
MAC address, VLAN ID, and inbound interface of the packets, and creates an ARP
snooping entry to record user information.
After an ARP snooping entry is created, it ages after 900 seconds by default. An
ARP snooping entry is created based on the source IP address and VLAN
information of an ARP packet. If no ARP snooping entry matches the source IP
address and VLAN information of a received ARP packet, the device creates a new
ARP snooping entry. If the source IP address and VLAN information of a received
ARP packet are the same as those in an existing ARP snooping entry, the device
updates the MAC address and interface information in the entry and resets the
aging timer.
Precautions
● You must enable ARP snooping in the system view, and then enable ARP
snooping in a VLAN or on an interface.
● When a switch is managed by the analyzer, you need to enable ARP snooping
globally and on an interface so that the analyzer can parse user access port
information.
Example
# Enable ARP snooping on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] arp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp snooping enable
Format
arp snooping detect default-ip ip-address
undo arp snooping detect default-ip
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After generating ARP snooping entries, the device performs ARP probe on the
entries that are about to be aged out. By default, the device sends ARP probe
packets with the source IP address being 0.0.0.0. After a terminal obtains an IP
address when going online, it also sends an ARP probe packet with the source IP
address being all 0s to check whether the obtained IP address conflicts with other
IP addresses. If the terminal receives an all-0 ARP packet, the terminal considers
that an IP address conflict occurs and therefore re-applies for an IP address. In this
case, you need to run this command to change the source IP address of the
device's ARP probe packets to prevent terminals from repeatedly applying for IP
addresses.
Configuration Impact
If this command is run more than once, the latest configuration overrides the
previous one.
Precautions
You are advised to set the IP address to be different from the IP address of the
user gateway.
Example
# Set the source IP address of ARP probe packets to 10.1.1.1.
<HUAWEI> system-view
[HUAWEI] arp snooping detect default-ip 10.1.1.1
Function
The arp snooping detect ignored-ip command configures the device not to
perform ARP probe for ARP snooping entries of a specified IP address.
The undo arp snooping detect ignored-ip command restores the default setting.
By default, the device performs ARP probe for ARP snooping entries of all IP
addresses.
Format
arp snooping detect ignored-ip ip-address
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
The device performs ARP probe for the generated ARP snooping entries that are
about to age. Specifically, it sends ARP probe packets with the source IP addresses
being all 0s and the destination IP addresses being the IP addresses of the entries
that are about to age. If the peer device is a gateway, it identifies the received ARP
packets as gratuitous ARP packets sent by itself, performs IP address conflict
detection, and frequently generates conflict alarms and logs. To prevent this
problem, you can run the arp snooping detect ignored-ip command to configure
the device not to perform ARP probe for ARP snooping entries of a specified IP
address.
Example
# Disable ARP probe for ARP snooping entries of the IP address 10.1.1.1.
<HUAWEI> system-view
[HUAWEI] arp snooping detect ignored-ip 10.1.1.1
Function
The arp speed-limit source-mac command sets the maximum rate of ARP
packets based on source MAC addresses.
The undo arp speed-limit source-mac command restores the default setting.
By default, the maximum rate of ARP packets from each source MAC address is
set to 0, that is, the rate of ARP packets is not limited based on source MAC
addresses.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1,S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S5735S-S, S5735-S-I, S6735-
S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.
Format
arp speed-limit source-mac [ mac-address ] maximum maximum
undo arp speed-limit source-mac [ mac-address ]
Parameters
Parameter Description Value
mac- Specifies the source MAC The value is in the H-H-H format.
address address. If this parameter is H is a hexadecimal number of 1
specified, the rate of ARP to 4 digits.
packets from the MAC address
is limited.
If this parameter is not
specified, the rate of ARP
packets from each MAC
address is limited.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When processing a large number of ARP packets with fixed source MAC addresses
but variable source IP addresses, the CPU is overloaded and ARP entries are
exhausted. To prevent this problem, limit the rate of ARP packets based on source
MAC addresses.
After the arp speed-limit source-mac command is run, the device collects
statistics on ARP packets from a specified source MAC address. If the number of
ARP packets from a specified source IP address per second exceeds the threshold,
the device discards the excess ARP packets.
Precautions
Limiting the rate of all ARP packets is not recommended. You are advised to find
out the attack source according to packet statistics, and then limit the rate of ARP
packets from the specified source MAC address.
If the source MAC address is not specified, the rate of ARP packets from each MAC
address is limited. If the rate of ARP packets from each source IP address is set
using the arp speed-limit source-ip command at the same time and the rate is
the same as that set using the arp speed-limit source-mac command, both
commands take effect. When receiving ARP packets from a fixed source, the
device limits the rate of these packets based on the maximum rate set by the arp
speed-limit source-mac command.
After the optimized ARP reply function (disabled by default) is enabled using the
undo arp optimized-reply disable command, rate limiting on ARP packets based
on the source MAC address does not take effect.
Example
# Set the maximum rate of ARP packets from any source MAC address to 100 pps.
<HUAWEI> system-view
[HUAWEI] arp speed-limit source-mac maximum 100
# Set the maximum rate of ARP packets from a specified MAC address 0-0-1 to 50
pps.
<HUAWEI> system-view
[HUAWEI] arp speed-limit source-mac 0-0-1 maximum 50
Format
arp speed-limit source-ip [ ip-address ] maximum maximum
undo arp speed-limit source-ip [ ip-address ]
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When processing a large number of ARP packets with fixed IP addresses (for
example, the ARP packets with the same source IP addresses but frequently
changing MAC addresses or outbound interfaces), the CPU is overloaded and
cannot process other services. To prevent this problem, limit the rate of ARP
packets based on the source IP address.
After the arp speed-limit source-ip command is run, the device collects statistics
on ARP packets based on the source IP address. If the number of ARP packets
from a specified source IP address per second exceeds the threshold, the device
discards the excess ARP packets.
Precautions
Limiting the rate of all ARP packets is not recommended. You are advised to find
out the attack source according to packet statistics, and then limit the rate of ARP
packets from the specified source IP address.
When you confirm that the network is secure, set the rate limit to 0 to increase
ARP learning speed. After the rate limit is set to 0, the device does not limit the
ARP packet rate based on source IP addresses.
If the source IP address is not specified, the rate of ARP packets from each IP
address is limited. If the rate of ARP packets from each source MAC address is set
using the arp speed-limit source-mac command at the same time and the rate is
the same as that set using the arp speed-limit source-ip command, both
commands take effect. When receiving ARP packets from a fixed source, the
device limits the rate of these packets based on the maximum rate set by the arp
speed-limit source-mac command.
After the optimized ARP reply function (disabled by default) is enabled using the
undo arp optimized-reply disable command, rate limiting on ARP packets based
on the source IP address does not take effect.
Example
# Set the maximum rate of ARP packets from a source IP address to 100 pps.
<HUAWEI> system-view
[HUAWEI] arp speed-limit source-ip maximum 100
# Set the maximum rate of ARP packets from a specified IP address 10.0.0.1 to 50
pps.
<HUAWEI> system-view
[HUAWEI] arp speed-limit source-ip 10.0.0.1 maximum 50
The undo arp validate command disables MAC address consistency check in an
ARP packet on an interface.
Format
arp validate { source-mac | destination-mac } *
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, 40GE interface view, XGE interface view,
25GE interface view, 100GE interface view, MultiGE interface view, port group
view, Eth-Trunk interface view, VE interface view
Default Level
2: Configuration level
Usage Guidelines
The MAC address consistency check function for ARP packets prevents attacks
from bogus ARP packets in which the source and destination MAC addresses are
different from those in the Ethernet frame header. This function is usually
configured on gateways.
After the arp validate command is run, the gateway checks the MAC address
consistency in an ARP packet before ARP learning. If the source and destination
MAC addresses in an ARP packet are different from those in the Ethernet frame
header, the device discards the packet as an attack. If the source and destination
MAC addresses in an ARP packet are the same as those in the Ethernet frame
header, the device performs ARP learning.
– When receiving an ARP Reply packet, the device checks only the source
MAC address consistency.
● If destination-mac is specified:
– When receiving an ARP Request packet, the device does not check the
destination MAC address consistency because the ARP Request packet is
broadcast.
– When receiving an ARP Reply packet, the device checks the destination
MAC address consistency.
● If source-mac and destination-mac are specified:
– When receiving an ARP Request packet, the device checks only the source
MAC address consistency.
– When receiving an ARP Reply packet, the device checks the source and
destination MAC address consistency.
Example
# Enable MAC address consistency check in an ARP packet on Layer 2 interface
GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp validate source-mac destination-mac
Format
arp-fake expire-time expire-time
undo arp-fake expire-time
Parameters
Parameter Description Value
expire-time Specifies the aging time of The value is an integer that ranges
temporary ARP entries. from 1 to 36000, in seconds.
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
40GE interface view, 100GE interface view, MultiGE interface view, Eth-Trunk
interface view, VLANIF interface view, VBDIF interface view, VE interface view, port
group view
Default Level
2: Configuration level
Usage Guidelines
When IP packets trigger ARP Miss messages, the device generates temporary ARP
entries and sends ARP Request packets to the destination network.
● In the aging time of temporary ARP entries:
– Before receiving an ARP reply packet, the device discards the IP packets
matching the temporary ARP entry and does not generate ARP Miss
messages.
– After receiving an ARP Reply packet, the device generates a correct ARP
entry to replace the temporary entry.
● When temporary ARP entries age out, the device clears them. If no ARP entry
matches the IP packets forwarded by the device, ARP Miss messages and
temporary ARP entries are repeatedly generated
When a device undergoes an ARP Miss attack, you can run the arp-fake expire-
time command to extend the aging time of temporary ARP entries to reduce the
frequency of triggering ARP Miss messages and minimize the impact on the
device.
Example
# Set the aging time of temporary ARP entries to 10 seconds on VLANIF10.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] quit
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] arp-fake expire-time 10
# Set the aging time of temporary ARP entries to 10 seconds on Layer 3 interface
GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] arp-fake expire-time 10
14.6.34 arp-limit
Function
The arp-limit command sets the maximum number of ARP entries that an
interface can dynamically learn.
The undo arp-limit command deletes the maximum number of ARP entries that
an interface can dynamically learn.
By default, the maximum number of ARP entries that an interface can dynamically
learn is the same as the number of ARP entries supported by the device.
Format
VLANIF interface, VBDIF interface, VE sub-interface, Layer 3 interface, and
Ethernet sub-interface:
arp-limit maximum maximum
undo arp-limit
VE sub-interface, Layer 2 interface and port group:
arp-limit vlan vlan-id1 [ to vlan-id2 ] maximum maximum
undo arp-limit vlan vlan-id1 [ to vlan-id2 ]
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support Layer 3 interfaces and sub-interfaces.
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support VE sub-interfaces.
Parameters
Parameter Description Value
Views
Interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To prevent ARP entries from being exhausted by ARP attacks from a host
connecting to an interface on the device, set the maximum number of ARP entries
that the interface can dynamically learn. When the number of the ARP entries
learned by a specified interface reaches the maximum number, no dynamic ARP
entry can be added.
Precautions
Example
# Configure that VLANIF 10 can dynamically learn a maximum of 20 ARP entries.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] quit
[HUAWEI] interface vlanif 10
[HUAWEI-Vlanif10] arp-limit maximum 20
Function
The arp-miss anti-attack rate-limit command sets the maximum rate and rate
limiting duration of ARP Miss messages globally, in a VLAN, or on an interface.
By default, the device can process a maximum of 100 ARP Miss messages per
second.
NOTE
Format
arp-miss anti-attack rate-limit packet packet-number [ interval interval-value ]
undo arp-miss anti-attack rate-limit
Parameters
Parameter Description Value
Views
System view, VLAN view, GE interface view, 40GE interface view, XGE interface
view, 25GE interface view, 100GE interface view, MultiGE interface view, port
group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After rate limit on ARP Miss messages is enabled, you can set maximum rate and
rate limiting duration of ARP Miss messages globally, in a VLAN, or on an
interface. If the number of ARP Miss messages triggered by IP packets in the rate
limiting duration exceeds the limit, the device does not process the excess ARP
Miss packets and discards the IP packets triggering the excess ARP Miss messages.
Prerequisites
Rate limit on ARP Miss messages has been enabled globally, in a VLAN, or on an
interface using the arp-miss anti-attack rate-limit enable command.
Precautions
If rate limit on ARP Miss messages is configured in the system view, VLAN view,
and interface view, the device uses the configurations in the interface view, VLAN
view, and system view in order.
Example
# Configure the device to process a maximum of 200 ARP Miss messages
triggered by IP packets from Layer 2 interface GE0/0/1 in 10 seconds.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit packet 200 interval 10
Function
The arp-miss anti-attack rate-limit alarm enable command enables the alarm
function for ARP Miss messages discarded when the rate of ARP Miss messages
exceeds the limit.
The undo arp-miss anti-attack rate-limit alarm enable command disables the
alarm function for ARP Miss messages discarded when the rate of ARP Miss
messages exceeds the limit.
NOTE
Format
arp-miss anti-attack rate-limit alarm enable
Parameters
None
Views
System view, VLAN view, GE interface view, 40GE interface view, XGE interface
view, 25GE interface view, 100GE interface view, MultiGE interface view, port
group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After rate limit on ARP Miss messages is enabled, if you want that the device can
generate alarms to notify the network administrator of a large number of
discarded excess ARP Miss messages, run the arp-miss anti-attack rate-limit
alarm enable command. When the number of discarded ARP Miss packets
exceeds the alarm threshold, the device generates an alarm.
You can set the alarm threshold using the arp-miss anti-attack rate-limit alarm
threshold command.
Prerequisites
Rate limit on ARP Miss messages has been enabled using the arp-miss anti-
attack rate-limit enable command.
Example
# Enable the alarm function for ARP Miss messages discarded when the rate of
ARP Miss messages exceeds the limit on Layer 2 interface GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit alarm enable
# Enable the alarm function for ARP Miss messages discarded when the rate of
ARP Miss messages exceeds the limit on Layer 3 interface GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit alarm enable
NOTE
Format
arp-miss anti-attack rate-limit alarm threshold threshold
undo arp-miss anti-attack rate-limit alarm threshold
Parameters
Parameter Description Value
Views
System view, VLAN view, GE interface view, 40GE interface view, XGE interface
view, 25GE interface view, 100GE interface view, MultiGE interface view, port
group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can use the arp-miss anti-attack rate-limit alarm threshold command to
set the alarm threshold. When the number of discarded ARP Miss packets exceeds
the alarm threshold, the device generates an alarm.
Prerequisites
Rate limit on ARP Miss messages has been enabled using the arp-miss anti-
attack rate-limit enable command, and the alarm function has been enabled
using the arp-miss anti-attack rate-limit alarm enable command.
Example
# Enable rate limit on ARP Miss messages globally, enable the alarm function, and
set the alarm threshold to 200.
<HUAWEI> system-view
[HUAWEI] arp-miss anti-attack rate-limit enable
# Enable rate limit on ARP Miss messages on Layer 2 interface GE0/0/1, enable
the alarm function, and set the alarm threshold to 200.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit alarm enable
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit alarm threshold 200
# Enable rate limit on ARP Miss messages on Layer 3 interface GE0/0/1, enable
the alarm function, and set the alarm threshold to 200.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit enable
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit alarm enable
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit alarm threshold 200
Function
The arp-miss anti-attack rate-limit enable command enables rate limit on ARP
Miss messages globally, in a VLAN, or on an interface.
The undo arp-miss anti-attack rate-limit enable command disables rate limit on
ARP Miss messages globally, in a VLAN, or on an interface.
NOTE
Format
arp-miss anti-attack rate-limit enable
Parameters
None
Views
System view, VLAN view, GE interface view, 40GE interface view, XGE interface
view, 25GE interface view, 100GE interface view, MultiGE interface view, port
group view, Eth-Trunk interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To avoid the preceding problems, configure rate limit on ARP Miss messages
globally, in a VLAN, or on an interface. The device collects statistics on ARP Miss
messages. If the number of ARP Miss messages generated within the rate limiting
duration exceeds the threshold (the maximum number of ARP Miss messages),
the gateway discards the IP packets triggering the excess ARP Miss messages.
Follow-up Procedure
Run the arp-miss anti-attack rate-limit command to set the maximum rate and
rate limiting duration of ARP Miss messages.
Example
# Enable rate limit on ARP Miss messages on Layer 2 interface GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] arp-miss anti-attack rate-limit enable
Function
The arp-miss speed-limit source-ip command sets the maximum number of ARP
Miss messages based on source IP addresses and specifies the mode for processing
ARP Miss packets.
The undo arp-miss speed-limit source-ip command restores the default setting.
If the number of ARP Miss messages triggered by IP packets from the same source
IP address per second exceeds the limit, the device discards the excess ARP Miss
messages, that is, the device discards the excess ARP Miss packets. The device then
uses the block mode to discard all ARP Miss packets from the source IP address
within 5 seconds by default.
NOTE
Format
arp-miss speed-limit source-ip ip-address [ mask mask ] maximum maximum
[ none-block | block timer timer ]
arp-miss speed-limit source-ip maximum maximum
undo arp-miss speed-limit source-ip [ ip-address [ mask mask ] ]
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1,S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S5735S-S, S5735-S-I, S6735-
S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support [ none-block |
block timer timer ].
Parameters
Parameter Description Value
mask mask Specifies the mask of the IP The value is an integer that
address. If this parameter is ranges from 1 to 32.
specified, the maximum
number of ARP Miss messages
triggered by packets from IP
addresses in the network
segment is limited.
block timer Indicates that ARP Miss The value ranges from 5 to
timer packets are processed in block 864000, in seconds. The
mode. If the number of ARP default value is 5 seconds.
Miss messages triggered by IP
packets from a source IP
address per second exceeds
the limit, the device discards
the excess ARP Miss messages
and delivers an ACL to enable
the chip to discard all packets
that are sent from this source
IP address within the period
specified by timer. When the
period specified by timer
expires, the ACL ages out and
the chip does not discard ARP
Miss packets from the source
IP address and sends them to
the CPU for processing.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If the number of ARP Miss messages triggered by IP packets from a source IP
address per second exceeds the limit, the device considers that an attack is
initiated from the source IP address. If the ARP Miss message processing mode is
set to block, the device discards excess ARP Miss packets from this source IP
address and delivers an ACL to discard all subsequent packets sent from this
source IP address. If the ARP Miss message processing mode is set to none-block,
the device only discards excess ARP Miss packets.
The administrator can use the arp-miss speed-limit source-ip command to set
the maximum number of ARP Miss packets and specify the mode for processing
ARP Miss packets based on the actual network environment.
If the number of ARP Miss messages triggered by IP packets from a source IP
address per second exceeds the limit, the device considers that an attack is
initiated from the source IP address. The administrator can use the arp-miss
speed-limit source-ip command to set the maximum number of ARP Miss
messages that the device can process within a specified duration, protecting the
system resources and ensuring proper running of other services.
Precautions
You can set the maximum number of ARP Miss messages for a maximum of 512
IP addresses.
If the ARP Miss packet processing mode is set to none-block, the device discards
ARP Miss packets triggering excess ARP Miss messages to reduce CPU load. The
non-block action can cause a high CPU usage, and the block action uses ACL
resources. The default ARP Miss packet processing mode is recommended.
In the process of setting the maximum number of ARP Miss messages based on
source IP addresses, if the ARP Miss packet processing mode is not specified, the
device use the default processing mode block.
When the maximum number of ARP Miss packets exceeds the limit, the delivered
ACL discards only the ARP Miss packets from the source IP address. Other packets
can still be sent to the CPU.
A maximum of 16 ACLs can be delivered to the chip to discard ARP Miss packets
from a specified IP address or network segment. When the device delivers 16 ACLs
and all ACLs do not age out, and the number of ARP Miss packets from other IP
addresses or network segments per second exceeds the limit, the device does not
deliver any ACL to discard all subsequent packets and the CPU discards excess ARP
packets.
NOTE
The S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S cannot deliver ACLs to
discard ARP Miss packets.
Example
# Set the maximum number of ARP Miss messages triggered by each source IP
address per second to 60.
<HUAWEI> system-view
[HUAWEI] arp-miss speed-limit source-ip maximum 60
# Set the maximum number of ARP Miss messages triggered by the IP address
10.0.0.1 per second to 100, and set the maximum number of ARP Miss messages
triggered by other source IP addresses per second to 60.
<HUAWEI> system-view
[HUAWEI] arp-miss speed-limit source-ip maximum 60
[HUAWEI] arp-miss speed-limit source-ip 10.0.0.1 maximum 100
NOTE
Format
display arp anti-attack arpmiss-record-info [ ip-address ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After rate limit on ARP Miss messages is triggered, the device discards excess ARP
Miss messages. You can run this command to view information recorded by the
device when rate limit on ARP Miss messages is triggered. The information helps
locate and rectify faults.
The device can record a maximum of 256 records about rate limit on ARP Miss
messages. If a new round of rate limit on ARP Miss messages is triggered when
the number of records reaches 256, the device takes the following actions:
1. If the source IP address of the attacker already exists in a record, the device
updates the block time in the record using the discarding time of the new ARP
Miss message.
2. If the source IP address of the attacker does not exist in any record, the device
deletes the first record and adds a new record for this attacker.
Example
# Display information recorded by the device when rate limit on ARP Miss
messages is triggered.
<HUAWEI> display arp anti-attack arpmiss-record-info
Interface IP address Attack time Block time Aging-time
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
The number of record(s) in arp-miss table is 0
Attack time First time when rate limit on ARP Miss messages is
triggered, that is, time when the number of ARP Miss
messages exceeds the limit.
Block time Last time when the device discards the ARP Miss
messages of the attacker.
Function
The display arp anti-attack configuration check user-bind command displays
the configuration of DAI in a VLAN or on an interface.
Format
display arp anti-attack configuration check user-bind [ vlan [ vlan-id ] |
interface [ interface-type interface-number ] ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to view the configuration of DAI in a VLAN or on an
interface, including whether the function is enabled, check items, whether the
alarm function is enabled for discarded ARP packets, and alarm threshold.
Only after DAI and the alarm function are enabled, output of this command is
displayed.
Example
# Display DAI configuration on GE0/0/1.
<HUAWEI> display arp anti-attack configuration check user-bind interface gigabitethernet 0/0/1
arp anti-attack check user-bind enable
arp anti-attack check user-bind alarm enable
arp anti-attack check user-bind alarm threshold 50
arp anti-attack check user-bind check-item ip-address
vlan 2
arp anti-attack check user-bind enable
arp anti-attack check user-bind check-item ip-address
#
vlan 3
arp anti-attack check user-bind enable
#
GigabitEthernet0/0/1
arp anti-attack check user-bind enable
arp anti-attack check user-bind alarm enable
arp anti-attack check user-bind alarm threshold 50
arp anti-attack check user-bind check-item ip-address
#
Table 14-45 Description of the display arp anti-attack configuration check user-
bind command output
Item Description
arp anti-attack check The alarm function for ARP packets discarded by DAI
user-bind alarm enable has been enabled.
You can run the arp anti-attack check user-bind
alarm enable command to enable the alarm
function.
arp anti-attack check Only the IP address is checked during ARP packet
user-bind check-item ip- check based on binding entries.
address You can run the arp anti-attack check user-bind
check-item command or arp anti-attack check
user-bind check-item command to specify the check
item for ARP packet check based on binding entries.
Format
display arp anti-attack configuration { arp-rate-limit | arp-speed-limit | entry-
check | arpmiss-rate-limit | arpmiss-speed-limit | gateway-duplicate | log-trap-
timer | packet-check | all } (Only the S1730S-H, S5720I-SI, S2730S-S, S5735-L-I,
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After all ARP anti-attack functions are configured, you can run this command to
check all configurations.
Example
# Display the configuration of rate limit on ARP packets based on the source IP
address or source MAC address.
<HUAWEI> display arp anti-attack configuration arp-speed-limit
ARP speed-limit for source-MAC configuration:
MAC-address suppress-rate(pps)(rate=0 means function disabled)
-------------------------------------------------------------------------------
All 0
-------------------------------------------------------------------------------
The number of configured specified MAC address(es) is 0, spec is 512.
# Display the configuration of rate limit on ARP Miss messages based on the
source IP address.
<HUAWEI> display arp anti-attack configuration arpmiss-speed-limit
ARP miss speed-limit for source-IP configuration:
IP-address suppress-rate(pps)(rate=0 means function disabled)
------------------------------------------------------------------------
10.0.0.30/32 400
Others 0
------------------------------------------------------------------------
The number of configured specified IP address(es) is 1, spec is 512.
All disabled
-------------------------------------------------------------------------------
Table 14-46 Description of the display arp anti-attack configuration all command
output
Item Description
Item Description
ARP anti-attack entry- ARP entry fixing mode. Vlanif specifies the interface
check mode to which the ARP entry fixing mode is applied. The
modes include:
● fixed-mac
● fixed-all
● send-ack
● disabled
You can run the arp anti-attack entry-check enable
command to set the ARP entry fixing mode.
ARP speed-limit for Rate limit on ARP packets based on the source MAC
source-MAC address.
configuration You can run the arp speed-limit source-mac
command to configure rate limit on ARP packets
based on the source MAC address.
ARP speed-limit for Rate limit on ARP packets based on the source IP
source-IP configuration address.
You can run the arp speed-limit source-ip command
to configure rate limit on ARP packets based on the
source IP address.
Item Description
ARP miss speed-limit for Rate limit on ARP Miss messages based on source IP
source-IP configuration addresses.
You can run the arp-miss speed-limit source-ip
command to configure rate limit on ARP Miss
messages based on the source IP address.
Function
The display arp anti-attack gateway-duplicate item command displays ARP
gateway anti-collision entries.
Format
display arp anti-attack gateway-duplicate item
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After ARP gateway anti-collision is enabled, you can run this command to view
ARP anti-collision entries.
Example
# Display ARP gateway anti-collision entries.
<HUAWEI> display arp anti-attack gateway-duplicate item
Interface IP address MAC address VLANID Aging time
-------------------------------------------------------------------------------
GigabitEthernet0/0/1 10.1.1.1 00e0-fc12-3456 2 150
GigabitEthernet0/0/2 10.1.1.2 00e0-fc12-3478 2 170
-------------------------------------------------------------------------------
The number of record(s) in gateway conflict table is 2
Item Description
Function
The display arp anti-attack packet-check statistics command displays the
statistics on invalid ARP packets that are filtered out during ARP packet validity
check.
Format
display arp anti-attack packet-check statistics
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After ARP packet validity check is enabled, if you want to view the statistics on
invalid ARP packets that are filtered out, you can run this command.
Example
# Display the statistics on invalid ARP packets that are filtered out in ARP packet
validity check is displayed.
<HUAWEI> display arp anti-attack packet-check statistics
Number of ARP packet(s) checked: 5
Number of ARP packet(s) dropped by sender-mac checking: 0
Number of ARP packet(s) dropped by dst-mac checking: 0
Number of ARP packet(s) dropped by src-ip checking: 2
Number of ARP packet(s) dropped by dst-ip checking: 0
Item Description
Number of ARP packet(s) dropped Number of invalid ARP packets that are
by sender-mac checking filtered out because the source MAC
address in the packet is different from that
in the Ethernet frame header.
Number of ARP packet(s) dropped Number of invalid ARP packets that are
by dst-mac checking filtered out because the destination MAC
address in the packet is different from that
in the Ethernet frame header.
Item Description
Format
display arp anti-attack statistics check user-bind interface interface-type
interface-number
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
After dynamic ARP inspection (DAI) is enabled in the interface view, you can run
this command to check statistics about discarded ARP packets matching no
binding entry on the interface. If the alarm function for ARP packets discarded by
DAI is enabled, you can also check statistics about discarded ARP packets
matching no binding entry on the interface after the latest alarm is generated.
Precautions
● If DAI is enabled only in the VLAN view, this command cannot be run to
display statistics about discarded ARP packets matching no binding entry on
the interfaces in the VLAN.
● This command cannot check statistics about discarded ARP packets matching
no binding entry on the management interface.
Example
# Display the statistics on discarded ARP packets matching no binding entry on
GE0/0/1.
<HUAWEI> display arp anti-attack statistics check user-bind interface gigabitethernet 0/0/1
Dropped ARP packet number is 966
Dropped ARP packet number since the latest warning is 605
Table 14-49 Description of the display arp anti-attack statistics check user-bind
interface command output
Item Description
Function
The display arp learning strict command displays strict ARP learning globally and
on all interfaces.
Format
display arp learning strict
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After strict ARP learning is configured, you can run this command to check the
configuration.
Example
# Display strict ARP learning globally and on all interfaces.
<HUAWEI> display arp learning strict
The global configuration:arp learning strict
Interface LearningStrictState
------------------------------------------------------------
Vlanif100 force-disable
Vlanif200 force-enable
------------------------------------------------------------
Total:2
Force-enable:1
Force-disable:1
Table 14-50 Description of the display arp learning strict command output
Item Description
The global configuration Global strict ARP learning. The value arp
learning strict indicates that strict ARP
learning has been enabled. If the
parameter is left blank, strict ARP learning
is disabled.
You can run the arp learning strict
command to enable strict ARP learning.
Format
display arp optimized-passby status interface vlanif vlanif-id slot slot-id
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S,
and S6730S-S support this command.
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
If an interface receives a large number of ARP packets whose destination IP
addresses are different from the IP address of this interface and sends these ARP
packets to the CPU for processing, the CPU usage is high and the CPU cannot
process services properly.
To prevent this issue, you can configure the device to directly forward ARP packets
destined for other devices without sending them to the CPU. This improves the
device's capability of defending against ARP flood attacks.
When the device is configured not to send ARP packets destined for other devices
to the CPU, the configuration does not take effect if a conflict configuration exists
on the device. You can use the display arp optimized-passby status command to
check whether the device is configured not to send ARP packets destined for other
devices to the CPU and whether the configuration takes effect. For details about
conflict configurations, see arp optimized-passby enable.
Example
# Display whether the device is configured not to send ARP packets destined for
other devices to the CPU and whether the configuration takes effect on VLANIF
100.
<HUAWEI> display arp optimized-passby status interface Vlanif 100 slot 0
Current configuration:Enable
Actual status:Inactive
Related configuration:
NAC configuration (for example, dot1x enable)
Format
display arp optimized-reply statistics [ slot slot-id ]
Parameters
slot slot-id ● This parameter specifies the slot ID The value must be set
if stacking is not configured. according to the device
● This parameter specifies the stack ID configuration.
if stacking is enabled.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to check statistics on optimized ARP Reply packets
after the optimized ARP reply function is enabled on the device.
Example
# Display statistics on optimized ARP Reply packets.
<HUAWEI> display arp optimized-reply statistics
Slot Received Processed Dropped
----------------------------------------------------------------
0 11 9 7
Item Description
Function
The display arp optimized-reply status command displays the status of the
optimized ARP reply function.
Format
display arp optimized-reply status
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to check the status of the optimized ARP reply
function.
Example
# Check the status of the optimized ARP reply function.
<HUAWEI> display arp optimized-reply status
Current configuration:Disable
Actual status:Inactive
Related configuration:
arp optimized-reply disable
arp anti-attack check user-bind enable
arp anti-attack gateway-duplicate enable
Item Description
Item Description
Format
display arp packet statistics
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To locate and rectify ARP faults, you can run this command to view the statistics
on ARP packets.
This command displays the ARP packet statistics on the active switch in a stack
system.
Example
# Display the statistics on ARP packets.
<HUAWEI> display arp packet statistics
ARP Pkt Received: sum 420066
ARP Received In Message-cache: sum 0
ARP-Miss Msg Received: sum 0
ARP Learnt Count: sum 5
ARP Pkt Discard For Limit: sum 0
ARP Pkt Discard For SpeedLimit: sum 0
Table 14-54 Description of the display arp packet statistics command output
Item Description
ARP Pkt Discard For Limit Number of ARP packets discarded due to
the ARP entry limit.
To configure the maximum number of
dynamic ARP entries that an interface can
learn, run the arp-limit command.
ARP Pkt Discard For SpeedLimit Number of ARP packets discarded when
the number of ARP packets from a
specified source IP address exceeds the
limit.
To configure a rate limit for ARP packets
based on the source IP address, run the
arp speed-limit source-ip command.
ARP Pkt Discard For Proxy Suppress Number of packets discarded for the
speed limit.
ARP Pkt Discard For Other Number of the packets discarded due to
other causes.
Item Description
ARP-Miss Msg Discard For Other Number of the ARP Miss messages
discarded due to other causes.
Function
The display arp-limit command displays the maximum number of ARP entries
that an interface can dynamically learn.
Format
display arp-limit [ interface interface-type interface-number[.subinterface-
number ] ] [ vlan vlan-id ]
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S, S6720-EI, S6720S-EI,
S6730-H, S6730S-H, S6730-S, and S6730S-S support sub-interface.
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After the maximum number of ARP entries that an interface can dynamically learn
is set, you can run this command to check the configuration.
Example
# Display the number of ARP entries that each interface can dynamically learn.
<HUAWEI> display arp-limit
Interface LimitNum VlanID LearnedNum(Mainboard)
---------------------------------------------------------------------------
Vlanif100 1000 0 0
GigabitEthernet0/0/1 16384 10 0
---------------------------------------------------------------------------
Total:2
Item Description
Function
The display arp-miss speed-limit source-ip command displays the configuration
of rate limit on ARP Miss message based on the source IP address.
NOTE
Format
display arp-miss speed-limit source-ip
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After ARP Miss rate limiting based on source IP address is configured, you can run
this command to check the configuration.
Example
# Display the configuration of rate limit on ARP Miss messages based on the
source IP address.
<HUAWEI> display arp-miss speed-limit source-ip
Slot SuppressType SuppressValue
---------------------------------------------------
0 ARP-miss 600
Item Description
Item Description
Format
display arp snooping { all | interface interface-type interface-number | vlan vlan-
id | ip-address ip-address | mac-address mac-address }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After ARP snooping is enabled, the device generates ARP snooping entries that
contain the IP address, MAC address, VLAN ID, inbound interface, and aging time.
You can run the display arp snooping command to view the ARP snooping
entries.
Example
# Display all ARP snooping entries.
<HUAWEI> display arp snooping all
VLAN/CEVLAN IP ADDRESS MAC ADDRESS INTERFACE EXPIRE(S)
----------------------------------------------------------------------
2/- 192.168.10.1 xxxx-xxxx-xxx1 Eth1/0/0 20
2/- 192.168.10.2 xxxx-xxxx-xxx2 Eth1/0/0 10
13/- 10.1.1.1 xxxx-xxxx-xxx3 Eth-Trunk0 18
12/10 172.16.1.1 xxxx-xxxx-xxx4 40GE5/0/4 5
----------------------------------------------------------------------
Total Count:4
Item Description
IP ADDRESS IP address.
Item Description
Function
The reset arp anti-attack packet-check statistics command clears the statistics
on invalid ARP packets that are filtered out during ARP packet validity check.
Format
reset arp anti-attack packet-check statistics
Parameters
None
Views
User view
Default Level
2: Configuration level
Usage Guidelines
You can run this command to clear existing statistics, and run the display arp
anti-attack packet-check statistics command to view the statistics on follow-up
invalid ARP packets that are filtered out.
Example
# Clear the statistics on invalid ARP packets that are filtered out in ARP packet
validity check.
<HUAWEI> reset arp anti-attack packet-check statistics
Function
The reset arp anti-attack statistics check user-bind command clears the
statistics on discarded ARP packets matching no binding entry.
Format
reset arp anti-attack statistics check user-bind interface interface-type
interface-number
Parameters
Parameter Description Value
Views
User view, system view
Default Level
2: Configuration level
Usage Guidelines
After DAI is enabled and some ARP packets matching no binding entry are
discarded, you can run this command to clear the statistics on the discarded ARP
packets.
Example
# Clear the statistics on discarded ARP packets on GE0/0/1.
<HUAWEI> reset arp anti-attack statistics check user-bind interface gigabitethernet 0/0/1
Function
The reset arp anti-attack statistics rate-limit command clears the statistics on
ARP packets discarded when the rate of ARP packets exceeds the limit.
Format
reset arp anti-attack statistics rate-limit
Parameters
None
Views
User view, system view
Default Level
2: Configuration level
Usage Guidelines
After rate limit on ARP packets is enabled globally, the device discards the excess
packets when the rate of ARP packets exceeds the limit. You can run this
command to clear the statistics on the discarded ARP packets.
Example
# Clear the statistics on ARP packets discarded when the rate of ARP packets
exceeds the limit.
<HUAWEI> reset arp anti-attack statistics rate-limit
Function
The reset arp optimized-reply statistics command clears statistics on optimized
ARP Reply packets.
Format
reset arp optimized-reply statistics [ slot slot-id ]
Parameters
Parameter Description Value
slot slot-id Specifies the stack ID. The value must be set according to the device
configuration.
Views
User view
Default Level
2: Configuration level
Usage Guidelines
To collect statistics on optimized ARP Reply packets on the device, you can run the
reset arp optimized-reply statistics [ slot slot-id ] command to clear statistics on
optimized ARP Reply packets of the device.
Example
# Clears statistics on optimized ARP Reply packets.
<HUAWEI> reset arp optimized-reply statistics
Function
The reset arp packet statistics command clears the statistics on ARP packets.
Format
reset arp packet statistics
Parameters
None
Views
User view
Default Level
2: Configuration level
Usage Guidelines
You can run the display arp packet statistics command to display the statistics
on ARP packets. To obtain correct statistics, run the reset arp packet statistics
command to clear existing statistics first.
The reset arp packet statistics command clears the ARP packet statistics on the
active switch in a stack system.
Example
# Clear the statistics on all ARP packets.
<HUAWEI> reset arp packet statistics
Format
reset arp snooping { all | interface interface-type interface-number | vlan vlan-id
| ip-address ip-address | mac-address mac-address }
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
To view ARP snooping entries in a specified period, you need to generate new ARP
snooping entries from a specified time. You can run the reset arp snooping
command to clear ARP snooping entries.
Example
# Clear ARP snooping entries.
<HUAWEI> reset arp snooping all
Commands provided in this section and all the parameters in the commands are
supported by all switch models by default, unless otherwise specified. For details,
see specific commands.
Function
The display mac-address sec-config command displays secure static MAC address
entries.
Format
display mac-address sec-config [ vlan vlan-id | interface-type interface-number ]
*[ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After secure static MAC address entries are configured by the command port-
security mac-address, you can run the display mac-address sec-config
command to check these entries.
Example
# Display all secure static MAC address entries.
<HUAWEI> display mac-address sec-config
-------------------------------------------------------------------------------
MAC Address VLAN/VSI/BD Learned-From Type
-------------------------------------------------------------------------------
xxxx-xxxx-xxx1 100/-/- GE0/0/1 sec-config
-------------------------------------------------------------------------------
Total items displayed = 1
Format
display mac-address security [ vlan vlan-id | interface-type interface-number ] *
[ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
After port security is enabled on an interface by using the port-security enable
command, MAC address entries learned by the interface are stored in the MAC
address table as secure dynamic MAC address entries. The learned secure dynamic
MAC address entries are deleted after the device restarts.
After configuring the port security function, you can run the display mac-address
security command to check whether the learned secure dynamic MAC address
entries are correct.
Follow-up Procedure
If the displayed secure dynamic MAC address entries are invalid, run the undo
mac-address security command to delete secure dynamic MUX MAC address
entries.
Precautions
If you run the display mac-address security command without parameters, all
secure dynamic MAC address entries are displayed.
If the MAC address table does not contain any secure dynamic MAC address entry,
no information is displayed.
When the device has a large number of secure dynamic MAC address entries, it is
recommended that you specify parameters in the command to filter the output
information. Otherwise, the following problems may occur due to excessive output
information:
● The displayed information is repeatedly refreshed, so you cannot find the
required information.
● The system traverses and retrieves information for a long time, and does not
respond to any request.
Example
# Display all secure dynamic MAC address entries.
<HUAWEI> display mac-address security
-------------------------------------------------------------------------------
MAC Address VLAN/VSI/BD Learned-From Type
-------------------------------------------------------------------------------
xxxx-xxxx-xxx1 100/-/- GE0/0/1 security
xxxx-xxxx-xxx2 200/-/- GE0/0/2 security
-------------------------------------------------------------------------------
Total items displayed = 2
# Display detailed information about all secure dynamic MAC address entries in
VLAN 10.
<HUAWEI> display mac-address security vlan 10 verbose
-------------------------------------------------------------------------------
MAC Address : xxxx-xxxx-xxx1 VLAN : 10
Learned-From: GE0/0/1 Type : security
Aging-Time : 200s
-------------------------------------------------------------------------------
Total items displayed = 1
Item Description
Function
The display mac-address sticky command displays sticky VLAN MAC address
entries.
Format
display mac-address sticky [ vlan vlan-id | interface-type interface-number ] *
[ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
The MAC address table of the switch stores MAC addresses of other devices. When
forwarding an Ethernet frame, the switch searches the MAC address table for the
outbound interface according to the destination MAC address and VLAN ID in the
Ethernet frame.
After port security is enabled on an interface by using the port-security enable
command, MAC address entries learned by the interface are stored in the MAC
address table as secure dynamic MAC address entries. The learned secure dynamic
MAC address entries are deleted after the switch restarts. If the sticky MAC
function is also enabled on the interface by using the port-security mac-address
sticky command, secure dynamic MAC address entries change to sticky MAC
address entries. Sticky MAC address entries are not deleted after the switch
restarts.
To check the sticky MAC configuration or the learned sticky MAC address entries,
run the display mac-address sticky command.
Follow-up Procedure
If the displayed sticky MAC address entries are invalid, run the undo mac-address
sticky command to delete sticky MAC address entries.
Precautions
If you run the display mac-address sticky command without parameters, all
sticky MAC address entries are displayed.
If the MAC address table does not contain any sticky MAC address, no information
is displayed.
When the switch has a large number of sticky MAC address entries, it is
recommended that you specify parameters in the command to filter the output
information. Otherwise, the following problems may occur due to excessive output
information:
● The displayed information is repeatedly refreshed, so you cannot find the
required information.
● The system traverses and retrieves information for a long time, and does not
respond to any request.
Example
# Display all sticky MAC address entries.
<HUAWEI> display mac-address sticky
-------------------------------------------------------------------------------
MAC Address VLAN/VSI/BD Learned-From Type
-------------------------------------------------------------------------------
xxxx-xxxx-xxx1 100/-/- GE0/0/1 sticky
xxxx-xxxx-xxx2 200/-/- GE0/0/2 sticky
-------------------------------------------------------------------------------
Total items displayed = 2
# Display detailed information about all sticky MAC address entries in VLAN 10.
<HUAWEI> display mac-address sticky vlan 10 verbose
-------------------------------------------------------------------------------
MAC Address : xxxx-xxxx-xxx1 VLAN : 10
Learned-From: GE0/0/1 Type : sticky
-------------------------------------------------------------------------------
Total items displayed = 1
Format
display mac-address sticky-config [ vlan vlan-id | interface-type interface-
number ] * [ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
After secure static MAC address entries are configured using the port-security
mac-address sticky-config command, you can run the display mac-address
sticky-config command to check these entries.
Follow-up Procedure
After you run this command to check MAC address entries of the Sticky-Config
type and consider that a MAC address entry is invalid, you can run the undo port-
security mac-address [ sticky-config ] mac-address vlan vlan-id command to
delete it.
Precautions
If you run the display mac-address sticky-config command without specifying
any parameters, all MAC address entries of the Sticky-Config type are displayed.
If the MAC address table does not contain any MAC address of the Sticky-Config
type, no information is displayed in the command output.
When the device has a large number of MAC address entries of the Sticky-Config
type, it is recommended that you specify parameters in the command to filter the
output information. If you do not specify these parameters, the following faults
may occur:
● The displayed information is repeatedly refreshed, so you cannot find the
required information.
● The system traverses and retrieves information for a long time, and does not
respond to any request.
Example
# Display all MAC address entries of the Sticky-Config type.
<HUAWEI> display mac-address sticky-config
------------------------------------------------------------------------------------
MAC Address VLAN/VSI/BD Learned-From Type
------------------------------------------------------------------------------------
0022-0022-0033 100/-/- GE0/0/1 sticky-config
0000-0000-0001 200/-/- GE0/0/2 sticky-config
------------------------------------------------------------------------------------
Total items displayed = 2
# Display detailed information about all MAC address entries of the Sticky-Config
type in VLAN 10.
<HUAWEI> display mac-address sticky-config vlan 10 verbose
-------------------------------------------------------------------------------
MAC Address : 0000-0000-0001 VLAN : 10
Learned-From: GE0/0/1 Type : sticky-config
-------------------------------------------------------------------------------
Total items displayed = 1
Format
port-security aging-time time [ type { absolute | inactivity } ]
undo port-security aging-time
NOTE
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After you run the port-security enable command to enable port security on an
interface, MAC address entries learned by the interface are saved in the MAC
address table as secure dynamic MAC addresses. The learned secure dynamic MAC
addresses will not be aged by default. When the number of learned MAC
addresses reaches the limit, the interface cannot learn new MAC addresses.
If MAC addresses learned by an interface can be trusted only for a certain period,
run the port-security aging-time command to set the aging time of secure
dynamic MAC addresses on the interface. Then secure dynamic MAC addresses
can be aged out and the interface can learn new MAC addresses.
Prerequisites
Port security is enabled on the interface.
Precautions
If the aging time of secure dynamic MAC addresses on an interface is shorter than
the global aging time of dynamic MAC addresses, secure dynamic MAC addresses
are aged out when the global aging time expires.
If you run the port-security aging-time command multiple times in the same
interface view, only the latest configuration takes effect.
Example
# Set the aging time of secure dynamic MAC addresses on GE0/0/1 to 30 minutes.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-security enable
[HUAWEI-GigabitEthernet0/0/1] port-security aging-time 30
Format
port-security enable
undo port-security enable
Parameters
None
Views
GE interface view, Ethernet interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After port security is enabled on an interface, MAC address entries learned by the
interface are stored in the MAC address table as secure dynamic MAC address
entries. By default, secure dynamic MAC addresses will not be aged out. If the
aging time of secure dynamic MAC address entries is set, these entries will be
aged out. After the device restarts, secure dynamic MAC address entries are lost
and need to be relearned. You can also create secure static MAC addresses which
do not age out.
Port security has the following functions:
● Prevent unauthorized guests from using their computers to connect to an
enterprise network.
Example
# Enable port security on GigabitEthernet0/0/2.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/2
[HUAWEI-GigabitEthernet0/0/2] port-security enable
Format
port-security mac-address mac-address vlan vlan-id
undo port-security mac-address mac-address vlan vlan-id
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface
view,MultiGE interface view,40GE interface view,100GE interface view, Eth-Trunk
interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After port security is enabled on an interface using the port-security enable
command, MAC address entries learned by the interface are stored in the MAC
address table as secure dynamic MAC address entries.
When the interface becomes Down or the device is reset, static secure MAC
addresses are not affected, and dynamic secure MAC addresses need to be learned
again. Static secure MAC addresses are not aged out. Static secure MAC addresses
have a higher priority than dynamic secure MAC addresses.
Prerequisites
Port security has been enabled by using the port-security enable command on
the interface.
Precautions
Running the port-security mac-address mac-address vlan vlan-id command
multiple times configures multiple static secure MAC addresses.
A static secure MAC address cannot be a VRRP virtual MAC address or system
MAC address.
Example
# Configure a static secure MAC address entry on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-security enable
[HUAWEI-GigabitEthernet0/0/1] port-security mac-address 00e0-fc12-3456 vlan 10
Function
The port-security mac-address command configures a static secure MAC address
of the Sticky-Config type.
Format
port-security mac-address sticky-config mac-address vlan vlan-id
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface
view,MultiGE interface view,40GE interface view,100GE interface view, Eth-Trunk
interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the interface becomes Down or the device is reset, static secure MAC
addresses are not affected, and dynamic secure MAC addresses need to be learned
again. Static secure MAC addresses are not aged out. Static secure MAC addresses
have higher priority than dynamic secure MAC addresses. You can run this
command to configure a static secure MAC address of the Sticky-Config type.
Prerequisites
1. Port security has been enabled using the port-security enable command.
2. The sticky MAC function on an interface has been enabled using the port-
security mac-address sticky command.
Precautions
You can manually configure one or more static secure MAC address entries of the
Sticky-Config type. You run the port-security mac-address sticky-config mac-
address vlan vlan-id command multiple times to configure multiple static secure
MAC address entries of the Sticky-Config type.
A static secure MAC address of the Sticky-Config type cannot be a VRRP virtual
MAC address or a system MAC address.
Example
# Configure a static secure MAC address entry of the Sticky-Config type on
GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-security enable
[HUAWEI-GigabitEthernet0/0/1] port-security mac-address sticky
[HUAWEI-GigabitEthernet0/0/1] port-security mac-address sticky-config 00e0-fc12-3456 vlan 10
Function
The port-security mac-address sticky command enables the sticky MAC function
on an interface.
The undo port-security mac-address sticky command disables the sticky MAC
function on an interface.
Format
port-security mac-address sticky [ mac-address vlan vlan-id ]
undo port-security mac-address sticky [ mac-address vlan vlan-id ]
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface
view,MultiGE interface view,40GE interface view,100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After port security is enabled on an interface using the port-security enable
command, MAC address entries learned by the interface are stored in the MAC
address table as secure dynamic MAC address entries.
After the sticky MAC function is enabled on an interface, the dynamic MAC
addresses learned by the interface change to sticky MAC addresses.
Before the number of sticky MAC addresses reaches the limit on the interface, the
MAC addresses learned subsequently are still converted into sticky MAC addresses.
When the number of sticky MAC addresses reaches the limit, non-sticky MAC
addresses are discarded. In addition, the system determines whether to send a
trap message based on the configuration of the interface protection mode.
After enabling the sticky MAC function on an interface using the port-security
mac-address sticky command, you can run the port-security mac-address sticky
mac-address vlan vlan-id command to manually configure a sticky MAC address
entry.
Prerequisites
Port security has been enabled by using the port-security enable command on
the interface.
Precautions
Running the undo port-security mac-address sticky command will convert the
sticky MAC addresses on the interface into secure dynamic MAC addresses.
The configuration information is not displayed after you run the port-security
mac-address sticky mac-address vlan vlan-id command to configure sticky MAC
address entries.
A sticky MAC address cannot be a VRRP virtual MAC address or a system MAC
address.
Example
# Enable the sticky MAC function on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-security enable
[HUAWEI-GigabitEthernet0/0/1] port-security mac-address sticky
Function
The port-security max-mac-num command sets the maximum number of secure
MAC addresses that can be learned on an interface.
Format
port-security max-mac-num max-number
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After enabling port security on an interface, you can run the port-security max-
mac-num command to limit the number of MAC addresses that the interface can
learn. If the switch receives packets with a nonexistent source MAC address after
the number of secure MAC addresses reaches the limit, the switch considers that
the packets are sent from an unauthorized user, regardless of whether the
destination MAC address of packets is valid, and takes the action configured using
the port-security protect-action command on the interface. This prevents
untrusted users from accessing these interfaces, improving security of the switch
and the network.
Precautions
● The total number of MAC addresses on interfaces enabled with port security
cannot exceed 4096. For example, if the numbers of MAC addresses learned
on interfaces 1, 2, 3, and 4 are 1000 respectively, interface 5 can learn a
maximum of 96 MAC addresses.
Example
# Set the maximum number of MAC addresses that can be learned by
GigabitEthernet0/0/1 to 5.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-security enable
[HUAWEI-GigabitEthernet0/0/1] port-security max-mac-num 5
Format
port-security protect-action { protect | restrict | shutdown }
undo port-security protect-action
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After enabling port security, you can run the port-security protect-action
command to configure the action performed on the interface when the number of
learned MAC addresses on an interface exceeds the upper limit or static MAC
address flapping is detected.
The default action restrict is recommended. If the action is set to shutdown on an
interface connected to a downstream device, the interface discards packets from
trusted MAC addresses. Select the shutdown action only when the interface is
directly connected to a user terminal.
Prerequisites
Port security has been enabled by using the port-security enable command on
the interface.
Precautions
The interface takes protection actions when detecting static MAC address flapping
only after the port-security static-flapping protect command is executed.
If the action is set to shutdown, the interface takes the error down action when
the number of learned MAC addresses exceeds the limit or static MAC address
flapping is detected. In addition, the interface status will not be automatically
recovered.
If you run the port-security protect-action command multiple times in the same
interface view, only the latest configuration takes effect.
If both port security and traffic policy-based VLAN translation are configured on
an interface of the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6735-S,
S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S, the interface
can forward protocol packets with source MAC addresses out of the MAC address
table when the number of learned MAC addresses exceeds the limit.
Example
# Set the protection action on GigabitEthernet0/0/1 to protect.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-security enable
[HUAWEI-GigabitEthernet0/0/1] port-security protect-action protect
Format
port-security static-flapping protect
undo port-security static-flapping protect
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Secure MAC addresses are also static MAC address. When an interface receives a
packet whose source MAC address exists in the static MAC address table on
another interface, the interface discards this packet. This affects customer services.
For example, if PC 1 connects to GE0/0/1 where the sticky MAC address function is
enabled, the static MAC address table of GE0/0/1 includes PC 1's MAC address.
After PC 1 is disconnected from GE0/0/1 and then connected to GE0/0/2, GE0/0/2
discards the packets from PC 1. In this situation, you can enable static MAC
address flapping detection. The interface will then take the configured action for
the GE0/0/2.
Precautions
Static MAC address flapping detection needs to be enabled only on the interfaces
with port security enabled.
Example
# Enable static MAC address flapping detection.
<HUAWEI> system-view
[HUAWEI] port-security static-flapping protect
Format
undo mac-address { sec-config | security | sticky } [ interface-type interface-
number | vlan vlan-id ] *
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
After port security is enabled on an interface, dynamic MAC address entries
learned by the interface turn into secure MAC address entries. Secure MAC address
entries are not aged out. After the number of MAC address entries learned by an
interface reaches the limit, the interface cannot learn new MAC address entries.
Packets matching no MAC address entry are broadcast, wasting bandwidth
resources. This command can delete useless secure MAC address entries to release
the MAC address table space.
You can delete some of secure MAC address entries as required. For example:
● If you do not specify interface-type interface-number, the command deletes
MAC address entries of the specified type on all interfaces.
● If you do not specify vlan vlan-id, the command deletes MAC address entries
of the specified type in all VLANs.
Example
# Delete all static secure MAC address entries.
<HUAWEI> system-view
[HUAWEI] undo mac-address sec-config
Format
arp dhcp-snooping-detect enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After a DHCP client sends a DHCP Release message to release its IP address, the
DHCP snooping-enabled device immediately deletes the binding entry of the
DHCP client. If a DHCP client is abnormally disconnected and cannot send a DHCP
Release message, the DHCP snooping-enabled device cannot immediately delete
the binding entry of the DHCP client.
If association between ARP and DHCP snooping is enabled using this command
and no ARP entry corresponding to the IP address in the DHCP snooping binding
entry is found, the DHCP snooping-enabled device performs an ARP probe on the
IP address. If no user is detected for consecutive four times, the DHCP snooping-
enabled device deletes the DHCP snooping binding entry corresponding to the IP
address. (The probe interval is 20 seconds, and the probe times and probe interval
are fixed values and cannot be modified.) If the DHCP snooping-enabled device
supports the DHCP relay function, this device then sends a DHCP Release message
in place of the DHCP client to notify the DHCP server to release the IP address.
Prerequisites
Before association between the ARP and DHCP snooping is enabled, ensure that
an IP address configured on the device is on the same network segment as the IP
address of the client for ARP probe.
Example
# Enable association between ARP and DHCP snooping on the device.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] arp dhcp-snooping-detect enable
Function
The dhcp option82 append vendor-specific command inserts the Sub9 suboption
into Option 82.
The undo dhcp option82 append vendor-specific command restores the default
configuration.
By default, Sub9 suboption is not inserted into the Option 82 field of DHCP
messages.
Format
dhcp option82 append vendor-specific
Parameters
None
Views
Interface view, VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The Sub9 suboption has old and new formats. The old format contains the vendor
ID, for example, hwid. The new format does not contain the vendor ID.
Both the dhcp option82 append vendor-specific and dhcp option82 vendor-
specific format commands can insert the Sub9 into the Option 82 field of the
DHCP message, except that the Sub9 formats are different:
● dhcp option82 append vendor-specific: inserts the Sub9 of the new format.
The new format includes the location information such as the node identifier,
node chassis ID, node slot ID, node port number, and user VLAN.
● dhcp option82 vendor-specific format: inserts the Sub9 of the old format.
The old format includes the DHCP client information such as user IP address
and device name.
Prerequisites
DHCP has been enabled globally using the dhcp enable command.
Precautions
● When both the dhcp option82 append vendor-specific and dhcp option82
vendor-specific format commands are run, the dhcp option82 append
vendor-specific command takes effect.
● The Sub9 suboption can be inserted into Option 82 only when the Sub9
format is the same as the DHCP packet format. If the formats are different:
– If the dhcp option82 vendor-specific format command has been run,
the Sub9 of the new format cannot be inserted into Option 82.
Example
# Insert the Sub9 suboption into the Option 82 field of DHCP messages.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 append vendor-specific
Function
The dhcp option82 enable command enables a device to insert the Option 82
field to a DHCP message.
The undo dhcp option82 enable command disables a device from inserting the
Option 82 field to a DHCP message.
By default, a device does not insert the Option 82 field to a DHCP message.
Format
In the interface view, BD view and port group view
dhcp option82 { insert | rebuild } enable
undo dhcp option82 { insert | rebuild } enable
In the VLAN view
dhcp option82 { insert | rebuild } enable interface interface-type interface-
number1 [ to interface-number2 ]
undo dhcp option82 { insert | rebuild } enable interface interface-type
interface-number1 [ to interface-number2 ]
Parameters
Parameter Description Value
Views
VLAN view, Ethernet interface view, GE interface view, MultiGE interface view, XGE
interface view, 25GE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The Option 82 field records the location of a DHCP client. A device inserts the
Option 82 field to a DHCP Request message to notify the DHCP server of the
DHCP client location. The DHCP server can assign an IP address and other
configurations to the DHCP client, ensuring DHCP client security.
The device inserts the Option 82 field to a DHCP message in two modes:
● Insert mode: Upon receiving a DHCP Request message without the Option 82
field, the device inserts the Option 82 field. If the DHCP Request message
contains the Option 82 field, the device checks whether the Option 82 field
contains the remote ID. If so, the device retains the Option 82 field; if not, the
device inserts the remote ID.
● Rebuild mode: Upon receiving a DHCP Request message without the Option
82 field, the device inserts the Option 82 field. If the DHCP Request message
contains the Option 82 field, the device deletes the original Option 82 field
and inserts the Option 82 field set by the administrator.
The device handles the reply packets from the DHCP server in the same way
regardless of whether the Insert or Rebuild method is used.
– If the DHCP request packets contain Option 82, the device changes the
Option 82 format in the DHCP reply packets into the Option 82 format in
the DHCP request packets, and forwards the packets to the DHCP client.
● If the DHCP reply packets do not contain Option 82, the device directly
forwards the packets.
NOTE
The physical interface can insert Option82 to the DHCP packets directly forwarded, but does not
insert Option82 to the DHCP packets forwarded through a tunnel.
Prerequisites
DHCP snooping has been enabled on the device, or the device has been
configured as a DHCP relay agent.
Precautions
● When receiving a DHCP Request message, the device checks whether the field
GIADDR in the packet is 0. If so, the dhcp option82 enable command takes
effect; if not, this command does not take effect.
● DHCP Option 82 must be configured on the user-side of a device; otherwise,
the DHCP messages sent to the DHCP server will not carry Option 82.
Example
# Enable the device to insert the Option 82 field to DHCP messages on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 insert enable
Function
The dhcp option82 encapsulation command configures suboptions inserted into
the DHCP Option 82 field.
By default, the circuit-id (CID), remote-id (RID), subscriber-id (SID), and Sub9
suboptions are inserted into the DHCP Option 82 field in the system view.
By default, suboptions of the DHCP Option 82 field are not inserted in other views.
Format
dhcp option82 encapsulation { circuit-id | remote-id | subscriber-id | vendor-
specific-id } *
Parameters
Parameter Description Value
Views
System view, VLAN view, interface view, BD view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
This function applies to a DHCP relay agent or a DHCP snooping-enabled device.
The Option 82 field records the location of a DHCP client. A device inserts the
Option 82 field to a DHCP Request message to notify the DHCP server of the
DHCP client location. The DHCP server can assign an IP address and other
configurations to the DHCP client, ensuring DHCP client security. The
administrator can run this command to configure the device to insert one or more
of the circuit-id suboption, remote-id suboption, subscriber-id suboption, and
vendor-specific suboption in the Sub9 field into the DHCP Option 82 field. After
the command is run, suboptions that are not configured to be inserted are not
inserted into the DHCP Option 82 field by default.
Prerequisites
The DHCP function has been enabled in the system view using the dhcp enable
command.
Example
# Insert the circuit-id suboption into the DHCP Option 82 field.
<HUAWEI> system-view
[HUAWEI] dhcp option82 encapsulation circuit-id
Format
dhcp option82 [ vlan vlan-id ] [ ce-vlan ce-vlan-id ] [ circuit-id | remote-id ]
format { default | common | extend | user-defined text }
undo dhcp option82 [ vlan vlan-id ] [ ce-vlan ce-vlan-id ] [ circuit-id | remote-
id ] format
Parameters
Parameter Description Value
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the function of inserting the Option 82 field to DHCP messages is enabled,
you can use the dhcp option82 format command to configure the format of the
Option 82 field.
If you run the dhcp option82 format command in the system view, the command
takes effect for all the DHCP messages on all the interfaces of the device.
You can use the following keywords to define the Option 82 field. The format
string can use the hexadecimal notation, ASCII format, or combination of the two
formats.
● sysname: indicates the ID of the access point. This keyword is valid only in
ASCII format.
● portname: indicates the name of a port, for example, GE0/0/1. This keyword is
valid only in ASCII format.
● porttype: indicates the type of a port. This keyword is a character string or in
hexadecimal notation. For example, if the value is Ethernet in ASCII format, it
is 15 in hexadecimal notation.
● iftype: indicates the type of an interface, which can be eth or trunk. This
keyword is valid only in ASCII format.
● mac: indicates the MAC address of a port. In ASCII format, the value is in the
format of H-H-H; in hexadecimal notation, the value is a number of six bytes.
● slot: indicates the slot ID. This keyword is valid in ASCII format or in
hexadecimal notation.
● subslot: indicates the subslot ID. This keyword is valid in ASCII format or in
hexadecimal notation.
● port: indicates the port number. This keyword is valid in ASCII format or in
hexadecimal notation.
● svlan: indicates the outer VLAN ID. The value ranges from 1 to 4094. If this
field is not required, this field is 0. This keyword is valid in ASCII format or in
hexadecimal notation.
● cvlan: specifies the inner VLAN ID. The value ranges from 1 to 4094. If this
field is not required, this field is 0. This keyword is valid in ASCII format or in
hexadecimal notation.
● length: indicates the total length of the keywords following the keyword
length.
● n: indicates the value of the keyword svlan or cvlan if the SVLAN or CVLAN
does not exist. The keyword n is on the left of the keyword svlan or cvlan. If
the corresponding VLAN does not exist, the default value of the keyword
svlan or cvlan is 4096 in ASCII format and is all Fs in hexadecimal notation. If
the n keyword is added to the left of the keyword svlan or cvlan, the keyword
svlan or cvlan is 0. This keyword is valid in ASCII format or in hexadecimal
notation.
NOTE
Delimiters must be added between keywords; otherwise, the device cannot parse the
keywords. The delimiters cannot be numbers.
The keyword length can be configured only once.
● A number to the left of the symbol % indicates the length of the keyword
following the symbol %. In an ASCII character string, %05 has the same
meaning as %05d in the C language. In a hexadecimal character string, the
number indicates the keyword length in bits.
● The symbol [] indicates an optional keyword. Each pair of brackets can
contain only one keyword, svlan or cvlan. The keyword in the symbol [] is
added to the Option 82 field only if the corresponding VLAN ID exists. To
facilitate syntax check, the system does not support nesting of symbols [].
● The symbol \ indicates an escape character. The symbols %, \, and []
following the escape character indicate themselves. For example, \\ represents
\.
● The contents in quotation marks (" ") are encapsulated in a character string,
and the contents outside the quotation marks are encapsulated in
hexadecimal notation.
● Other symbols are processed as common characters. The rules for setting the
format string in ASCII format or hexadecimal notation are as follows:
– An ASCII character string can contain Arabic numerals, uppercase letters,
lowercase letters, and the following symbols: ! @ # $ % ^ & * ( ) _ + | - =
\ [ ] { } ; : ' " / . , < > `.
– By default, the length of each keyword in an ASCII character string is the
actual length of the keyword.
– A hexadecimal notation string can contain numerals, spaces, and % +
keywords.
– In a hexadecimal notation string, numbers are encapsulated in the
Option 82 field in hexadecimal notation. A number from 0 to 255
occupies 1 byte; a number from 256 to 65535 occupies 2 bytes; a number
from 65536 to 4294967295 occupies 4 bytes. Numbers larger than
4294967295 are not supported. Multiple numbers must be separated by
spaces; otherwise, they are considered as one number.
– All the spaces in a hexadecimal character string are ignored.
– By default, the slot ID, subslot ID, port number, and VLAN ID in a
hexadecimal character string occupy 2 bytes; the field length occupies 1
byte.
– If the length of each keyword in a hexadecimal character string is
specified, the total length of the hexadecimal character string must be a
multiple of 8. If the length of a specified keyword is longer than 32 bits,
the first 32 bits of the keyword are the actual keyword value, and other
bits are set to 0.
– A hexadecimal notation string can contain only the keywords whose
values are numbers. Other keywords, such as port name, cannot be
added to the hexadecimal notation string.
– If a string is not contained in quotation marks, it is encapsulated in
hexadecimal notation. To encapsulate the string in the ASCII format, use
a pair of quotation marks to contain the string. For example, the slot ID
is 3, and the port number is 4. If the string is in the %slot %port format,
the value of the encapsulated string is a hexadecimal number 00030004.
If the string is in the "%slot %port" format, the value of the encapsulated
string is 3 4.
– A format string can contain both hexadecimal strings and ASCII strings,
for example, %slot %port "%sysname %portname:%svlan.%cvlan."
Prerequisites
DHCP has been enabled globally using the dhcp enable command.
Precautions
● All Option82 fields configured in the system view or in the same interface
view share a length of 1-255 bytes. If their total length exceeds 255 bytes,
some Option82 information will be lost.
● There is no limit on the number of Option 82 fields configured on the device.
However, a large number of Option 82 fields will occupy a lot of memory and
prolong the device processing time. To ensure device performance, you are
advised to configure Option 82 fields based on the service requirements and
device memory size.
Example
# Configure the default format for the CID in the Option 82 field.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp option82 circuit-id format default
# Configure the extended format for the CID and RID in the Option 82 field.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp option82 format extend
# Configure the user-defined string for the CID in the Option 82 field and
encapsulate the port name, outer VLAN ID, inner VLAN ID, and host name in ASCII
format.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp option82 circuit-id format user-defined "%portname:%svlan.%cvlan %sysname"
# Configure a hexadecimal notation string for the CID of the Option 82 field and
encapsulate the CID type (fixed as 0, indicating the hexadecimal notation), length
(excluding the lengths of the CID type and the keyword length itself), outer VLAN
ID, slot ID (5 bits), subcard ID (3 bits), and port ID (8 bits).
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp option82 circuit-id format user-defined 0 %length %svlan %5slot %3subslot %8port
# Configure the user-defined string for the RID in the Option 82 field and
encapsulate the device MAC address in hexadecimal notation.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp option82 remote-id format user-defined %mac
# On GE0/0/1, configure the default format for the CID in the Option 82 field.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 circuit-id format default
# On GE0/0/1, configure the extended format for the CID and RID in the Option
82 field of DHCP messages from VLAN 10.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 vlan 10 format extend
# On GE0/0/1, configure a user-defined format for the CID in the Option 82 field
and encapsulate the port name, outer VLAN ID, inner VLAN ID, and host name in
ASCII format.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 circuit-id format user-defined "%portname:%svlan.
%cvlan %sysname"
# On GE0/0/1, configure a hexadecimal notation string for the CID of the Option
82 field and encapsulate the CID type (fixed as 0, indicating the hexadecimal
notation), length (excluding the lengths of the CID type and the keyword length
itself), outer VLAN ID, slot ID (5 bits), subcard ID (3 bits), and port ID (8 bits).
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 circuit-id format user-defined 0 %length %svlan %5slot
%3subslot %8port
# On GE0/0/1, configure the user-defined format for the RID in the Option 82
field and encapsulate the device MAC address in hexadecimal notation.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 remote-id format user-defined %mac
Function
The dhcp option82 subscriber-id format command inserts the Sub6 suboption
into the DHCP Option 82 field of DHCP messages and configures the format of
the Sub6 suboption.
By default, the Sub6 suboption is not inserted into the DHCP Option 82 field of
DHCP messages.
Format
dhcp option82 subscriber-id format { ascii ascii-text | hex hex-text }
Parameters
ascii ascii-text Specifies the ASCII The value is an ASCII character string
character string in the and contains fewer than 129 characters.
Sub6 field.
hex hex-text Specifies the HEX The value is in hexadecimal notation. The
character string in the value can contain only digits 0 to 9,
Sub6 field. uppercase letters A to F, and lowercase
letters a to f. If no space is included, the
value length must be an even number
smaller than 257.
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Prerequisites
Example
# Configure the Sub6 suboption inserted into the DHCP Option 82 field of DHCP
messages on GE0/0/1 and specify the ASCII character string in the Sub6 suboption.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp option82 subscriber-id format ascii hw
Format
dhcp option82 vendor-specific format vendor-sub-option sub-option-num
{ ascii ascii-text | hex hex-text | ip-address ip-address &<1-8> | sysname }
undo dhcp option82 vendor-specific format vendor-sub-option sub-option-num
Parameters
Parameter Description Value
ascii ascii-text Specifies the ASCII character The value is an ASCII character
string in the vendor-specific string and must be smaller
suboption in the Sub9 field. than 129 characters.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
In authentication for wired Ethernet access using DHCP, DHCP snooping, and
Option 82, a device can insert suboptions (suboption 1, suboption 2, and
suboption 9) to the Option 82 field in DHCP Request messages. These suboptions
in DHCP Request messages carry information about user device locations.
Unauthorized users cannot access the network by static IP addresses or embezzled
accounts of authorized users. The dhcp option82 vendor-specific format
command configures the suboptions in the Sub9 field.
Prerequisites
Example
# Insert the device name to the vendor-specific suboption 1 in the Sub9 field.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp option82 vendor-specific format vendor-sub-option 1 sysname
The undo dhcp server detect command disables detection of DHCP servers.
Format
dhcp server detect
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If bogus DHCP servers exist on the network, they send incorrect information to
DHCP clients, such as the incorrect gateway address, incorrect DNS server, and
incorrect IP address. As a result, DHCP clients cannot access the network or access
incorrect networks.
After detection of DHCP servers is enabled, a DHCP snooping device checks and
stores all information about DHCP servers in the DHCP Reply messages, such as
DHCP server address and DHCP client port number, in the log. Based on logs, the
network administrator checks for bogus DHCP servers on the network to maintain
the network.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Example
# Enable detection of DHCP servers.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp server detect
Format
dhcp snooping alarm dhcp-rate enable [ threshold threshold ]
undo dhcp snooping alarm dhcp-rate enable [ threshold ]
Parameters
Parameter Description Value
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled, the device sends all the received DHCP Request
messages and Reply messages to the processing unit. If the rate of sending DHCP
messages is high, processing efficiency of the processing unit is affected. After the
dhcp snooping check dhcp-rate enable command is run, the device checks the
rate of sending DHCP messages. DHCP messages that are sent in a specified rate
are sent to the processing unit and those that exceed the rate are discarded.
If the number of discarded DHCP messages reaches the threshold, an alarm is
generated. To set the alarm threshold, run the dhcp snooping alarm dhcp-rate
threshold command.
If you run the dhcp snooping alarm dhcp-rate enable command in the system
view, the command takes effect on all the interfaces of the device. If you run the
dhcp snooping alarm dhcp-rate enable command in the interface view, the
command only takes effect on the specified interface.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
To ensure that alarms can be properly reported, you need to run the snmp-agent
trap enable feature-name dhcp command to enable the DHCP module to report
the corresponding alarm. You can check whether the DHCP module is enabled to
report the corresponding alarm using the display snmp-agent trap feature-name
dhcp all command.
Example
# In the system view, enable the device to generate an alarm when the number of
discarded DHCP messages reaches the threshold.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping check dhcp-rate enable
[HUAWEI] dhcp snooping alarm dhcp-rate enable
# Enable the device to generate an alarm when the number of discarded DHCP
messages reaches the threshold on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping check dhcp-rate enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping alarm dhcp-rate enable
Format
dhcp snooping alarm dhcpv6-rate enable
undo dhcp snooping alarm dhcpv6-rate enable
Parameters
None
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, Eth-Trunk interface
view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled, the device sends all the received DHCPv6
messages to the processing unit. If the rate of sending DHCPv6 messages is high,
processing efficiency of the processing unit is affected. After the device is enabled
to check the rate of sending DHCPv6 messages to the processing unit using the
dhcp snooping check dhcpv6-rate enable command, DHCPv6 messages that are
sent in a specified rate are sent to the processing unit and those that exceed the
rate are discarded.
If the dhcp snooping alarm dhcpv6-rate enable command is run, the device
generates an alarm when the number of discarded DHCPv6 messages reaches the
threshold. You can configure the alarm threshold using the dhcp snooping alarm
dhcpv6-rate threshold command.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
If the dhcp snooping alarm dhcpv6-rate enable command is run in the system
view, the configuration takes effect for all the interfaces on the device. If this
command is run in the interface view, the configuration takes effect only for the
specified interface.
To ensure that alarms can be properly reported, you need to run the snmp-agent
trap enable feature-name dhcp command to enable the DHCP module to report
the corresponding alarm. You can check whether the DHCP module is enabled to
report the corresponding alarm using the display snmp-agent trap feature-name
dhcp all command.
Example
# In the system view, enable the device to generate an alarm when the number of
discarded DHCPv6 messages reaches the alarm threshold.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping alarm dhcpv6-rate enable
Function
The dhcp snooping alarm dhcp-rate threshold command sets the alarm
threshold for the number of discarded DHCP messages.
The undo dhcp snooping alarm dhcp-rate threshold command restores the
default alarm threshold for the number of discarded DHCP messages.
By default, the global alarm threshold for the number of discarded DHCP
messages is 100, and the alarm threshold for the number of discarded DHCP
messages on an interface is the same as that configured in the system view.
Format
dhcp snooping alarm dhcp-rate threshold threshold
undo dhcp snooping alarm dhcp-rate threshold
Parameters
Parameter Description Value
threshold Specifies the alarm threshold. If the The value is an integer that
number of discarded DHCP messages ranges from 1 to 1000. The
reaches the threshold, an alarm is default value is 100.
generated.
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After you run the dhcp snooping alarm dhcp-rate enable command to enable a
device to generate an alarm when the number of discarded DHCP messages
reaches the threshold, you can set the alarm threshold using the dhcp snooping
alarm dhcp-rate threshold command. An alarm is generated when the number
of discarded DHCP messages reaches the threshold.
If the alarm threshold is set in the system view and interface view, the smaller
value takes effect.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
To ensure that alarms can be properly reported, you need to run the snmp-agent
trap enable feature-name dhcp command to enable the DHCP module to report
the corresponding alarm. You can check whether the DHCP module is enabled to
report the corresponding alarm using the display snmp-agent trap feature-name
dhcp all command.
Example
# Set the alarm threshold for the number of discarded DHCP messages on
GE0/0/1 to 50.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping alarm dhcp-rate threshold 50
Function
The dhcp snooping alarm dhcpv6-rate threshold command sets the alarm
threshold for the number of discarded DHCPv6 messages.
The undo dhcp snooping alarm dhcpv6-rate threshold command restores the
default setting.
By default, the alarm threshold for globally discarded DHCPv6 messages is 100
packets, and the alarm threshold for discarded DHCPv6 messages on an interface
is the same as the configured value in the system view.
Format
dhcp snooping alarm dhcpv6-rate threshold threshold
Parameters
Parameter Description Value
threshold Specifies the alarm threshold. When The value is an integer that
the number of discarded DHCPv6 ranges from 1 to 1000, in
messages reaches the threshold, the packets.
device generates an alarm.
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, Eth-Trunk interface
view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the device is enabled to generate an alarm when the number of discarded
DHCPv6 messages reaches the threshold using the dhcp snooping alarm dhcpv6-
rate enable command, you can run the dhcp snooping alarm dhcpv6-rate
threshold threshold command to configure the alarm threshold for discarded
DHCPv6 messages. The device generates an alarm when the number of discarded
DHCPv6 messages reaches the configured alarm threshold.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
To ensure that alarms can be properly reported, you need to run the snmp-agent
trap enable feature-name dhcp command to enable the DHCP module to report
the corresponding alarm. You can check whether the DHCP module is enabled to
report the corresponding alarm using the display snmp-agent trap feature-name
dhcp all command.
Example
# Set the alarm threshold for discarded DHCPv6 messages to 500 packets in the
system view.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping alarm dhcpv6-rate threshold 500
Function
The dhcp snooping alarm enable command enables alarm for discarded DHCP
messages.
The undo dhcp snooping alarm enable command disables alarm for discarded
DHCP messages.
Format
dhcp snooping alarm { dhcp-request | dhcp-chaddr | dhcp-reply } enable
[ threshold threshold ]
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view, BD view, VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the alarm function is enabled, alarm messages are displayed if DHCP attacks
occur and the number of discarded attack messages reaches the threshold. The
minimum interval for sending alarm messages is 1 minute. You can run the dhcp
snooping alarm threshold command to set the alarm threshold.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
By default, a device does not check messages received by the clients. Therefore, to
make the command take effect, ensure the following is ready:
● The device has been enabled to check DHCP messages against the binding
entries using the dhcp snooping check dhcp-request enable command
before the dhcp snooping alarm [ dhcp-request | dhcpv6-request ] enable
command is run.
● The device has been enabled to check whether the CHADDR field is the same
as the source MAC address in the header of a DHCPv4 Request message using
the dhcp snooping check dhcp-chaddr enable command before the dhcp
snooping alarm dhcp-chaddr enable command is run.
To ensure that alarms can be properly reported, you need to run the snmp-agent
trap enable feature-name dhcp command to enable the DHCP module to report
the corresponding alarm. You can check whether the DHCP module is enabled to
report the corresponding alarm using the display snmp-agent trap feature-name
dhcp all command.
Example
# On GE0/0/1, enable DHCP snooping, enable the device to check whether the
CHADDR field in the DHCP message matches the source MAC address in the
Ethernet frame header, and enable alarm for the DHCP messages discarded
because the CHADDR field in the DHCP message does not match the source MAC
address.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping check dhcp-chaddr enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping alarm dhcp-chaddr enable
Format
In the system view:
Parameters
Parameter Description Value
threshold Specifies the alarm threshold for the number of The value is
DHCP snooping-discarded messages. an integer
that ranges
from 1 to
1000.
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view, VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After trap for discarded DHCP messages is enabled, run the dhcp snooping alarm
threshold command to specify the alarm threshold for the number of DHCP
messages discarded by DHCP snooping. If the alarm threshold is not set on an
interface, the interface uses the global alarm threshold.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
The DHCP snooping alarm function has been enabled using the dhcp snooping
alarm { dhcp-request | dhcp-chaddr | dhcp-reply | dhcpv6-request } enable
command.
Precautions
If you run the dhcp snooping alarm threshold command in the system view, the
command takes effect on all the interfaces of the device.
If you specify an alarm threshold for the number of DHCP messages discarded by
DHCP snooping in the system view, an alarm is generated when the number of all
the discarded DHCP messages reaches the threshold.
To ensure that alarms can be properly reported, you need to run the snmp-agent
trap enable feature-name dhcp command to enable the DHCP module to report
the corresponding alarm. You can check whether the DHCP module is enabled to
report the corresponding alarm using the display snmp-agent trap feature-name
dhcp all command.
Example
# Set the global alarm threshold for the number of discarded DHCP messages to
200.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping alarm threshold 200
# On GE0/0/1, enable DHCP snooping, enable the device to check whether the
CHADDR field in the DHCP message matches the source MAC address in the
Ethernet frame header, and enable alarm for the DHCP messages discarded
because the CHADDR field in the DHCP message does not match the source MAC
address. Set the alarm threshold to 1000.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping check dhcp-chaddr enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping alarm dhcp-chaddr enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping alarm dhcp-chaddr threshold 1000
Format
In the system view:
dhcp snooping check dhcp-giaddr enable vlan { vlan-id1 [ to vlan-id2 ] }
&<1-10>
undo dhcp snooping check dhcp-giaddr enable vlan { vlan-id1 [ to vlan-id2 ] }
&<1-10>
In the VLAN view and interface view:
dhcp snooping check dhcp-giaddr enable
undo dhcp snooping check dhcp-giaddr enable
Parameters
Parameter Description Value
vlan { vlan-id1 [ to Enables the device to check whether the The value is an
vlan-id2 ] } GIADDR field in DHCP messages sent from integer that
&<1-10> a specified VLAN is 0. ranges from 1
to 4094.
● vlan-id1 specifies the first VLAN ID.
● to vlan-id2 specifies the last VLAN ID.
vlan-id2 must be larger than vlan-id1.
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To ensure that the device obtains parameters such as MAC addresses for
generating a binding table, DHCP snooping needs to be applied to Layer 2 access
devices or the first DHCP relay agent from the device. Therefore, the GIADDR field
in the DHCP messages received by the DHCP snooping-enabled device is 0. If the
GIADDR field is not 0, the message is unauthorized and then discarded. This
function is recommended if DHCP snooping is enabled on the DHCP relay agent.
In normal situations, the GIADDR field in DHCP messages sent by user PCs is 0. If
the GIADDR field is not 0, the DHCP server cannot correctly allocate IP addresses.
To prevent attackers from applying IP addresses with the DHCP messages
containing a non-0 GIADDR field, you are advised to configure this function.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
If you run the dhcp snooping check dhcp-giaddr enable command in the VLAN
view, the command takes effect on all the DHCP messages from the specified
VLAN. If you run the dhcp snooping check dhcp-giaddr enable command in the
interface view, the command takes effect on all the DHCP messages received by
the specified interface.
Example
# Enable the device to check whether the GIADDR field in DHCP messages from
VLAN10 is 0.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcp snooping check dhcp-giaddr enable
# Enable the device to check whether the GIADDR field in DHCP messages
received on GE0/0/1 is 0.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping check dhcp-giaddr enable
Function
The dhcp snooping check dhcp-rate command sets the maximum rate of sending
DHCP messages to the processing unit.
The undo dhcp snooping check dhcp-rate command restores the default
maximum rate of sending DHCP messages to the processing unit.
By default, the maximum rate of sending global DHCP messages to the processing
unit is 100 pps, which is the same as the maximum rate of sending DHCP
messages on interfaces to the processing unit.
Format
In the system view:
dhcp snooping check dhcp-rate rate [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ]
undo dhcp snooping check dhcp-rate
In the VLAN view and interface view:
dhcp snooping check dhcp-rate rate
undo dhcp snooping check dhcp-rate
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled, the device sends all the received DHCP Request
messages and Reply messages to the processing unit. If the rate of sending DHCP
messages is high, processing efficiency of the processing unit is affected. After the
device is enabled to check the rate of sending DHCP messages to the processing
unit, run the dhcp snooping check dhcp-rate command to set the maximum rate
of sending DHCP messages to the processing unit. DHCP messages that exceed
the rate are discarded.
Prerequisites
The device has been enabled to check the rate of sending DHCP messages to the
processing unit using the dhcp snooping check dhcp-rate enable command.
Precautions
If the maximum rates of sending DHCP messages to the processing unit are set in
the system view, VLAN view, and interface view, the smallest value takes effect.
Example
# In the system view, set the maximum rate of sending DHCP messages to the
processing unit to 50 pps.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping check dhcp-rate enable
[HUAWEI] dhcp snooping check dhcp-rate 50
Format
dhcp snooping check dhcpv6-rate rate
undo dhcp snooping check dhcpv6-rate
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled, the device sends all the received DHCPv6
messages to the processing unit. If the rate of sending DHCPv6 messages is high,
processing efficiency of the processing unit is affected. After the device is enabled
to check the rate of sending DHCPv6 messages to the processing unit, DHCPv6
messages that exceed the specified rate are discarded.
Before the maximum rate of DHCP messages sent to the DHCP message
processing unit is configured, ensure that the dhcp snooping check dhcpv6-rate
enable command has been executed to enable the device to check the rate of
sending DHCPv6 messages to the processing unit. Otherwise, the configuration
does not take effect.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
● If you run the dhcp snooping check dhcpv6-rate command in the system
view, the configuration takes effect for all the interfaces on the device. If you
run this command in the interface view, the configuration takes effect only for
the specified interface. If you run this command in the VLAN view, the
configuration takes effect for all the interfaces in this VLAN.
● If the maximum rates of sending DHCPv6 messages to the processing unit are
set in the system view, VLAN view, and interface view simultaneously, the
smallest value takes effect.
Example
# In the system view, set the maximum rate of sending DHCPv6 messages to the
processing unit to 50 pps.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping check dhcpv6-rate 50
Function
The dhcp snooping check dhcp-rate enable command enables the device to
check the rate of sending DHCP messages to the processing unit.
The undo dhcp snooping check dhcp-rate enable command disables the device
from checking the rate of sending DHCP messages to the processing unit.
By default, the device does not check the rate of sending DHCP messages to the
processing unit.
Format
In the system view:
dhcp snooping check dhcp-rate enable [ rate ] [ vlan { vlan-id1 [ to vlan-id2 ] }
&<1-10> ]
undo dhcp snooping check dhcp-rate enable [ vlan { vlan-id1 [ to vlan-id2 ] }
&<1-10> ]
In the VLAN view and interface view:
dhcp snooping check dhcp-rate enable [ rate ]
undo dhcp snooping check dhcp-rate enable
Parameters
Parameter Description Value
vlan { vlan-id1 Enables the device to check the rate of The value is an
[ to vlan-id2 ] } sending DHCP messages from a specified integer that
&<1-10> VLAN to the processing unit. ranges from 1 to
● vlan-id1 specifies the first VLAN ID. 4094.
● to vlan-id2 specifies the last VLAN ID.
vlan-id2 must be larger than vlan-id1.
If this parameter is not specified, the
command takes effect on all the DHCP
messages.
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled, the device sends all the received DHCP Request
messages and Reply messages to the processing unit. If the rate of sending DHCP
messages is high, processing efficiency of the processing unit is affected. After the
device is enabled to check the rate of sending DHCP messages to the processing
unit, DHCP messages that exceed the specified rate are discarded.
The default maximum rate of sending DHCP messages is 100 pps. To set the
maximum rate, run the dhcp snooping check dhcp-rate command.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Example
# In the system view, enable the device to check the rate of sending DHCP
messages to the processing unit.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping check dhcp-rate enable
# In VLAN 10, enable the device to check the rate of sending DHCP messages to
the processing unit.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcp snooping enable
[HUAWEI-vlan10] dhcp snooping check dhcp-rate enable
Function
The dhcp snooping check dhcpv6-rate enable command enables the device to
check the rate of sending DHCPv6 messages to the processing unit.
The undo dhcp snooping check dhcpv6-rate enable command disables the
device from checking the rate of sending DHCPv6 messages to the processing unit.
By default, the device does not check the rate of DHCPv6 messages sent to the
processing unit.
Format
dhcp snooping check dhcpv6-rate enable
Parameters
None
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled, the device sends all the received DHCPv6
messages to the processing unit. If the rate of sending DHCPv6 messages is high,
processing efficiency of the processing unit is affected. After the device is enabled
to check the rate of sending DHCPv6 messages to the processing unit, DHCPv6
messages that exceed the specified rate are discarded.
After the device is enabled to check the rate of sending DHCPv6 messages to the
processing unit, the default maximum rate of sending DHCPv6 messages is set to
100 pps. To set the maximum rate, run the dhcp snooping check dhcpv6-rate
command.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
If you run the dhcp snooping check dhcpv6-rate enable command in the system
view, the configuration takes effect for all the interfaces on the device. If you run
this command in the interface view, the configuration takes effect only for the
specified interface. If you run this command in the VLAN view, the configuration
takes effect for all the interfaces in this VLAN.
Example
# In the system view, enable the device to check the rate of DHCPv6 messages
sent to the processing unit.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping check dhcpv6-rate enable
Format
dhcp snooping check dhcpv6-request mac
undo dhcp snooping check dhcpv6-request mac
Parameters
None
Views
System view, VLAN view, GE interface view, XGE interface view, 25GE interface
view, MultiGE interface view, 40GE interface view, Eth-Trunk interface view, port
group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After binding entries generated, the device searches for the binding entries based
on the MAC address entry that is used as the key. The device checks whether the
DHCPv6 Request and DHCPv6 Release messages match any binding entry. If they
match, the device forwards the messages; otherwise, the device discards the
messages. This prevents unauthorized users from sending bogus DHCPv6
messages to extend the IP address lease or release IP addresses.
The rules for checking DHCPv6 Request and DHCPv6 Release messages based on
binding entries are as follows:
● When receiving a DHCPv6 Request message, the device searches the binding
table based on the user's MAC address. If no corresponding binding entry is
found or the binding entry found is a temporary one, the device forwards the
message. Otherwise, the device considers the message as the one used for
extending the IP address lease and checks whether the VLAN ID, IP address,
and interface number of the message match the corresponding binding entry.
If so, the device forwards the message. If not, the device discards the
message.
● When receiving a DHCPv6 Release message, the device checks whether the
VLAN ID, IP address, and interface number of the message match a dynamic
binding entry. If so, the device forwards the message; otherwise, the device
discards the message.
Prerequisites
DHCPv6 snooping has been enabled on the device using the dhcp snooping
enable command.
Follow-up Procedure
Precautions
If you run this command in the VLAN view, the command configuration takes
effect only for the DHCPv6 messages from the specified VLAN. If you run this
command in the interface view, the command configuration takes effect for all
DHCPv6 messages on the specified interface.
This command cannot be used together with dhcp snooping enable no-user-
binding; otherwise, online users may fail to go offline.
Example
# Enable the function of checking the validity of DHCPv6 messages based on MAC
addresses in VLAN 10.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcp snooping check dhcpv6-request mac
Function
The dhcp snooping check dhcp-chaddr enable command enables the device to
check whether the CHADDR field matches the source MAC address in the header
of a DHCP Request message.
The undo dhcp snooping check dhcp-chaddr enable command disables the
device from checking whether the CHADDR field matches the source MAC address
in the header of a DHCP Request message.
By default, the device does not check whether the CHADDR field is the same as
the source MAC address in the header of a DHCP Request message.
Format
In the system view:
Parameters
Parameter Description Value
vlan { vlan-id1 [ to Enables the device to check whether the The value is an
vlan-id2 ] } CHADDR field matches the source MAC integer that
&<1-10> address in the header of a DHCP Request ranges from 1
message. to 4094.
● vlan-id1 specifies the first VLAN ID.
● to vlan-id2 specifies the last VLAN ID.
vlan-id2 must be larger than vlan-id1.
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
In normal situations, the CHADDR field in a DHCP Request message matches the
MAC address of the DHCP client that sends the message. The DHCP server
identifies the client MAC address based on the CHADDR field in the DHCP Request
message. If attackers continuously apply for IP addresses by changing the
CHADDR field in the DHCP Request message, addresses in the address pool on the
DHCP server may be exhausted. As a result, authorized users cannot obtain IP
addresses.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
If you run the dhcp snooping check dhcp-chaddr enable command in the VLAN
view, the command takes effect on all the DHCP messages in the specified VLAN
received by all the interfaces on the device. If you run the dhcp snooping check
dhcp-chaddr enable command in the interface view, the command takes effect
for all the DHCP messages received on the interface.
Example
# Enable the device to check whether the CHADDR field in the DHCP message
matches the source MAC address on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] dhcp enable
Function
The dhcp snooping check dhcp-request enable command enables the device to
check DHCP messages against the DHCP snooping binding table.
The undo dhcp snooping check dhcp-request enable command disables the
device from checking DHCP messages against the DHCP snooping binding table.
By default, the device does not check DHCP messages against the DHCP snooping
binding table.
Format
System view:
Parameters
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After a DHCP snooping binding table is generated, the device checks DHCPv4
Request, DHCPv6 Request, or DHCPv4 Release messages against the DHCP
snooping binding table. Only DHCP messages that match entries are forwarded,
and those that do not match entries are discarded. This prevents unauthorized
users from sending bogus DHCP packets to renew or release IP addresses.
The device checks DHCPv4 Request, DHCPv6 Request, or DHCPv4 Release
messages against the DHCP snooping binding table based on the following rules:
● For a DHCPv4 Request message:
a. Checks whether the destination MAC address is all Fs. If so, the device
considers the message a broadcast message requesting a lease renewal
or a broadcast message a user sends on the first login and directly
forwards the message. If not, the device considers the user to have sent
the DHCPv4 Request message to renew the IP address lease and checks
the message against the DHCP snooping binding table.
b. Checks whether the CHADDR field in the DHCPv4 Request message
matches a DHCP snooping binding entry. If not, the device considers the
user to have gone online for the first time and directly forwards the
message. If so, the device checks whether the VLAN ID, IP address, and
interface number of the message match any DHCP snooping binding
entry. If all these fields match a DHCP snooping binding entry, the device
forwards the message; otherwise, the device discards the message.
● When receiving a DHCPv4 Release message, the device checks whether the
VLAN ID, IP address, MAC address, and interface number of the message
match a dynamic DHCP snooping binding entry. If so, the device forwards the
message; otherwise, the device discards the message.
● When receiving a DHCPv6 Request message, the device searches the DHCP
snooping binding table based on the user's MAC address. If no corresponding
binding entry is found or the binding entry found is a temporary one, the
device forwards the message. Otherwise, the device considers the message as
the one used for requesting a lease renewal and checks whether the VLAN ID,
IP address, and interface number of the message match any binding entry. If
so, the device forwards the message. If not, the device discards the message.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
If you run the dhcp snooping enable command in the VLAN view, the command
takes effect for all the DHCP messages from the specified VLAN. If you run this
command in the interface view, the command takes effect for all the DHCP
messages received on the specified interface.
After defense against bogus DHCPv6 message attacks is configured using the
dhcp snooping check dhcpv6-request mac command, the device does not check
DHCPv6 messages against the DHCP snooping binding table when the dhcp
snooping check dhcp-request command is executed.
Example
# Enable the device to check DHCP messages against the DHCP snooping binding
table in VLAN 10.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcp snooping enable
[HUAWEI-vlan10] dhcp snooping check dhcp-request enable
Format
dhcp snooping check server-vlan enable
undo dhcp snooping check server-vlan enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, the DHCP snooping-enabled device identifies devices by checking
DHCP reply messages only based on MAC addresses. If devices cannot be
identified based on MAC addresses, run the dhcp snooping check server-vlan
enable command to enable the DHCP snooping-enabled device to identify devices
by checking DHCP reply messages based on MAC addresses and VLAN IDs.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
DHCP server detection has been enabled using the dhcp server detect command.
Example
# Enable the DHCP snooping-enabled device to check VLAN information in DHCP
Relay messages.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp server detect
[HUAWEI] dhcp snooping check server-vlan enable
Format
dhcp snooping disable
undo dhcp snooping disable
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If you run the dhcp snooping enable command to enable DHCP snooping in a
VLAN, DHCP snooping is enabled on all the interfaces in the VLAN. If you do not
run the dhcp snooping enable command to enable DHCP snooping on an
interface, you cannot run the undo dhcp snooping enable command to disable
DHCP snooping on the interface. To address this problem, run the dhcp snooping
disable command to disable DHCP snooping on the interface. Users can properly
go online from this interface, but no dynamic binding entry is generated.
Precautions
● The dhcp snooping disable command does not only disable DHCP snooping
on an interface, but also clears the DHCP snooping configuration and the
dynamic binding table. The undo dhcp snooping enable command, however,
only disables DHCP snooping on the interface and does not clear the
configuration or the dynamic binding table.
● The undo dhcp snooping disable command enables DHCP snooping on an
interface. To enable DHCP snooping, run the dhcp snooping enable
command.
Example
# Disable DHCP snooping on GE0/0/1 in VLAN 10.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcp snooping enable
[HUAWEI-vlan10] quit
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping disable
Format
In the system view:
dhcp snooping enable [ ipv4 | ipv6 | vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ]
undo dhcp snooping enable [ ipv4 | ipv6 | vlan { vlan-id1 [ to vlan-id2 ] }
&<1-10> ]
In the VLAN view, BD view, and interface view:
dhcp snooping enable
undo dhcp snooping enable
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view, BD view
NOTE
Only the S5731-H, S5731S-H, S5732-H, S5731-S, S5731S-S, S6730-H, S6730S-H, S6730-S,
and S6730S-S supports the BD view.
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
DHCP snooping is a security function to protect DHCP. When you run the dhcp
snooping enable command to enable DHCP snooping on a device, the device can
process both DHCPv4 and DHCPv6 messages. In practice, however, if the DHCP
snooping device needs to process only DHCPv4 or DHCPv6 messages, you can run
the dhcp snooping enable ipv4 or dhcp snooping enable ipv6 command, which
improves CPU efficiency.
You must enable DHCP snooping in the system view before enabling DHCP
snooping on an interface, in a BD, or in a VLAN.
Prerequisites
DHCP has been enabled globally using the dhcp enable command.
Follow-up Procedure
After DHCP snooping is enabled on an interface connected to users, in a BD, or in
a VLAN, run the dhcp snooping trusted command to configure the interface
connected to the DHCP server as a trusted interface. Then a DHCP snooping
binding table can be generated.
Precautions
The dhcp snooping enable command in the system view is the prerequisite for
DHCP snooping-related functions. After the undo dhcp snooping enable
command is run, all DHCP snooping-related configurations of the device are
deleted. After DHCP snooping is enabled again using the dhcp snooping enable
Example
# Enable DHCP snooping globally and configure the device to process only IPv4
messages.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable ipv4
Format
System view:
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled on a device, the device generates DHCP snooping
binding entries for users by default. If the number of binding entries on the device
reaches the upper limit, new users cannot go online. In certain scenarios, for
example, on a trusted DHCP network, if you do not want to limit the number of
online users but want to record user location information, run the dhcp snooping
enable no-user-binding command to disable the device from generating DHCP
snooping binding entries.
When the command is executed in an interface view, the command takes effect
for all DHCP users connected to the interface. When the command is executed in
the VLAN view, the command takes effect for all the DHCP users belonging to this
VLAN on all interfaces. When the command is executed in the system view, the
command takes effect in the same way as it is executed in the VLAN view, except
that multiple VLANs can be specified.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
After this command is executed, the device deletes the binding entries from the
corresponding VLAN or interface.
If the DHCP snooping binding entry-dependent function such as IPSG or DAI is
configured on the device, the corresponding function does not take effect after
this command is run.
This command cannot be used together with dhcp snooping check dhcp-request
enable and dhcp snooping check dhcpv6-request mac. Otherwise, online users
may fail to go offline.
Example
# In the system view, disable the interfaces in VLAN 10 and VLAN 20 from
generating DHCP snooping binding entries.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping enable vlan 10 20
[HUAWEI] dhcp snooping enable no-user-binding vlan 10 20
# In the VLAN view, disable the interfaces in VLAN 10 from generating DHCP
snooping binding entries.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcp snooping enable
[HUAWEI-vlan10] dhcp snooping enable no-user-binding
# In the interface view, disable GE0/0/1 from generating DHCP snooping binding
entries.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable no-user-binding
By default, the maximum number of DHCP snooping binding entries that can be
learned on an interface is 512 for S1720GF, S1720GW-E, S1720GFR-P, S1720GWR-
E, and S2720-EI, 2048 for S5720-LI, S1730S-H, S2730S-S, S5735-L1, S300, S5735-L,
S5735-L-I, S5735S-L1, S5735S-L, S5735S-L-M, S5720S-LI, S500, S5735-S, S5735S-S,
S5735-S-I, , S5735S-H, S5736-S, and S5720I-SI, and 8192 for other models.
NOTE
The maximum number of DHCP snooping binding entries configured using this command is
the sum of DHCPv4 snooping and DHCPv6 snooping binding entries.
Format
In the system view:
dhcp snooping max-user-number max-user-number [ vlan { vlan-id1 [ to vlan-
id2 ] } &<1-10> ]
undo dhcp snooping max-user-number [ vlan { vlan-id1 [ to vlan-id2 ] }
&<1-10> ]
In the VLAN view and interface view:
dhcp snooping max-user-number max-user-number
undo dhcp snooping max-user-number
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the command is executed in the system view, the value specified in this
command is the total number of DHCP snooping binding entries to be learned by
all interfaces on the device. If you run the dhcp snooping max-user-number
command in the VLAN view, the command takes effect on all the interfaces in the
VLAN. If you run the dhcp snooping max-user-number command in the system
view, VLAN view and the interface view, the smallest value takes effect.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
Example
# Set the maximum number of DHCP users to 100 on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping max-user-number 100
Function
The dhcp snooping over-vpls enable command enables DHCP snooping on the
device on a Virtual Private LAN Service (VPLS) network.
The undo dhcp snooping over-vpls enable command disables DHCP snooping on
the device on a VPLS network.
NOTE
Only the S6730-H, S6730S-H, S5732-H, S5731S-H, and S5731-H support this command.
Format
dhcp snooping over-vpls enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The DHCP packets on a VPLS network are different from common DHCP packets.
Therefore, DHCP snooping cannot take effect for the device on the VPLS network
even if the function is enabled globally using the dhcp snooping enable
command in the system view. To make DHCP snooping take effect for the device
applied to the VPLS network, run the dhcp snooping over-vpls enable command
to enable the function.
To enable DHCP snooping for the device on the VPLS network, enable it on the
device closed to the user side so that the DHCP packets from the user side to the
VPLS network can be controlled.
Prerequisites
DHCP has been enabled globally using the dhcp enable command in the system
view.
Precautions
After you run the dhcp snooping over-vpls enable command, the maximum
number of concurrent users is 50 in the default CPCAR configuration.
When the device is applied to a VPLS network, you only need to run the dhcp
snooping over-vpls enable command to enable DHCP snooping on the device
and other DHCP snooping command have no changes.
Example
# Enable DHCP snooping on the device on a VPLS network.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping over-vpls enable
Function
The dhcp snooping packet-flow log enable command enables the function of
recording logs when DHCP messages are exchanged.
The undo dhcp snooping packet-flow log enable command disables the
function of recoding logs when DHCP messages are exchanged.
By default, the function of recording logs when DHCP messages are exchanged is
disabled.
Format
dhcp snooping packet-flow log enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the function of recording logs when DHCP messages are exchanged is
enabled using the dhcp snooping packet-flow log enable command, the device
records a DHCP/6/SNP_RCV_MSG log each time it receives a DHCP message. This
log can be used in smart O&M and other scenarios. The network analyzer can
perform smart analysis on whether the user obtains an IP address through this
log.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Example
# Enable the function of recording logs when DHCP messages are exchanged.
<HUAWEI> system-view
[HUAWEI] dhcp snooping packet-flow log enable
Format
In the VLAN view:
dhcp snooping trusted interface interface-type interface-number
undo dhcp snooping trusted interface interface-type interface-number
In the interface view and BD view:
Parameters
Parameter Description Value
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To enable DHCP clients to obtain IP addresses from authorized DHCP servers,
DHCP snooping supports the trusted interface and untrusted interfaces. The
trusted interface forwards DHCP messages while untrusted interfaces discard
received DHCP ACK messages and DHCP Offer messages.
An interface directly or indirectly connected to the DHCP server trusted by the
administrator needs to be configured as the trusted interface, and other interfaces
are configured as untrusted interfaces. This ensures that DHCP clients obtain IP
addresses from authorized DHCP servers.
Prerequisites
In the system view, run the dhcp snooping enable command to enable DHCP
snooping.
Precautions
If an interface has been configured as a DHCP trusted interface using the dhcp
snooping trusted command, the device will not consider DHCP packets received
by this interface as attack packets or perform attack defense operations on the
DHCP packets received by this interface.
If you run the dhcp snooping trusted command in the VLAN view, the command
takes effect for all the DHCP messages received from the specified VLAN. If you
run the dhcp snooping trusted command in the interface view, the command
takes effect for all the DHCP messages received on the specified interface.
You are advised not to configured more than 15 trusted ports in a VLAN.
Example
# Configure GE0/0/1 in VLAN 100 as the trusted interface.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 100
[HUAWEI-vlan100] dhcp snooping trusted interface gigabitethernet 0/0/1
Format
dhcp snooping user-alarm percentage percent-lower-value percent-upper-value
undo dhcp snooping user-alarm percentage
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
After you run the dhcp snooping max-user-number command to set the
maximum number of DHCP snooping binding entries on an interface, you can run
the dhcp snooping user-alarm percentage command to set the alarm thresholds
for the percentage of DHCP snooping binding entries.
When the percentage of learned DHCP snooping binding entries against the
maximum number of DHCP snooping entries allowed by the device reaches or
exceeds the upper alarm threshold, the device generates an alarm. When the
percentage of learned DHCP snooping binding entries against the maximum
number of DHCP snooping entries allowed by the device reaches or falls below the
lower alarm threshold later, the device generates a clear alarm.
Example
# Set the lower alarm threshold for the DHCP user count percentage to 30 and
the upper alarm threshold to 80.
<HUAWEI> system-view
[HUAWEI] dhcp snooping user-alarm percentage 30 80
Function
The dhcp snooping user-bind autosave command enables local automatic
backup of the DHCP snooping binding table.
The undo dhcp snooping user-bind autosave command disables local automatic
backup of the DHCP snooping binding table.
By default, local automatic backup of the DHCP snooping binding table is
disabled.
Format
dhcp snooping user-bind autosave file-name [ write-delay delay-time ]
undo dhcp snooping user-bind autosave
Parameters
Parameter Description Value
file-name Specifies the path for storing the The value is a string of 1 to
file that backs up the binding 51 case-insensitive characters
table and the file name. The file without spaces.
path and name supported by the
device must be both entered.
write-delay Specifies the interval for local The value is an integer that
delay-time automatic backup of the DHCP ranges from 60 to
snooping binding table. 4294967295, in seconds. By
default, the interval for local
If this parameter is not specified, automatic backup of the
the backup interval is the default DHCP snooping binding table
value. is 86400 seconds.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The dhcp snooping user-bind autosave command can retain the configured
DHCP snooping binding entries after the device restarts. After a DHCP snooping
binding table is generated, you can run the dhcp snooping user-bind autosave
command to enable local automatic backup of the DHCP snooping binding table.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
This prevents data loss in the DHCP snooping binding table. The suffix of the file
must be .tbl.
If the system restarts within one day after the system time is changed,
immediately run the dhcp snooping user-bind autosave command again to back
up the latest dynamic binding entries because it is not the time to update the
binding table. If you do not run this command, the lease will be inconsistent with
the current system time after the dynamic binding table is restored.
If a device where the DHCP snooping binding table is backed up is powered off
and then restarted after the lease of DHCP snooping binding table expires, the
DHCP snooping entries cannot be restored.
After this function is enabled, if the interface goes down, the DHCP snooping
binding table on the interface will be deleted from the backup binding table file.
Example
# Configure the device to back up the DHCP snooping binding table to the file
backup.tbl in the flash every 5000 seconds.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind autosave flash:/backup.tbl write-delay 5000
Function
The dhcp snooping user-bind ftp command enables the device to automatically
back up DHCP snooping binding entries on the remote FTP server.
The undo dhcp snooping user-bind ftp command disables the device from
automatically backing up DHCP snooping binding entries on the remote FTP
server.
Format
dhcp snooping user-bind ftp remotefilename filename host-ip ip-address [ port
port-number ] username username password password [ write-delay delay-
time ]
undo dhcp snooping user-bind ftp
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the device restarts, to prevent loss of generated DHCP snooping binding
entries on the device, run the dhcp snooping user-bind ftp command to enable
the device to automatically back up DHCP snooping binding entries on the remote
FTP server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
The FTP protocol will bring risk to device security. The SFTP protocol configured
using the dhcp snooping user-bind sftp command is recommended.
Example
# Enable the device to automatically back up DHCP snooping binding entries to
the backup file on the FTP server at 10.137.12.10 with the FTP user name test
and password test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind ftp remotefilename backup host-ip 10.137.12.10 username test
password test@123
Format
dhcp snooping user-bind ftp load remotefilename filename host-ip ip-address
[ port port-number ] username username password password
Parameters
Parameter Description Value
port port-number Specifies the port The value is an integer that ranges
number of the FTP from 1 to 65535. By default, the
server. port number is 21.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After running the dhcp snooping user-bind ftp command to enable the device to
automatically back up DHCP snooping binding entries on the remote FTP server,
you can run the dhcp snooping user-bind ftp load command to configure the
device to obtain and restore backup DHCP snooping binding entries on the remote
FTP server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
The FTP protocol will bring risk to device security. The SFTP protocol configured
using the dhcp snooping user-bind sftp load command is recommended.
Example
# Configure the device to obtain and restore backup DHCP snooping binding
entries from the backup file on the remote FTP server at 10.137.12.10 with the
FTP user name test and password test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind ftp load remotefilename backup host-ip 10.137.12.10 username
test password test@123
Warning: FTP is not a secure protocol, and it is recommended to use SFTP.
Info: Downloading the file from the remote FTP server. Please wait...done.
Total number of dynamic binding table in remote file: 30
Recovering dynamic binding table, please wait for a moment....
10 successful, 20 failed.
Binding Collisions : 20 Exceeds max limits : 0
Invalid interfaces : 0 Invalid vlans : 0
Invalid snp configurations : 0 Expired leases : 0
Parse failures : 0
Table 14-62 Description of the dhcp snooping user-bind ftp load command
output
Item Description
Function
The dhcp snooping user-bind http https command enables the device to
automatically back up DHCP snooping binding entries on the remote HTTP or
HTTPS server.
The undo dhcp snooping user-bind http https command disables the device
from automatically backing up DHCP snooping binding entries on the remote
HTTP or HTTPS server.
Format
dhcp snooping user-bind http { remotefilename filename host-ip ip-address
[ port port-number ] | url url-string } [ username username password password ]
[ write-delay delay-time ]
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the device restarts, to prevent loss of generated DHCP snooping binding
entries on the device, run the dhcp snooping user-bind http https command to
enable the device to automatically back up DHCP snooping binding entries on the
remote HTTP or HTTPS server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
The HTTP protocol will bring risk to device security. The HTTPS protocol is
recommended for file operations.
Example
# Configure the device to automatically back up DHCP snooping binding entries to
the backup file on the HTTP server at 10.1.1.1 with the HTTP user name test and
password test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind http remotefilename backup host-ip 10.1.1.1 username test
password test@123
# Configure the device to back up DHCP snooping binding entries to the HTTPS
server at 10.1.1.1 and specify the SSL policy name as s1, backup file name as
backup, HTTPS user name as test, and HTTPS password as test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind https ssl-policy s1 remotefilename backup host-ip 10.1.1.1
username test password test@123
Format
dhcp snooping user-bind http load { remotefilename filename host-ip ip-
address [ port port-number ] | url url-string } [ username username password
password ]
dhcp snooping user-bind https ssl-policy ssl-policy-name load
{ remotefilename filename host-ip ip-address [ port port-number ] | url url-
string } [ username username password password ]
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After running the dhcp snooping user-bind http https command to enable the
device to automatically back up DHCP snooping binding entries on the remote
HTTP or HTTPS server, you can run the dhcp snooping user-bind http https load
command to configure the device to obtain and restore backup DHCP snooping
binding entries on the remote HTTP or HTTPS server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
The HTTP protocol will bring risk to device security. The HTTPS protocol is
recommended for file operations.
Example
# Configure the device to obtain and restore backup DHCP snooping binding
entries from the backup file on the remote HTTP server at 10.1.1.1 with the HTTP
user name test and password test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind http load remotefilename backup host-ip 10.1.1.1 username test
password test@123
Info: Downloading the file from the remote HTTP server. Please wait...done.
Total number of dynamic binding table in remote file: 10
Recovering dynamic binding table, please wait for a moment....
10 successful, 0 failed.
Binding Collisions : 0 Exceeds max limit : 0
Invalid interfaces : 0 Invalid vlan : 0
Snooping not enable : 0 Lease expired : 0
Parse failures : 0
# Configure the device to obtain and restore backup DHCP snooping binding
entries from the backup file on the remote HTTPS server at 10.1.1.1 and specify
the SSL policy name as s1, HTTPS user name as test, and HTTPS password as
test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind https ssl-policy s1 load remotefilename backup host-ip 10.1.1.1
username test password test@123
Info: Downloading the file from the remote HTTPS server. Please wait...done.
Total number of dynamic binding table in remote file: 10
Recovering dynamic binding table, please wait for a moment....
10 successful, 0 failed.
Binding Collisions : 0 Exceeds max limit : 0
Invalid interfaces : 0 Invalid vlan : 0
Snooping not enable : 0 Lease expired : 0
Parse failures : 0
Table 14-63 Description of the dhcp snooping user-bind http https load
command output
Item Description
Format
dhcp snooping user-bind sftp remotefilename filename host-ip ip-address
[ port port-number ] username username password password [ write-delay
delay-time ]
undo dhcp snooping user-bind sftp
Parameters
Parameter Description Value
write-delay delay- Specifies the interval for The value is an integer that
time automatically backing ranges from 300 to 4294967295,
up DHCP snooping in seconds.
binding entries.
By default, the system backs up
If this parameter is not DHCP snooping binding entries
used, the default every two days.
interval is used.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the device restarts, to prevent loss of generated DHCP snooping binding
entries on the device, run the dhcp snooping user-bind sftp command to enable
the device to automatically back up DHCP snooping binding entries on the remote
SFTP server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
The suffix of the file must be .tbl.
Example
# Enable the device to automatically back up DHCP snooping binding entries to
the backup file on the SFTP server at 10.137.12.10 with the SFTP user name test
and password test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind sftp remotefilename backup host-ip 10.137.12.10 username test
password test@123
Function
The dhcp snooping user-bind sftp load command configures the device to obtain
and restore backup DHCP snooping binding entries on the remote SFTP server.
Format
dhcp snooping user-bind sftp load remotefilename filename host-ip ip-address
[ port port-number ] username username password password
Parameters
Parameter Description Value
port port-number Specifies the port The value is an integer that ranges
number of the SFTP from 1 to 65535. By default, the
server. port number is 22.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After running the dhcp snooping user-bind sftp command to enable the device
to automatically back up DHCP snooping binding entries on the remote SFTP
server, you can run the dhcp snooping user-bind sftp load command to
configure the device to obtain and restore backup DHCP snooping binding entries
on the remote SFTP server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Example
# Configure the device to obtain and restore backup DHCP snooping binding
entries from the backup file on the remote SFTP server at 10.137.12.10 with the
SFTP user name test and password test@123.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind sftp load remotefilename backup host-ip 10.137.12.10 username
test password test@123
Info: Downloading the file from the remote SFTP server. Please wait...done.
Total number of dynamic binding table in remote file: 30
Recovering dynamic binding table, please wait for a moment....
10 successful, 20 failed.
Binding Collisions : 20 Exceeds max limits : 0
Invalid interfaces : 0 Invalid vlans : 0
Invalid snp configurations : 0 Expired leases : 0
Parse failures : 0
Table 14-64 Description of the dhcp snooping user-bind sftp load command
output
Item Description
Item Description
Format
dhcp snooping user-bind tftp remotefilename filename host-ip ip-address
[ write-delay delay-time ]
undo dhcp snooping user-bind tftp
Parameters
Parameter Description Value
remotefilename Specifies the name of the The value is a string of 1 to
filename file where DHCP snooping 64 case-sensitive characters
binding entries will be without spaces. The string
backed up on the remote cannot contain the following
TFTP server. characters: ~ * \ | : " ? < >.
write-delay delay- Specifies the interval for The value is an integer that
time automatically backing up ranges from 300 to
DHCP snooping binding 4294967295, in seconds.
entries.
By default, the interval for
If this parameter is not local automatic backup of the
used, the default interval is DHCP snooping binding table
used. is 86400 seconds.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the device restarts, to prevent loss of generated DHCP snooping binding
entries on the device, run the dhcp snooping user-bind tftp command to enable
the device to automatically back up DHCP snooping binding entries on the remote
TFTP server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
The TFTP protocol will bring risk to device security. The SFTP protocol configured
using the dhcp snooping user-bind sftp command is recommended.
Example
# Enable the device to automatically back up DHCP snooping binding entries to
the backup file on the TFTP server at 10.137.12.10 at intervals of 5000s.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind tftp remotefilename backup host-ip 10.137.12.10 write-delay 5000
Format
dhcp snooping user-bind tftp load remotefilename filename host-ip ip-address
Parameters
Parameter Description Value
remotefilename Specifies the name of the The value is a string of 1 to
filename file from which the device 64 characters without spaces.
obtains DHCP snooping The string cannot contain the
binding entries. following characters: ~ * \ | :
" ? < >.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After running the dhcp snooping user-bind tftp command to enable the device
to automatically back up DHCP snooping binding entries on the remote TFTP
server, you can run the dhcp snooping user-bind tftp load command to configure
the device to obtain and restore backup DHCP snooping binding entries on the
remote TFTP server.
Prerequisites
DHCP snooping has been enabled using the dhcp snooping enable command.
Precautions
The TFTP protocol will bring risk to device security. The SFTP protocol configured
using the dhcp snooping user-bind sftp load command is recommended.
Example
# Configure the device to obtain and restore backup DHCP snooping binding
entries from the backup file on the remote TFTP server at 10.137.12.10.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind tftp load remotefilename backup host-ip 10.137.12.10
Info: Transfer file in binary mode.
Downloading the file from the remote TFTP server. Please wait...
100%
TFTP: Downloading the file successfully.
656 byte(s) received in 1 second(s).
Total number of dynamic binding table in remote file: 20
Recovering dynamic binding table, please wait for a moment....
10 successful, 10 failed.
Binding Collisions : 10 Exceeds max limit : 0
Invalid interfaces : 0 Invalid vlan : 0
Invalid snp configurations : 0 Expired leases : 0
Parse failures : 0
Table 14-65 Description of the dhcp snooping user-bind tftp load command
output
Item Description
Item Description
Function
The dhcp snooping user-offline remove mac-address command enables the
device to delete the MAC address entry of a user whose DHCP snooping binding
entry is deleted.
The undo dhcp snooping user-offline remove mac-address command disables
the device from deleting the MAC address entry of a user whose binding entry is
deleted.
By default, the device does not delete the MAC address entry of a user whose
DHCP snooping binding entry is deleted.
Format
dhcp snooping user-offline remove mac-address
undo dhcp snooping user-offline remove mac-address
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If a user goes offline but its MAC address entry is not aged, the device forwards
the packet whose destination address is the IP address of the user based on the
dynamic MAC address entry. After the dhcp snooping user-offline remove mac-
address command is executed, the user MAC address entry is deleted when the
DHCP snooping binding entry is deleted. With the function of discarding unknown
unicast packets on the network-side interface, the device discards packets destined
to offline users.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Example
# Enable the device to delete the MAC address entry of a user whose DHCP
snooping binding entry is deleted.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-offline remove mac-address
Format
dhcp snooping user-bind upload format ascii
undo dhcp snooping user-bind upload format ascii
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, DHCP snooping binding entries are backed up only in binary format
when the automatic backup of DHCP snooping binding entries on the remote
server is enabled. Huawei switches can restore DHCP snooping binding entries in
binary format. However, customers cannot read backup DHCP snooping binding
entries in binary format. To resolve this problem, run the dhcp snooping user-
bind upload format ascii command to configure the device to back up DHCP
snooping binding entries in ASCII and binary formats. Customers then can read
DHCP snooping binding entries in ASCII format and store the entries to the local
database.
Prerequisites
Backup of DHCP snooping binding entries must be enabled for the remote FTP,
HTTP, HTTPS, SFTP, and TFTP servers. Otherwise, the configuration of the dhcp
snooping user-bind upload format ascii command does not take effect.
Example
# Enable the device to back up DHCP snooping binding entries to the file named
backup on the FTP server at 10.137.12.10 with the FTP user name test and
password test@123. DHCP snooping binding entries can be backed up in both
ASCII and binary formats.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] dhcp snooping user-bind ftp remotefilename backup host-ip 10.137.12.10 username test
password test@123
[HUAWEI] dhcp snooping user-bind upload format ascii
Function
The dhcp snooping user-transfer enable command enables location transition
for DHCP snooping users.
Format
dhcp snooping user-transfer enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a mobile user goes online through interface A, goes offline, and then goes
online through interface B, the user sends a DHCP Discover message to apply an
IP address. By default, if DHCP snooping is enabled on the device, the device
allows the user to go online and updates the DHCP snooping binding entries.
However, this may bring security risks. For example, if an attacker pretends an
authorized user to send a DHCP Discover message, the authorized user cannot
access the network after the DHCP snooping binding table is updated. To prevent
such attacks, you can disable the DHCP snooping location transition function.
After this function is disabled, the device discards the DHCP Discover messages
sent by a user who has an entry in the DHCP snooping binding table (user's MAC
address exists in the DHCP snooping binding table) through another interface.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Example
# Disable location transition for DHCP snooping users.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] undo dhcp snooping user-transfer enable
Format
dhcpv6 interface-id format { default | user-defined text }
undo dhcpv6 interface-id format
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The Interface-ID records user access information such as the inbound interfaces of
the DHCPv6 packets sent from the clients to the device. The device functions as a
DHCPv6 relay or lightweight DHCPv6 relay agent (LDRA). When receiving the
request packets sent from the DHCPv6 clients and forwarding the packets to the
DHCPv6 server, the device can insert the Interface-ID to the packets to identify the
DHCPv6 client location information. The location information can be used by the
DHCPv6 server to assign IPv6 addresses and network parameters. You can run the
dhcpv6 interface-id format command to configure the format of the Interface-ID
inserted into DHCPv6 packets.
Keyword Description
Prerequisites
DHCP has been enabled globally using the dhcp enable command.
Precautions
● The user-defined format content must be specified between the double
quotation marks (""). For example, to configure the user-defined format
content as mac, run the dhcpv6 interface-id format user-defined "%mac"
command.
● Separators that cannot be digits must be added between the keywords in the
user-defined format. Otherwise, the keywords cannot be parsed.
● The symbol % must be prefixed to the keywords in the user-defined format to
differentiate them from common character strings. If a digit exists before the
symbol % and keyword, the digit refers to the number of characters in the
keyword.
● The self-defined content is encapsulated in ASCII format. In addition to the
preceding precautions, note the following rules:
– The symbol \ is an escape character. The symbols %, \, and [] following
the escape character indicate themselves. For example, \\ represents the
character \.
– An ASCII character string can contain Arabic numerals, uppercase letters,
lowercase letters, and the following symbols: ! @ # $ % ^ & * ( ) _ + | - =
\ [ ] { } ; : ' " / . , < > `.
– By default, the length of each keyword in an ASCII character string is the
actual length of the keyword.
Example
# Configure a user-defined format as the format of the Interface-ID in DHCPv6
packets and the device MAC address as the encapsulated content.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcpv6 interface-id format user-defined "%mac"
Format
dhcpv6 option18 [ vlan vlan-id ] [ ce-vlan ce-vlan-id ] format user-defined text
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the dhcpv6 option18 { insert | rebuild } enable command is executed to
enable the device to insert the Option 18 field to a DHCPv6 message, you can run
the dhcpv6 option18 format command to configure the format of the Option 18
field in a DHCPv6 message.
You can use the following keywords to define the Option 18 field. The format
string can use the hexadecimal notation, ASCII format, or combination of the two
formats.
● duid: indicates the ID of the client. This keyword is valid only in the string
format.
● sysname: indicates the ID of the access point. This keyword is valid only in
ASCII format.
● portname: indicates the name of a port, for example, GE0/0/1. This keyword is
valid only in ASCII format.
● porttype: indicates the type of a port. This keyword is a character string or in
hexadecimal notation. For example, if the value is Ethernet in ASCII format, it
is 15 in hexadecimal notation.
● iftype: indicates the type of a port, including eth and trunk. This keyword is
valid only in ASCII format.
● mac: indicates the MAC address of a port. In ASCII format, the value is in the
format of H-H-H; in hexadecimal notation, the value is a number of six bytes.
● slot: indicates the slot ID. This keyword is valid in ASCII format or in
hexadecimal notation.
● subslot: indicates the subslot ID. This keyword is valid in ASCII format or in
hexadecimal notation.
● port: indicates the port number. This keyword is valid in ASCII format or in
hexadecimal notation.
● svlan: indicates the outer VLAN ID. The value ranges from 1 to 4094. If this
field is not required, this field is 0. This keyword is valid in ASCII format or in
hexadecimal notation.
● cvlan: specifies the inner VLAN ID. The value ranges from 1 to 4094. If this
field is not required, this field is 0. This keyword is valid in ASCII format or in
hexadecimal notation.
● length: indicates the total length of the keywords following the keyword
length.
● n: indicates the value of the keyword svlan or cvlan if the SVLAN or CVLAN
does not exist. The keyword n is on the left of the keyword svlan or cvlan. If
the corresponding VLAN does not exist, the default value of the keyword
svlan or cvlan is 4096 in ASCII format and is all Fs in hexadecimal notation. If
the n keyword is added to the left of the keyword svlan or cvlan, the keyword
svlan or cvlan is 0. This keyword is valid in ASCII format or in hexadecimal
notation.
NOTE
Delimiters must be added between keywords; otherwise, the device cannot parse the
keywords. The delimiters cannot be numbers.
a pair of quotation marks to contain the string. For example, the slot ID
is 3, and the port number is 4. If the string is in the %slot %port format,
the value of the encapsulated string is a hexadecimal number 00030004.
If the string is in the "%slot %port" format, the value of the encapsulated
string is 3 4.
– A format string can contain both hexadecimal strings and ASCII strings,
for example, %slot %port "%sysname %portname:%svlan.%cvlan."
Example
# Configure the format of the Option 18 field in a DHCPv6 message in VLAN 10.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcpv6 option18 format user-defined "%length %svlan %5slot %3subslot %8port"
Format
dhcpv6 option37 [ vlan vlan-id ] [ ce-vlan ce-vlan-id ] format user-defined text
undo dhcpv6 option37 { [ vlan vlan-id ] [ ce-vlan ce-vlan-id ] format | format
all }
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
After the dhcpv6 option37 { insert | rebuild } enable command is executed to
enable the device to insert the Option 37 field to a DHCPv6 message, you can run
the dhcpv6 option37 format command to configure the format of the Option 37
field in a DHCPv6 message.
You can use the following keywords to define the Option 37 field. The format
string can use the hexadecimal notation, ASCII format, or combination of the two
formats.
● duid: indicates the ID of the client. This keyword is valid only in the string
format.
● sysname: indicates the ID of the access point. This keyword is valid only in
ASCII format.
● portname: indicates the name of a port, for example, GE0/0/1. This keyword is
valid only in ASCII format.
● porttype: indicates the type of a port. This keyword is a character string or in
hexadecimal notation. For example, if the value is Ethernet in ASCII format, it
is 15 in hexadecimal notation.
● iftype: indicates the type of a port, including eth and trunk. This keyword is
valid only in ASCII format.
● mac: indicates the MAC address of a port. In ASCII format, the value is in the
format of H-H-H; in hexadecimal notation, the value is a number of six bytes.
● slot: indicates the slot ID. This keyword is valid in ASCII format or in
hexadecimal notation.
● subslot: indicates the subslot ID. This keyword is valid in ASCII format or in
hexadecimal notation.
● port: indicates the port number. This keyword is valid in ASCII format or in
hexadecimal notation.
● svlan: indicates the outer VLAN ID. The value ranges from 1 to 4094. If this
field is not required, this field is 0. This keyword is valid in ASCII format or in
hexadecimal notation.
● cvlan: specifies the inner VLAN ID. The value ranges from 1 to 4094. If this
field is not required, this field is 0. This keyword is valid in ASCII format or in
hexadecimal notation.
● length: indicates the total length of the keywords following the keyword
length.
● n: indicates the value of the keyword svlan or cvlan if the SVLAN or CVLAN
does not exist. The keyword n is on the left of the keyword svlan or cvlan. If
the corresponding VLAN does not exist, the default value of the keyword
svlan or cvlan is 4096 in ASCII format and is all Fs in hexadecimal notation. If
the n keyword is added to the left of the keyword svlan or cvlan, the keyword
svlan or cvlan is 0. This keyword is valid in ASCII format or in hexadecimal
notation.
NOTE
Delimiters must be added between keywords; otherwise, the device cannot parse the
keywords. The delimiters cannot be numbers.
Example
# Configure the format of the Option 37 field in a DHCPv6 message in VLAN 10.
<HUAWEI> system-view
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcpv6 option37 format user-defined "%length %svlan %5slot %3subslot %8port"
Function
The dhcpv6 { option18 | option37 } enable command enables the device to
insert the Option 18 or Option 37 field to a DHCPv6 message.
The undo dhcpv6 { option18 | option37 } enable command disables the device
from inserting the Option 18 or Option 37 field to a DHCPv6 message.
By default, the device does not insert the Option 18 or Option 37 field to a
DHCPv6 message.
Format
dhcpv6 { option18 | option37 } { insert | rebuild } enable
Parameters
Parameter Description Value
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The function of the Option 18 and Option 37 field is similar to the function of the
Option 82 field (see the dhcp option82 enable command). The Option 18 field
contains the port number of a client and the Option 37 field contains the MAC
address of the client. A device inserts the Option 18 or Option 37 field to a
DHCPv6 Request message to notify the DHCP server of the DHCPv6 client
location. The DHCP server can properly assign an IP address and other
configurations to the DHCPv6 client, ensuring DHCP client security.
Prerequisites
DHCP snooping has been enabled on the device using the dhcp snooping enable
command.
Precautions
If you run the dhcpv6 { option18 | option37 } enable command in the VLAN
view, the command takes effect for all the DHCPv6 messages received from the
specified VLAN. If you run the dhcpv6 { option18 | option37 } enable command
in the interface view, the command takes effect for all the DHCPv6 messages
received on the specified interface.
Example
# Insert the Option 37 field to DHCPv6 Request messages sent by GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable
[HUAWEI-GigabitEthernet0/0/1] dhcpv6 option37 insert enable
Function
The dhcpv6 remote-id format command sets the format of the Remote-ID in
DHCPv6 messages.
The undo dhcpv6 remote-id format command restores the default format of the
Remote-ID in DHCPv6 messages.
Format
dhcpv6 remote-id format { default | user-defined text }
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Use Scenario
The Remote-ID records user access information such as the DUID of the DHCPv6
packets sent from the clients to the device. The device functions as a DHCPv6
relay or lightweight DHCPfv6 relay agent (LDRA). When receiving the request
packets sent from the DHCPv6 clients and forwarding the packets to the DHCPv6
server, the device can insert the Remote-ID to the packets to identify the DHCPv6
client location information. The location information can be used by the DHCPv6
server to assign IPv6 addresses and network parameters. You can run the dhcpv6
remote-id format command to configure the format of the Remote-ID inserted
into DHCPv6 packets.
Keyword Description
Keyword Description
Prerequisites
The DHCP function has been enabled using the dhcp enable command in the
system view.
Follow-up Procedure
When the device functions as a DHCPv6 relay, you must run the dhcpv6 remote-
id insert enable or dhcpv6 remote-id rebuild enable command to enable the
function of inserting the Remote-ID into DHCPv6 relay packets after running the
dhcpv6 remote-id format command to configure the Remote-ID format in
DHCPv6 packets.
NOTE
When the device functions as an LDRA, the Remote-ID is inserted into DHCPv6 relay packets by
default and the function does not need to be enabled.
Precautions
● The user-defined format content must be specified between the double
quotation marks (""). For example, to configure the user-defined format
content as mac, run the dhcpv6 interface-id format user-defined "%mac"
command.
● Separators that cannot be digits must be added between the keywords in the
user-defined format. Otherwise, the keywords cannot be parsed.
● The symbol % must be prefixed to the keywords in the user-defined format to
differentiate them from common character strings. If a digit exists before the
symbol % and keyword, the digit refers to the number of characters in the
keyword.
● The self-defined content is encapsulated in ASCII format. In addition to the
preceding precautions, note the following rules:
Example
# Set the customized format for the remote ID carried in DHCPv6 messages and
encapsulate the MAC address of the device into the remote ID.
<HUAWEI> system-view
[HUAWEI] dhcpv6 remote-id format user-defined "%mac"
Format
In the system view:
dhcpv6 snooping check relay-forward enable vlan { vlan-id1 [ to vlan-id2 ] }
&<1-10>
undo dhcpv6 snooping check relay-forward enable vlan { vlan-id1 [ to vlan-
id2 ] } &<1-10>
In the VLAN view or interface view:
dhcpv6 snooping check relay-forward enable
undo dhcpv6 snooping check relay-forward enable
Parameters
Parameter Description Value
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Prerequisites
DHCPv6 snooping has been enabled on the device using the dhcp snooping
enable command.
Precautions
If you run the dhcp snooping enable command in the VLAN view, the command
configuration takes effect only for the DHCP messages from the specified VLAN. If
you run this command in the interface view, the command configuration takes
effect for all DHCP messages on the specified interface.
Example
# Enable the function of discarding DHCPv6 Relay-Forward messages in VLAN 10.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcpv6 snooping check relay-forward enable
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] dhcp snooping enable
[HUAWEI-GigabitEthernet0/0/1] dhcpv6 snooping check relay-forward enable
Format
dhcpv6 snooping relay-information enable [ trust ]
undo dhcpv6 snooping relay-information enable [ trust ]
Parameters
Parameter Description Value
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Use Scenario
In some scenarios, for example, interfaces in the same VLAN have different
network access rights and QoS requirements, the DHCPv6 server must be able to
detect user access locations, and assign corresponding access control and QoS
policies. The DHCPv6 relay agent is usually configured on the gateway. The relay
agent can record user access locations; however, if access devices are located
between the relay agent and users, the relay agent cannot detect the access
locations of users.
LDRA can meet the requirements of these scenarios. LDRA is configured on the
user-side access device. The LDRA-enabled device can forward user access
Example
# Enable LDRA for DHCPv6 snooping in VLAN10.
<HUAWEI> system-view
[HUAWEI] vlan 10
[HUAWEI-vlan10] dhcpv6 snooping relay-information enable
Format
dhcpv6 snooping user-bind detect confirm-client enable
undo dhcpv6 snooping user-bind detect confirm-client enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After a binding entry is generated for a client using the DHCPv6 Confirm packet,
this client is a confirm-client. When the client goes online again, it sends a
DHCPv6 Confirm packet.
When a user-side interface receives the DHCPv6 Confirm packet, a DHCPv6
snooping binding entry is generated for the client. Because the DHCPv6 Confirm
packet does not contain lease information, the binding entry of the client cannot
be deleted immediately when the client goes offline. This occupies binding table
space and new users may fail to go online.
After the confirm-client probing function is enabled, DHCPv6 snooping periodically
sends DAD NS packets to detect whether the confirm-client is online. The DHCPv6
snooping entries are promptly deleted when the confirm-clients go offline.
Prerequisites
The dhcp snooping enable ipv6 command has been executed to enable DHCPv6
snooping.
Example
# Enable confirm-client probing of DHCPv6 snooping.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable ipv6
[HUAWEI] dhcpv6 snooping user-bind detect confirm-client enable
Format
dhcpv6 snooping user-bind detect retransmit times interval interval
Parameters
Parameter Description Value
times Specifies the number of times The value is an integer that
a DAD NS packet is sent. ranges from 1 to 10.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the function of enabling DHCPv6 snooping to detect whether the confirm-
client is online is enabled using the dhcpv6 snooping user-bind detect confirm-
client enable command, the DHCPv6 snooping-enabled device will periodically
send DAD NS packets to detect whether the confirm-client is online and delete the
DHCPv6 snooping entry of the offline confirm-client. You can change the number
of times and interval at which the DHCPv6 snooping-enabled device sends DAD
NS packets as required.
Prerequisites
The dhcp snooping enable ipv6 command has been executed to enable DHCPv6
snooping.
Example
# Set the number of times and interval at which the DAD NS packets are sent to 2
and 60 seconds, respectively.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable ipv6
[HUAWEI] dhcpv6 snooping user-bind detect retransmit 2 interval 60
Format
dhcpv6 snooping user-bind mac-conflict detect enable
undo dhcpv6 snooping user-bind mac-conflict detect enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After binding entries are generated, you can run the dhcp snooping check
dhcpv6-request mac command to enable the function of checking the validity of
DHCPv6 messages based on MAC addresses. Then the device searches for the
binding entries based on the MAC address entry that is used as the key. The device
checks whether the DHCPv6 Request and DHCPv6 Release messages match any
binding entry. If they match, the device forwards the messages; otherwise, the
device discards the messages. This prevents unauthorized users from sending
bogus DHCPv6 messages to extend the IP address lease or release IP addresses.
When determining that a DHCPv6 message is invalid, the device discards it. In this
case, you can enable the function of detecting whether DHCPv6 users are online.
DHCPv6 snooping then sends DAD NS packets at an interval of 3 seconds for
three times to detect whether a DHCPv6 user is online. If no response packet is
received from the DHCPv6 user within the timeout period, the device considers
that the user is offline and deletes the DHCPv6 snooping entry of the offline user.
Prerequisites
1. The dhcp snooping enable ipv6 command has been run to enable DHCPv6
snooping globally.
2. The dhcp snooping check dhcpv6-request mac command has been run to
enable the function of checking the validity of DHCPv6 messages based on
MAC addresses.
Example
# Enable DHCPv6 snooping for detecting whether a user is online.
<HUAWEI> system-view
[HUAWEI] dhcp enable
Function
The display dhcp option82 configuration command displays the DHCP Option
82 configuration.
Format
display dhcp option82 configuration [ vlan vlan-id | interface interface-type
interface-number ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The Option 82 field records the location of a DHCP client. A device inserts the
Option 82 field to a DHCP Request message to notify the DHCP server of the
DHCP client location. The DHCP server can properly assign an IP address and
other configurations to the DHCP client, ensuring DHCP client security.
After the Option 82 field is inserted to a DHCP message, run the display dhcp
option82 configuration command to display the DHCP Option 82 configuration.
Example
# Display all the DHCP Option82 configurations.
<HUAWEI> display dhcp option82 configuration
#
dhcp option82 vendor-specific format vendor-sub-option 1 ascii 22
#
interface GigabitEthernet0/0/1
dhcp option82 subscriber-id format ascii 222
dhcp option82 insert enable
dhcp option82 encapsulation circuit-id
dhcp option82 append vendor-specific
dhcp option82 circuit-id format common
#
Item Description
dhcp option82 vendor-specific The Sub9 of the old format is inserted into
format vendor-sub-option i ascii the Option 82 field of DHCP messages.
text1 To specify the parameter, run the dhcp
option82 vendor-specific format
command.
dhcp option82 subscriber-id format The Sub6 suboption is inserted into the
ascii text2 Option 82 field of DHCP messages.
To specify the parameter, run the dhcp
option82 subscriber-id format command.
dhcp option82 append vendor- The Sub9 of the new format is inserted
specific into the Option 82 field of DHCP
messages.
To specify the parameter, run the dhcp
option82 append vendor-specific
command.
Item Description
Format
display dhcp snooping [ interface interface-type interface-number | vlan vlan-id
| bridge-domain bd-id ]
NOTE
Only the S6730-H, S6730S-H, S6730-S, S6730S-S, S5732-H, S5731-S, S5731S-S, S5731S-H,
S5731-H, S6720-EI, S6735-S and S6720S-EI support the bridge-domain parameter.
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display dhcp snooping command displays DHCP snooping running
information. If no interface or VLAN is specified, global DHCP snooping running
information is displayed. If an interface or a VLAN ID is specified, DHCP snooping
running information of the interface or VLAN is displayed.
Example
# Display global DHCP snooping running information.
<HUAWEI> display dhcp snooping
DHCP snooping global running information :
DHCPv4 snooping : Enable
DHCPv6 snooping : Enable
Static user max number : 1024
Current static user number :1
Dhcp user(dhcpv4/dhcpv6/nd) max number : 4096
Dhcp user(dhcpv4/dhcpv6) max number : 3000
Nd user max number : 1000
Current dhcpv4 user number :0
Current dhcpv6 user number :0
Current nd user number :0
Arp dhcp-snooping detect : Disable (default)
Alarm threshold : 100 (default)
Check dhcp-rate : Disable (default)
Dhcp-rate limit(pps) : 100 (default)
Alarm dhcp-rate : Disable (default)
Alarm dhcp-rate threshold : 100 (default)
Discarded dhcp packets for rate limit :0
Bind-table autosave : Disable (default)
Client position transfer allowed : Enable (default)
DHCPv6 confirm-client online detection : Enable (default)
DHCPv6 client online detection times :3 (default)
DHCPv6 client online detection interval : 180 (default)
Check dhcpv6-rate : Disable (default)
Dhcpv6-rate limit(pps) : 100 (default)
Alarm dhcpv6-rate : Enable
Alarm dhcpv6-rate threshold : 10
Discarded dhcpv6 packets for rate limit : 0
DHCP snooping packet-flow log : Disable (default)
Item Description
Discarded dhcp packets for rate limit Number of discarded DHCP messages
whose rate exceeds the rate limit.
Item Description
DHCPv6 client online detection times Number of times that the DAD NS
messages are sent for DHCPv6
snooping to detect whether the user is
online.
To configure the number of times that
the DAD NS messages are sent for
DHCPv6 snooping to detect whether
the user is online, run the dhcpv6
snooping user-bind detect
retransmit command.
Item Description
Item Description
Item Description
Item Description
Function
The display dhcp snooping configuration command displays the DHCP snooping
configuration.
Format
display dhcp snooping configuration [ vlan vlan-id | interface interface-type
interface-number | bridge-domain bd-id ]
NOTE
Only the S6730-H, S6730S-H, S6730-S, S6730S-S, S5732-H, S5731-S, S5731S-S, S5731S-H,
S5731-H, S6720-EI, S6735-S and S6720S-EI support the bridge-domain parameter.
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After DHCP snooping configuration is complete, run the display dhcp snooping
configuration command to view the DHCP snooping configuration. If no VLAN or
interface is specified, all the DHCP snooping configurations are displayed. If a
VLAN or an interface is specified, only the DHCP snooping configuration in the
VLAN or on the interface is displayed.
Example
# Display all the DHCP snooping configurations.
<HUAWEI> display dhcp snooping configuration
#
dhcp snooping enable
#
vlan 3
dhcp snooping enable
dhcp snooping check dhcp-giaddr enable
#
interface GigabitEthernet0/0/1
dhcp snooping enable
#
Function
The display dhcp snooping statistics command displays statistics about received
DHCP messages.
Format
display dhcp snooping statistics { global | interface interface-type interface-
number [ vlan vlan-id ] | vlan vlan-id [ interface interface-type interface-
number ] }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To view statistics about the received DHCP messages of all types, run the display
dhcp snooping statistics command.
Example
# Display DHCP snooping statistics on a specified interface.
<HUAWEI> display dhcp snooping statistics interface gigabitethernet 0/0/1
DHCP Snooping Statistics:
Dropped by mac-address check: 0
Dropped by untrust reply: 0
Dropped by request check: 0
Dropped by requestv6 check: 0
Dropped by no trust port: 0
Client Request:
Dhcp Discover: 0
Dhcp Request: 0
Dhcp Decline: 0
Dhcp Release: 0
Dhcp Inform: 0
Server Reply:
Dhcp Offer: 0
Dhcp Ack: 0
Dhcp Nak: 0
Drop Packet:
Item Description
Item Description
Function
The display dhcp snooping user-bind command displays information about the
DHCP snooping dynamic binding table.
Format
display dhcp snooping user-bind { { interface interface-type interface-number |
ip-address ip-address | mac-address mac-address | vlan vlan-id | bridge-domain
bd-id } * | all } [ verbose ]
NOTE
Only the S6730-H, S6730S-H, S6730-S, S6730S-S, S5732-H, S5731-S, S5731S-S, S5731S-H,
S5731-H, S6720-EI, S6735-S and S6720S-EI support the bridge-domain parameter.
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After DHCP snooping is enabled, the device generates a DHCP snooping binding
table. A binding entry contains the MAC address, IP address, interface connecting
to the DHCP client, and ID VLAN to which the interface belongs. You can run the
display dhcp snooping user-bind command to view the DHCP snooping binding
table.
Example
# Display information about the DHCP snooping binding table.
● Display information about all binding entries.
<HUAWEI> display dhcp snooping user-bind all
DHCP Dynamic Bind-table:
Flags:O - outer vlan ,I - inner vlan ,P - Vlan-mapping
IP Address MAC Address VSI/VLAN(O/I/P)/(BD-VLAN) Interface Lease
-----------------------------------------------------------------------------------------
10.1.28.141 00e0-fc12-3456 10 GE0/0/1 2008.10.17-07:31
-----------------------------------------------------------------------------------------
Print count: 1 Total count: 1
Flags:O - outer vlan ,I - O indicates the outer VLAN ID; I indicates the inner
inner vlan ,P - Vlan- VLAN ID; P indicates the mapped VLAN ID.
mapping
Item Description
VLAN (O/I/P) Outer VLAN ID, inner VLAN ID, or mapped VLAN ID
of the online user.
NOTE
If verbose is not specified, only one of VSI, (BD-VLAN), and
VLAN (O/I/P) is displayed.
IPSG Status IPv4 effective indicates that IPv4 packet check takes
effect. slot: <3> indicates that the slot ID is 3.
Discover time Time when the access device receives a DHCP request
message.
Ack time Time when the access device receives a DHCP ACK
message.
Format
display dhcpv6 snooping statistics
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
None
Example
# Display DHCPv6 snooping statistics.
<HUAWEI> display dhcpv6 snooping statistics
DHCPV6 Snooping Statistics:
--------------------------------------------------------------------------------
DHCPV6 packets received from clients:
Solicit :3
Request :3
Renew : 36
Rebind :0
Inform :0
Release :2
Confirm : 394213
Decline :0
Relay-forward :0
DHCPV6 packets received from servers:
Advertise :3
Reply : 43
Relay-reply :0
DHCPV6 Packets Dropped:
LDRA distrust relay-forward : 0
Src mac conflict with server : 0
Not allow client transfer :0
Fake server :0
Reach savi user max number :0
Reach dhcp user max number :0
untrust relay-forw :0
relay-forward check :0
Check dhcpv6-request mac :0
DHCPV6 snooping user-bind table deleted:
Receive release packet :2
Receive decline packet :0
Exceed lifetime :0
User command :0
Client transfer :0
Interface down :1
Confirm-reply with error code : 0
Confirm-client offline :2
Check mac client offline :0
DAD NS packets sent to clients : 16
NA packets received from clients : 0
--------------------------------------------------------------------------------
Item Description
Src mac conflict with server When the source MAC address of a
DHCPv6 packet from a client conflicts with
the DHCPv6 server's MAC address, the
DHCPv6 packet is discarded. The field
indicates the number of DHCPv6 packets
discarded for this reason.
Not allow client transfer After clients are not allowed to change
access interfaces, if a DHCPv6 snooping
binding entry of a client exists on the
original interface and the client attempts
to change the access interface, the
DHCPv6 packets from this client are
discarded. The field indicates the number
of DHCPv6 packets discarded for this
reason.
To configure this item, run the undo dhcp
snooping user-transfer enable command.
Reach savi user max number Number of packets from clients discarded
because the maximum number of SAVI
binding entries that can be learned by the
interface is reached.
Reach dhcp user max number Number of packets from clients discarded
because the maximum number of DHCP
snooping binding entries that can be
learned by the interface is reached.
Item Description
Function
The display dhcpv6 snooping user-bind command displays the DHCPv6 snooping
binding table.
Format
display dhcpv6 snooping user-bind { { interface interface-type interface-number
| ipv6-address { ipv6-address | all } | mac-address mac-address | vlan vlan-id } * |
confirm-client | all } [ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After DHCP snooping is enabled, the device generates a DHCP snooping binding
table by listening to DHCP Request messages and Reply messages. A binding entry
contains the MAC address, IP address, number of the interface connected to the
DHCP client, and VLAN ID. You can run the display dhcpv6 snooping user-bind
command to view the DHCPv6 snooping binding table.
If prefix delegation (PD) users exist on the network, the device generates an IPv6
prefix binding entry. The display dhcpv6 snooping user-bind ipv6-prefix
command displays IPv6 prefix binding entries.
Example
# Display the DHCPv6 binding table.
● Display all the dynamic binding entries.
<HUAWEI> display dhcpv6 snooping user-bind all
DHCPV6 Dynamic Bind-table:
Flags:O - outer vlan ,I - inner vlan ,P - Vlan-mapping
IP Address MAC Address VSI/VLAN(O/I/P)/(BD-VLAN) Lease
--------------------------------------------------------------------------------
FC00:1::1 00e0-fc12-3456 500 /-- /-- 2008.10.01-00:26
--------------------------------------------------------------------------------
print count: 1 total count: 1
● Display detailed information about the IPv6 prefix binding table by specifying
the verbose parameter.
<HUAWEI> display dhcpv6 snooping user-bind ipv6-prefix all verbose
PD Dynamic Bind-table:
Flags:O - outer vlan ,I - inner vlan ,P - Vlan-mapping
--------------------------------------------------------------------------------
IP Address : FC00:2::/36
MAC Address : 00e0-fc12-3456
VSI : --
VLAN(O/I/P) : 500 /-- /--
Interface : GE0/0/1
Lease : 2008.10.03-00:30
User State : BOUND
--------------------------------------------------------------------------------
print count: 1 total count: 1
Item Description
Item Description
Format
reset dhcp snooping statistics { global | interface interface-type interface-
number [ vlan vlan-id ] | vlan vlan-id [ interface interface-type interface-
number ] }
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If statistics are collected after DHCP snooping is enabled, you can run the reset
dhcp snooping statistics command to clear the statistics.
Precautions
If both interface and vlan are specified, the specified interface must have been
added to the specified VLAN. The reset dhcp snooping statistics command is
used to clear DHCP snooping statistics in the VLAN to which the specified
interface is added.
Example
# Clear DHCP snooping statistics on GE0/0/1.
<HUAWEI> reset dhcp snooping statistics interface gigabitethernet 0/0/1
Format
reset dhcp snooping user-bind [ vlan vlan-id | interface interface-type interface-
number ] * [ ipv4 | ipv6 ]
reset dhcp snooping user-bind [ ip-address [ ip-address ] | ipv6-address [ ipv6-
address ] | vpls vpls-name ]
reset dhcp snooping user-bind bridge-domain bd-id
reset dhcp snooping user-bind [ ipv6-prefix [ prefix/prefix-length ] ]
NOTE
Only the , S5731-H, S5731S-H, S5732-H, S6730-H, S6730S-H support vpls parameter.
Only the S6730-H, S6730S-H, S6730-S, S6730S-S, S5732-H, S5731-S, S5731S-S, S5731S-H,
S5731-H, S6720-EI, S6735-S and S6720S-EI support the bridge-domain parameter.
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After DHCP snooping is enabled, the mapping DHCP snooping binding entries are
generated after DHCP users log in. The reset dhcp snooping user-bind command
clears binding entries mapping a specified parameter. If no parameter is specified,
all the binding entries are cleared.
Precautions
Example
# Clear DHCP snooping binding entries in VLAN 100.
<HUAWEI> reset dhcp snooping user-bind vlan 100
Function
The reset dhcpv6 snooping statistics command deletes DHCPv6 snooping
statistics.
Format
reset dhcpv6 snooping statistics
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
When you locate faults in DHCPv6 services, you need to collect statistics on
DHCPv6 snooping packets and deleted entries within a certain period of time.
Before collecting statistics using the display dhcpv6 snooping statistics
command, run the reset dhcpv6 snooping statistics command to delete historical
statistics.
Example
# Delete DHCPv6 snooping statistics.
<HUAWEI> reset dhcpv6 snooping statistics
Format
display nd snooping configuration
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
ND snooping configuration includes whether ND snooping is enabled or disabled
and information about ND snooping trusted interfaces.
To view ND snooping configuration, run the display nd snooping configuration
command.
Example
# Display ND snooping configuration.
<HUAWEI> display nd snooping configuration
#
nd snooping enable
#
interface GigabitEthernet0/0/1
nd snooping trusted
#
Format
display nd snooping [ static | dynamic ] prefix [ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
A device can establish a prefix management table which can be used to
implement duplicate address detection for users with IPv6 addresses and establish
a dynamic ND snooping binding table. A prefix management entry can be
statically configured or dynamically generated.
● Dynamic generation: The device obtains an RA packet received from an ND
snooping trusted interface and automatically generates a prefix management
entry based on the RA packet.
● Static configuration: When a gateway device does not send RA packets, you
can run the nd snooping static-prefix command to configure a static prefix
management entry.
You can run the display nd snooping prefix command to check prefix
management entries.
Example
# Display prefix management entries of users.
<HUAWEI> display nd snooping prefix
prefix-table:
Prefix Length Valid-Time Vlan(O/I)/BD Prefix-
Type
--------------------------------------------------------------------------------
FC00:1:: 64 - 10 /24/- static
FC00:2:: 64 2592000 1 /-/- dynamic
--------------------------------------------------------------------------------
Prefix table total count: 2 Print count: 2
Format
display nd snooping statistics
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After ND snooping is enabled, the device records statistics on the received, sent,
and discarded ND snooping packets to facilitate maintenance.
Example
# Display statistics on the ND snooping packets received, sent, and discarded on
the device.
<HUAWEI> display nd snooping statistics
Input: total 203 packets, discarded 14 packets
ns : 178
na : 21
rs : 4
ra : 0
other : 0
Drop Packet:
The local link address is incorrect : 7
It does not match the binding table : 1
The destination IP address is incorrect : 6
Output: total 50 packets
ns : 50
Item Description
Item Description
It does not match the binding Number of packets dropped because the
table packets do not match the binding entries.
Format
display nd snooping user-bind all [ verbose ]
display nd snooping user-bind { ipv6-address ipv6-address | mac-address mac-
address | interface interface-type interface-number | vlan vlan-id | bridge-
domain bd-id } * [ verbose ]
NOTE
Only the S6730-H, S6730S-H, S6730-S, S6730S-S, S5732-H, S5731-S, S5731S-S, S5731S-H,
S5731-H, S6720-EI, S6735-S and S6720S-EI support the bridge-domain parameter.
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
An ND snooping dynamic binding entry includes the source IPv6 address and
source MAC address of a user, and the VLAN that a user belongs to. You can run
the display nd snooping user-bind command to view details in the ND snooping
dynamic binding table.
Example
# Display all ND snooping dynamic binding entries.
<HUAWEI> display nd snooping user-bind all
ND Dynamic Bind-table:
Flags:O - outer vlan ,I - inner O indicates the outer VLAN ID; I indicates the
vlan ,P - Vlan-mapping inner VLAN ID; P indicates the mapped VLAN
ID.
Item Description
Format
nd snooping alarm binding-table check enable
undo nd snooping alarm binding-table check enable
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view, BD view, VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After ND protocol packet validity check is enabled using the nd snooping check
enable command, the device checks the NA, NS, and RS packets received from
untrusted interfaces against the ND snooping binding table and discards the
packets that do not match the binding table. If the number of discarded packets
exceeds the threshold, the corresponding alarm is generated. The minimum
interval for sending alarm messages is 1 minute. You can run the nd snooping
alarm binding-table check threshold command to set the alarm threshold.
Prerequisites
ND snooping has been enabled on the device using the nd snooping enable
command.
Precautions
To ensure that alarms can be properly reported, you need to run the snmp-agent
trap enable feature-name dhcp command to enable the DHCP module to report
the corresponding alarm. You can check whether the DHCP module is enabled to
report the corresponding alarm using the display snmp-agent trap feature-name
dhcp all command.
Example
# Enable the alarm function for checking packets against the ND snooping
binding table on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping alarm binding-table check enable
Format
nd snooping alarm binding-table check threshold threshold
undo nd snooping alarm binding-table check threshold
Parameters
Parameter Description Value
threshold Specifies the alarm threshold for the The value is an integer that
number of ND snooping-discarded ranges from 1 to 1000.
packets.
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view, VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the alarm function for checking packets against the ND snooping binding
table is enabled using the nd snooping alarm binding-table check enable
command, you can run the nd snooping alarm binding-table check threshold
command to configure the alarm threshold for the number of ND snooping-
discarded packets.
Prerequisites
ND snooping has been enabled on the device using the nd snooping enable
command.
Precautions
If this command is run in the system view, it takes effect on all the interfaces of
the device.
Example
# Set the alarm threshold for the number of ND snooping-discarded packets on
GE0/0/1 to 1000.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping alarm binding-table check threshold 1000
Format
nd snooping check { na | ns | rs } enable
Parameters
Parameter Description Value
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After ND packet validity check is enabled, the device verifies the NA/NS/RS
packets received by untrusted interfaces against the ND snooping binding table, to
determine whether the NA/NS/RS packets are sent from valid users in the VLAN
on the interface. The device forwards the ND packets from valid users and drops
invalid ND packets.
Prerequisites
ND snooping has been enabled globally using the nd snooping enable command.
Example
# Enable NA packet validity check on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping check na enable
Format
nd snooping check dad-ns retransmit-rate rate rate-value
undo nd snooping check dad-ns retransmit-rate rate
Parameters
Parameter Description Value
Views
System view, VLAN view, Eth-Trunk view, Ethernet interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, 40GE
interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the ND snooping binding entry is not established, an untrusted interface on
a device forwards a DAD NS packet after receiving it. After the nd snooping check
Example
# Set the retransmission rate of DAD NS packets to 60 packets per second in the
system view.
<HUAWEI> system-view
[HUAWEI] nd snooping check dad-ns retransmit-rate rate 60
Format
nd snooping check dad-ns retransmit-rate enable
undo nd snooping check dad-ns retransmit-rate enable
Parameters
None
Views
System view, VLAN view, Eth-Trunk view, Ethernet interface view, GE interface
view, XGE interface view, 25GE interface view, MultiGE interface view, 40GE
interface view, 100GE interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Example
# Enable the function of checking the retransmission rate of DAD NS packets in
the system view.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] nd snooping check dad-ns retransmit-rate enable
Format
nd snooping disable
undo nd snooping disable
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720S-EI, S6730-H,
S6730S-H, S6735-S, S6730-S, and S6730S-S support this command.
Parameters
None.
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Example
# Disable ND snooping on GE0/0/1 that has been added to VLAN 10.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] vlan 10
[HUAWEI-vlan10] nd snooping enable
[HUAWEI-vlan10] quit
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping disable
Function
The nd snooping enable command enables ND snooping.
Format
nd snooping enable
undo nd snooping enable
Parameters
None
Views
System view, VLAN view, Ethernet interface view, GE interface view, XGE interface
view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE
interface view, Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
ND provides powerful functions but has no security mechanism. Attackers often
use ND to attack network devices. Common ND attacks are as follows:
● An attacker uses the IP address of host A to send NS, NA, or RS packets to
host B or the gateway. Host B or the gateway then modifies their ND entries.
As a result, all packets sent from host B or the gateway to host A are sent to
the attacker.
● An attacker uses the gateway IP address to send RA packets to hosts. Then
the hosts incorrectly set IPv6 parameters and modify their ND entries.
To prevent ND attacks, enable ND snooping on the device. The device detects NS
packets in the DAD process to establish an ND snooping dynamic binding table
that includes source IPv6 addresses, source MAC addresses, VLANs, and inbound
ports. When receiving ND packets, the device checks the validity of ND packets
based on the ND snooping binding table and checks whether the user is an
authorized user in the VLAN that the port receiving ND packets belongs to. The
device forwards valid ND packets and discards invalid ND packets to defend
against ND attacks from bogus hosts or gateways.
NOTE
By default, the system reports a port-Up event 2 seconds after a user-side interface transits from
Down to Up state. If ND snooping is enabled before the port-Up event is reported, the system
cannot generate the ND snooping entry of the user connected to this interface. To avoid this
problem, run the carrier up-hold-time interval command to change the delay in reporting the
port-Up event to 0.
Example
# Enable ND snooping globally and on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping enable
Format
nd snooping enable dhcpv6 only
undo nd snooping enable
Parameters
None
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The device checks the validity of ND protocol packets against the IPv6 static
binding table, DHCPv6 dynamic binding table, and ND snooping binding table.
The IPv6 static binding table is manually configured by the administrator, the
DHCPv6 dynamic binding table is automatically generated by extracting
information from DHCPv6 Reply packets, and the ND snooping binding table is
automatically generated by extracting information from DAD NS packets. At the
same time, the ND protocol packet validity check function depends on the ND
snooping function (including enabling ND snooping and configuring ND snooping
trusted interfaces). In the DHCPv6 Only scenario, users are only allowed to obtain
IPv6 addresses using DHCPv6 and IPv6 addresses that are privately configured by
users and automatically generated using the PD address prefix are considered as
invalid addresses. In this scenario, ND snooping is disabled to prevent ND
snooping binding entries from being generated for such invalid addresses. In this
case, the ND protocol packet validity check function cannot be performed, so that
address spoofing attacks may exist on the network.
To resolve this problem, you can run the nd snooping enable dhcpv6 only and nd
snooping trusted dhcpv6 only commands to enable the ND snooping function in
the DHCPv6 Only scenario. After the nd snooping enable dhcpv6 only command
is configured, no ND snooping binding entry is generated for the IPv6 global
unicast addresses that are manually configured by users and automatically
generated using the PD address prefixes. The device checks the validity of ND
protocol packets against the IPv6 static binding table and DHCPv6 dynamic
binding table.
Prerequisites
ND snooping has been enabled globally using the nd snooping enable command.
Precautions
● In the DHCPv6 Only scenario, ND snooping binding entries are generated for
the IPv6 link-local addresses that are manually configured by users and
automatically generated. To be specific, only records corresponding to the
IPv6 link-local addresses exist in the ND snooping binding table in the
DHCPv6 Only scenario.
● IPv6 addresses obtained using DHCPv6 PD also apply to the DHCPv6 Only
scenario.
Example
# Enable ND snooping globally and on interface GE0/0/1.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping enable dhcpv6 only
Function
The nd snooping max-user-number command sets the maximum number of ND
snooping dynamic binding entries to be learned by an interface.
Format
nd snooping max-user-number max-user-number
Parameters
Parameter Description Value
Views
System view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If a lot of users go online through an interface, the device consumes many ND
snooping dynamic binding entries to process the NS packets. To prevent this
problem, you can set the maximum number of ND snooping dynamic binding
entries to be learned by an interface. If the number of the ND snooping dynamic
binding entries learned by an interface reaches the maximum number, no entry
can be added.
You can set the maximum number ND snooping entries in the system view or
interface view. The configuration in the system view is valid for all interfaces. The
settings in the interface view only take effect on the specified interface. If the
settings are performed in both the interface view and system view, the smaller
value is adopted.
Prerequisites
Before setting the maximum number of ND snooping dynamic binding entries to
be learned by an interface, ensure that ND snooping has been enabled in the
system view using the nd snooping enable command.
Example
# Set the maximum number of ND snooping binding entries to 200 on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping max-user-number 200
Function
The nd snooping static-prefix command configures a static prefix management
entry.
Format
nd snooping static-prefix ipv6-address/prefix-length [ vlan vlan-id [ ce-vlan ce-
vlan-id ] ]
undo nd snooping static-prefix ipv6-address/prefix-length [ vlan vlan-id [ ce-
vlan ce-vlan-id ] ]
Parameters
Parameter Description Value
vlan vlan-id Specifies the outer VLAN ID. The value is an integer
NOTE that ranges from 1 to
By default, the outer VLAN ID 4094.
is 1 and no inner VLAN is
configured.
ce-vlan ce-vlan-id Specifies the inner VLAN ID. The value is an integer
that ranges from 1 to
4094.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After receiving an NS packet from a user, a device can generate a dynamic ND
snooping binding entry only after the value of the Target Address field in the
packet matches the user's prefix management entry. The device obtains an RA
packet received from an ND snooping trusted interface and automatically
generates a prefix management entry based on the RA packet. However, if a
gateway device does not send RA packets, the device cannot automatically
generate a prefix management entry and then cannot establish a corresponding
dynamic ND snooping binding entry, affecting services. In this case, you can run
the nd snooping static-prefix ipv6-address/prefix-length [ vlan vlan-id [ ce-vlan
ce-vlan-id ] ] command to manually configure a prefix management entry.
Prerequisites
ND snooping has been enabled using the nd snooping enable command in the
system view.
Precautions
The total number of statically configured and dynamically generated prefix
management entries cannot exceed the maximum number of entries allowed on a
device. Otherwise, no prefix management entry can be further statically
configured or dynamically generated.
Example
# Configure a static prefix management entry with the IPv6 address prefix
FC00:1::/64.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] nd snooping static-prefix fc00:1::/64
Format
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view, BD view
nd snooping trusted
undo nd snooping trusted
VLAN view
nd snooping trusted interface interface-type interface-number
undo nd snooping trusted interface interface-type interface-number
Parameters
Parameter Description Value
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
ND snooping classifies interfaces connected to IPv6 nodes into trusted and
untrusted interfaces. The trusted interfaces connect to trusted IPv6 nodes and
untrusted interfaces connect to untrusted IPv6 nodes. By default, all interfaces are
untrusted.
Generally, the interface connecting to the gateway is configured as the trusted interface, and
other interfaces are all untrusted interfaces.
Prerequisites
ND snooping has been enabled using the nd snooping enable command in the
system view.
Precautions
When you run the nd snooping trusted command in the VLAN view, the specified
interface must belong to the VLAN.
Example
# Configure GE0/0/1 as a trusted interface.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping trusted
Function
The nd snooping trusted dhcpv6 only command configures the interfaces in the
DHCPv6 Only scenario as ND snooping trusted interfaces.
Format
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view, BD view
nd snooping trusted dhcpv6 only
undo nd snooping trusted
VLAN view
nd snooping trusted interface interface-type interface-number dhcpv6 only
undo nd snooping trusted interface interface-type interface-number
Parameters
Parameter Description Value
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view, BD view
Default Level
2: Configuration level
Usage Guidelines
The device checks the validity of ND protocol packets against the IPv6 static
binding table, DHCPv6 dynamic binding table, and ND snooping binding table.
The IPv6 static binding table is manually configured by the administrator, the
DHCPv6 dynamic binding table is automatically generated by extracting
information from DHCPv6 Reply packets, and the ND snooping binding table is
automatically generated by extracting information from DAD NS packets. At the
same time, the ND protocol packet validity check function depends on the ND
snooping function (including enabling ND snooping and configuring ND snooping
trusted interfaces). In the DHCPv6 Only scenario, users are only allowed to obtain
IPv6 addresses using DHCPv6 and IPv6 addresses that are privately configured by
users and automatically generated using the PD address prefix are considered as
invalid addresses. In this scenario, ND snooping is disabled to prevent ND
snooping binding entries from being generated for such invalid addresses. In this
case, the ND protocol packet validity check function cannot be performed, so that
address spoofing attacks may exist on the network.
To resolve this problem, you can run the nd snooping enable dhcpv6 only and nd
snooping trusted dhcpv6 only commands to enable the ND snooping function in
the DHCPv6 Only scenario. After the nd snooping trusted dhcpv6 only command
is configured, no prefix management entry is generated when the trusted interface
receives an RA packet, which is different from the nd snooping trusted command.
This is because the prefix management entries need to be matched before the
corresponding ND snooping binding entries are generated for the IPv6 addresses
excluding the IPv6 link-local addresses. However, only records corresponding to the
IPv6 link-local addresses exist in the ND snooping binding table in the DHCPv6
Only scenario. Therefore, the prefix management entries do not need to be
generated.
Example
# Configure GE0/0/1 as an ND snooping trusted interface.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd snooping trusted dhcpv6 only
Function
The nd snooping user-alarm percentage command configures the alarm
thresholds for the percentage of ND snooping dynamic binding entries.
By default, the lower alarm threshold for the percentage of ND snooping dynamic
binding entries is 50, and the upper alarm threshold for the percentage of ND
snooping dynamic binding entries is 100.
Format
nd snooping user-alarm percentage percent-lower-value percent-upper-value
Parameters
Parameter Description Value
percent-lower- Specifies the lower alarm The value is an integer that
value threshold for the percentage ranges from 1 to 100.
of ND snooping dynamic
binding entries.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
After you run the nd snooping max-user-number command to set the maximum
number of ND snooping dynamic binding entries on an interface, you can run the
nd snooping user-alarm percentage command to set the alarm thresholds for
the percentage of ND snooping dynamic binding entries.
When the percentage of learned ND snooping dynamic binding entries against the
maximum number of ND snooping dynamic entries allowed by the device reaches
or exceeds the upper alarm threshold, the device generates an alarm. When the
percentage of learned ND snooping dynamic binding entries against the maximum
number of ND snooping dynamic entries allowed by the device reaches or falls
below the lower alarm threshold later, the device generates a clear alarm. The
alarm information helps network administrators monitor the status of ND
snooping binding table in real time.
Example
# Set the lower alarm threshold for the percentage of ND snooping dynamic
binding entries to 30 and the upper alarm threshold to 80.
<HUAWEI> system-view
[HUAWEI] nd snooping user-alarm percentage 30 80
By default, the wait time for a device to send an NS packet to detect the user
status is 250 milliseconds and the lifetime of an ND snooping binding entry when
a device detects the user status is 500 milliseconds.
Format
nd snooping wait-time wait-time life-time life-time
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
● If the entry is within the lifetime and the device receives an NA packet from
the port corresponding to the entry, the user corresponding to the entry is still
online and the device updates the IP address lease in the corresponding entry.
● If the entry is within the lifetime and the device does not receive an NA
packet from the port corresponding to the entry, the user corresponding to
the entry is offline and the device updates the user's IP address lease time in
the entry and updates the port number in the entry to that in the previously
received NA packet.
Prerequisites
ND snooping has been enabled using the nd snooping enable command in the
system view.
Precautions
After the device receives an NA packet conflicting with an ND snooping binding
entry and user status detection is enabled, periodic user status detection is
suspended.
Example
# Set the wait time for a device to send an NS packet to detect the user status to
300 milliseconds and the lifetime of an ND snooping binding entry when a device
detects the user status to 2000 milliseconds.
<HUAWEI> system-view
[HUAWEI] nd snooping enable
[HUAWEI] nd snooping wait-time 300 life-time 2000
Format
nd user-bind detect retransmit retransmit-times interval retransmit-interval
undo nd user-bind detect retransmit interval
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After automatic user status detection for users mapping ND snooping dynamic
binding entries is enabled, the device sends NS packets to users based on the
configured detection times and interval. If no NA packet is returned from a user
after NS packets are sent for configured times, the device considers the user to be
offline and deletes the mapping ND snooping dynamic binding entry.
You can run the nd user-bind detect command to change the number of times
and interval for sending NS packets to detect the user status. On a small network
with good network quality, the user returns an NA packet quickly. In this scenario,
you can set the interval for sending NS packets to a small value. On a large
network with poor network quality, the user returns an NA packet slowly. You can
set the interval to a large value to prevent the device from sending the next NS
packet before receiving the NA packet. You can change the interval based on the
actual network environment.
Prerequisites
Automatic user status detection for users mapping ND snooping dynamic binding
entries has been enabled using the nd user-bind detect enable command.
Precautions
After you run the nd user-bind detect enable command, the device sends an NS
packet after a period of time. The maximum value of this period is 20 seconds.
Example
# Set the number of times for sending NS packets to 10, and the interval for
sending NS packets to 1000 milliseconds.
<HUAWEI> system-view
[HUAWEI] nd user-bind detect enable
[HUAWEI] nd user-bind detect retransmit 10 interval 1000
Format
nd user-bind detect enable
undo nd user-bind detect enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After ND snooping is enabled, the device snoops NS packets in the DAD process to
establish ND dynamic binding entries. The aging time of an ND snooping dynamic
binding table depends on the IPv6 address lease. If the address lease does not
expire but the user is offline, the ND snooping dynamic entry mapping the user
cannot be deleted, which occupies binding entry resources on the device.
To prevent this problem, you can enable the automatic user status detection for
users mapping ND snooping dynamic binding entries on the device. After this
function is enabled, the device sends NS packets to the user according to the
detection times (n) specified in nd user-bind detect and detection interval. If the
device receives no NA packet from the user after sending the NS packets n times,
the device considers the user to be offline and deletes the dynamic ND snooping
binding entry matching the user.
Precautions
After you run the nd user-bind detect enable command, the device sends an NS
packet after a period of time. The maximum value of this period is 20 seconds.
Example
# Enable the function for automatically detecting status of users mapping ND
snooping dynamic binding entries.
<HUAWEI> system-view
[HUAWEI] nd user-bind detect enable
Format
reset nd snooping prefix [ ipv6-address/prefix-length ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The ND server that functions as the gateway router sends RA packets periodically
to instruct users to update prefixes. The switch that functions as the access device
establishes prefix management entries based on RA packets to maintain and
manage user prefixes.
Generally, do not delete prefix management entries of users manually. Run the
reset nd snooping prefix command to delete prefix management entries of users
if the following requirements are met:
● The user lease does not expire and the prefix management table cannot age
automatically.
● The user is no longer connected to the network.
Precautions
After a prefix management entry is deleted, the switch cannot establish the ND
snooping dynamic binding table for new users with the prefix management entry.
Example
# Delete the prefix management entry with the prefix address being fc00:1::1 and
the prefix length being 64.
<HUAWEI> reset nd snooping prefix fc00:1::1/64
Format
reset nd snooping statistics
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Use Scenario
After ND snooping is enabled, the device records statistics on the sent and
received ND packets. This command deletes the statistics on ND packets.
Precautions
Example
# Delete statistics on ND snooping packets.
<HUAWEI> reset nd snooping statistics
Format
reset nd snooping user-bind [ interface interface-type interface-number | ipv6-
address ipv6-address | mac-address mac-address | vlan vlan-id | bridge-domain
bd-id ]
NOTE
Only the S6730-H, S6730S-H, S6730-S, S6730S-S, S5732-H, S5731-S, S5731S-S, S5731S-H,
S5731-H, S6720-EI, S6735-S and S6720S-EI support the bridge-domain parameter.
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
You need to manually delete ND snooping dynamic binding entries if the following
requirements are met:
● The ND snooping dynamic binding entry does not reach the aging time, so
the entry cannot age automatically.
● The user is no longer connected to the network.
● The user VLAN or interface information changes.
The networking environment change may lead to the change in the VLAN or
interface information, while the ND snooping dynamic binding entry mapping a
user does not age out and cannot update in real time. As a result, the device
discards valid ND packets that do not match the old ND snooping dynamic
binding entries. Before changing the networking environment, clear all ND
snooping dynamic binding entries manually so that a device generates a new ND
snooping dynamic binding table based on the new networking environment.
Example
# Delete the ND snooping dynamic binding entry that contains the IPv6 address
being fc00:1::1.
<HUAWEI> reset nd snooping user-bind ipv6-address fc00:1::1
# Delete the ND snooping dynamic binding entry that contains the MAC address
being 00e0-fc11-2222.
<HUAWEI> reset nd snooping user-bind mac-address 00e0-fc11-2222
Function
The display nd raguard policy command displays the configuration of an IPv6 RA
guard policy.
Format
display nd raguard policy [ policy-name ]
Parameters
policy-name Displays the configuration of the The value must be the name
IPv6 RA guard policy with the of an existing IPv6 RA guard
specified name. policy.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To view the matching rules configured in a specified IPv6 RA guard policy, run the
display nd raguard policy command. RA messages can be forwarded only when
they match all rules.
Example
# Display the IPv6 RA guard policy configured on the device.
<HUAWEI> display nd raguard policy
------------------------------------------------
ID nd-raguard-policy name
0 p1
1 p2
2 p3
------------------------------------------------
Total 3, printed 3
ID ID.
Item Description
Format
display nd raguard statistic [ interface interface-type interface-number ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
When the interface role of an interface is a host interface or when an IPv6 RA
guard policy is applied to an interface and RA messages received on the interface
do not match the rules configured in the policy, the interface discards RA
messages. The device supports the display of discarded RA message statistics
based on interfaces.
Example
# Display statistics about RA messages discarded by a specified interface.
<HUAWEI> display nd raguard statistic
RA messages dropped by RA guard:
Interface Dropped
Eth-trunk10 1221
Item Description
14.10.4 hop-limit
Function
The hop-limit command configures a rule to match RA messages against the
maximum and minimum hop limits in RA messages.
By default, the maximum and minimum hop limits in an RA message are 255 and
1 respectively.
Format
hop-limit { maximum max-value | minimum min-value }
Parameters
NOTE
In the same IPv6 RA guard policy, if both max-value and min-value are configured, min-
value must be less than or equal to max-value.
Views
IPv6 RA guard policy view
Default Level
2: Configuration level
Usage Guidelines
The Hop Limit field in an RA message indicates the maximum number of hops
that the message can pass through. The value is decremented by 1 each time the
message passes through a device. The message is discarded when the field value is
0. After the maximum or minimum hop limit is configured in the IPv6 RA guard
policy view, the interface to which the policy is applied forwards only the RA
messages whose hop limit is within the configured range and discards those
whose hop limit is outside the configured range.
Example
# In the IPv6 RA guard policy p1, set the maximum and minimum hop limits in RA
messages to 10 and 5 respectively.
<HUAWEI> system-view
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] hop-limit maximum 10
[HUAWEI-nd-raguard-policy-p1] hop-limit minimum 5
Function
The if-match source-mac-address command configures an ACL to match RA
messages against the source MAC address in RA messages.
The undo if-match source-mac-address command deletes the ACL used to match
RA messages against the source MAC address in RA messages.
Format
if-match source-mac-address acl acl-number
Parameters
Parameter Description Value
Views
IPv6 RA guard policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Example
# In the IPv6 RA guard policy p1, configure the switch to forward RA messages
with the source MAC address 0001-0001-0001 or 0022-0022-0022.
<HUAWEI> system-view
[HUAWEI] acl 4001
[HUAWEI-acl-L2-4001] rule 1 permit source-mac 0001-0001-0001
[HUAWEI-acl-L2-4001] rule 2 permit source-mac 0022-0022-0022
[HUAWEI-acl-L2-4001] quit
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] if-match source-mac-address acl 4001
Function
The if-match ipv6-source-address command configures an ACL to match RA
messages against the source IPv6 address in RA messages.
The undo if-match ipv6-source-address command deletes the ACL used to match
RA messages against the source IPv6 address in RA messages.
Format
if-match ipv6-source-address acl acl-number
Parameters
Parameter Description Value
Views
IPv6 RA guard policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
within the network segment configured in the ACL and forwards only the RA
messages that match the ACL.
Precautions
Example
# In the IPv6 RA guard policy p1, configure the switch to forward RA messages
with the source IPv6 address FC00:1::10/64.
<HUAWEI> system-view
[HUAWEI] acl ipv6 2000
[HUAWEI-acl6-basic-2000] rule 1 permit source fc00:1::/64
[HUAWEI-acl6-basic-2000] quit
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] if-match ipv6-source-address acl 2000
Function
The if-match prefix command configures an ACL to match RA messages against
the IPv6 prefix in RA messages.
The undo if-match prefix command deletes the ACL used to match RA messages
against the IPv6 prefix in RA messages.
Format
if-match prefix acl acl-number
Parameters
Parameter Description Value
Views
IPv6 RA guard policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
Example
# In the IPv6 RA guard policy p1, configure the switch to forward RA messages
with the IPv6 prefix FC00:1::/64.
<HUAWEI> system-view
[HUAWEI] acl ipv6 2000
[HUAWEI-acl6-basic-2000] rule 1 permit source fc00:1::/64
[HUAWEI-acl6-basic-2000] quit
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] if-match prefix acl 2000
14.10.8 managed-address-flag
Function
The managed-address-flag command configures a rule to match RA messages
against the M flag in RA messages.
Format
managed-address-flag { on | off }
undo managed-address-flag
Parameters
Views
IPv6 RA guard policy view
Default Level
2: Configuration level
Usage Guidelines
The M flag in an RA message determines whether users use stateful
autoconfiguration to obtain IPv6 addresses. When the M flag is set to 1, a user
obtains an IPv6 address using stateful autoconfiguration (for example, a DHCPv6
server). When the M flag is set to 0, a user obtains an IPv6 address using stateless
autoconfiguration. That is, an IPv6 address is generated for the user according to
the prefix information advertised by the router and the link-layer address of the
user.
Example
# In the IPv6 RA guard policy p1, set the matching rule of the M flag to on. That
is, users obtain IPv6 addresses using stateful autoconfiguration.
<HUAWEI> system-view
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] managed-address-flag on
Function
The nd raguard role command configures an interface role for IPv6 RA guard.
The undo nd raguard role command deletes the interface role configured for IPv6
RA guard.
Format
nd raguard role { host | router }
undo nd raguard role
Parameters
Parameter Description Value
Views
Layer 2 Ethernet interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Administrators can configure an interface role based on the network location of
interfaces. If an interface is connected to a user host, administrators can configure
the interface role of the interface as a host interface. If the interface is connected
to a router, administrators can configure the interface role of the interface as a
router interface.
● If the interface role of the interface is a router interface, the system forwards
the RA messages received by the interface.
● If the interface role of the interface is a host interface, the system discards the
RA messages.
Example
# On GE0/0/1, configure the interface role as a router interface for IPv6 RA guard.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd raguard role router
Format
nd raguard policy policy-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can configure an IPv6 RA guard policy for an interface to filter RA messages in
the following situations:
Follow-up Procedure
Configure a matching rule in the IPv6 RA guard policy view and run the nd
raguard attach-policy command to apply the IPv6 RA guard policy to an
interface.
Example
# Create an IPv6 RA guard policy named p1.
<HUAWEI> system-view
[HUAWEI] nd raguard policy p1
Format
nd raguard attach-policy policy-name
undo nd raguard attach-policy
Parameters
Parameter Description Value
policy-name Specifies the name of an IPv6 The value must be the name of
RA guard policy. an existing IPv6 RA guard policy.
Views
Layer 2 Ethernet interface view, Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
After an IPv6 RA guard policy is bound to an interface, the interface filters
received RA messages based on the matching rules configured in the policy.
Example
# Bind the IPv6 RA guard policy p1 to GE0/0/1.
<HUAWEI> system-view
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] quit
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] nd raguard attach-policy p1
Format
nd raguard log enable
Parameters
None.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
The IPv6 RA guard log function records RA message processing information to
meet the audit requirements of administrators. After this function is enabled, the
device generates the ND_RAGUARD/3/ND_RAGUARD_DROP log when detecting
invalid RA messages. The log content includes the name of the attacked interface,
source IP address and source MAC address of RA messages, and total number of
RA messages discarded on the interface.
The IPv6 RA guard logs generated by the device are sent to the information center
module for processing. The configuration of the information center module
determines the output rules and output directions of the logs. For details about
the information center, see Information Center Configuration in the S300, S500,
S2700, S5700, and S6700 V200R021C10 Configuration Guide - Device
Management.
Example
# Enable the IPv6 RA guard log function.
<HUAWEI> system-view
[HUAWEI] nd raguard log enable
14.10.13 other-config-flag
Function
The other-config-flag command configures a rule to match RA messages against
the O flag in RA messages.
The undo other-config-flag command deletes the rule used to match RA
messages against the O flag in RA messages.
By default, no rule is configured to match RA messages against the O flag in RA
messages.
Format
other-config-flag { on | off }
undo other-config-flag
Parameters
Parameter Description Value
Views
IPv6 RA guard policy view
Default Level
2: Configuration level
Usage Guidelines
The O flag in an RA message determines whether users use stateful
autoconfiguration to obtain information other than IPv6 addresses. When the O
flag is set to 1, a user obtains information other than an IPv6 address using
stateful autoconfiguration (for example, a DHCPv6 server). When the O flag is set
to 0, a user obtains information other than an IPv6 address using stateless
autoconfiguration.
After a rule is configured to match RA messages against the O flag in RA
messages in the IPv6 RA guard policy view, the interface to which the policy is
applied checks the O flag in the received RA messages and forwards the messages
only when the messages match the rule. Otherwise, the interface discards the
messages.
Example
# In the IPv6 RA guard policy p1, set the matching rule of the O flag to on. That
is, users obtain information other than IPv6 addresses using stateful
autoconfiguration.
<HUAWEI> system-view
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] other-config-flag on
Format
router-preference maximum { high | medium | low }
Parameters
Views
IPv6 RA guard policy view
Default Level
2: Configuration level
Usage Guidelines
RA messages carry the route preference field. Route preferences are classified into
high preference (with the value 1), medium preference (with the value 0), and low
preference (with the value 3). After receiving an RA message, a host updates its
default route list and selects a route in descending order of the route preference.
Example
# In the IPv6 RA guard policy p1, set the highest route preference used to match
RA messages to medium preference.
<HUAWEI> system-view
[HUAWEI] nd raguard policy p1
[HUAWEI-nd-raguard-policy-p1] router-preference maximum medium
Function
The reset nd raguard statistic command clears statistics about RA messages
discarded by interfaces.
Format
reset nd raguard statistic [ interface interface-type interface-number ]
Parameters
Views
User view
Default Level
3: Management level
Usage Guidelines
To collect statistics about RA messages discarded on interfaces within a certain
period, run the reset nd raguard statistic command to clear the existing statistics
and then run the display nd raguard statistic command.
Example
# Clear statistics about RA messages discarded by interfaces.
<HUAWEI> reset nd raguard statistic
Commands provided in this section and all the parameters in the commands are
supported by all switch models by default, unless otherwise specified. For details,
see specific commands.
Format
display pppoe intermediate-agent information encapsulation
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To view the fields and vendor ID added to PPPoE packets, you can run display
pppoe intermediate-agent information encapsulation command to view the
information.
Example
# Display the fields and vendor ID added to PPPoE packets.
<HUAWEI> display pppoe intermediate-agent information encapsulation
The vendor id is: 2011
Encapsulation content contains: Circuit-id and Remote-id
Item Description
Format
display pppoe intermediate-agent information format
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After PPPoE+ is enabled globally, you can run the display pppoe intermediate-
agent information format command to check whether the configuration of the
circuit ID or remote ID added to PPPoE packets is correct.
Example
# Display formats of circuit ID and remote ID that are configured globally.
<HUAWEI> display pppoe intermediate-agent information format
The current information format :
Circuit ID : EXTEND
Remote ID : COMMON
For example:
interface GigabitEthernet0/0/1 SVLAN:200 CVLAN:100
The PPPOE Intermediate Agent information is as follows:
Circuit ID:00 04 00 c8 00 00
Remote ID:0022-0033-0044
Item Description
Function
The display pppoe intermediate-agent information policy command displays
the global policy for processing original fields in PPPoE packets at the user side
and PPPoE server side.
Format
display pppoe intermediate-agent information policy
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display pppoe intermediate-agent information policy command displays
the global policy for processing original fields in PPPoE packets at the user side
and PPPoE server side.
Example
# Display the global policy for processing original information fields in PPPoE
packets at the user side and PPPoE server side.
<HUAWEI> display pppoe intermediate-agent information policy
The current information Policy :REPLACE
The current ignore-reply Policy:ENABLE
The current ignore-reply Policy Global policy for processing PPPoE reply
packets sent by the PPPoE server:
● ENABLE: indicates that the device does
not process PPPoE reply packets sent by
the PPPoE server.
● DISABLE: indicates that the device
processes PPPoE reply packets sent by the
PPPoE server.
You can run the pppoe intermediate-agent
information ignore-reply command to set
this parameter.
Function
The pppoe intermediate-agent information enable command enables PPPoE+
globally.
Format
pppoe intermediate-agent information enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
After PPPoE+ is enabled globally, the device can add information about the
interface connected to the PPPoE client such as the slot ID/subcard ID/interface
number to PPPoE packets. The user account and access interface information are
both authenticated, preventing user account embezzling.
NOTE
If PPPoE+ is enabled on the device that has no ACL resources, the system displays the
following message "Warning: Allocate acl resources failed." In this case, PPPoE+ does not
work.
Example
# Enable PPPoE+ globally.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
Function
The pppoe intermediate-agent information encapsulation command configures
fields added to PPPoE packets.
By default, the device adds the circuit-id and remote-id fields to PPPoE packets.
Format
pppoe intermediate-agent information encapsulation { circuit-id | remote-id }
*
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After PPPoE+ is enabled, the device adds the circuit-id and remote-id fields to
PPPoE packets by default. If the remote non-Huawei PPPoE server can identify
only the circuit-id or remote-id field, run the pppoe intermediate-agent
information encapsulation command to configure the device only to add the
circuit-id or remote-id fields to PPPoE packets.
Prerequisites
The PPPoE+ function has been enabled by running the pppoe intermediate-
agent information enable command in the system view.
Example
# Configure the device only to add the circuit-id field to PPPoE packets.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information encapsulation circuit-id
Function
The pppoe intermediate-agent information format command configures the
format of fields added to PPPoE packets.
By default, the format of fields circuit-id and remote-id added to PPPoE packets
is common.
Format
pppoe intermediate-agent information [ vlan vlan-id ] [ ce-vlan cevlan-id ]
format { circuit-id | remote-id } { common | extend | user-defined text }
Parameters
Parameter Description Value
Views
System view and interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After PPPoE+ is enabled globally, the default policy for processing user-side PPPoE
packets is replace. The device replaces original information fields in the PPPoE
packets received at the user side with those in common format. You can run the
pppoe intermediate-agent information format command to change the format
of information fields.
When the policy for processing user-side PPPoE packets is replace and the pppoe
intermediate-agent information format command is executed, all interfaces add
fields in a specified format to received PPPoE packets in the system view.
When the pppoe intermediate-agent information format command is
configured, the device uses the following matching rules to encapsulate the
information fields in PPPoE packets:
● For a double-tagged packet, the device matches the VLAN IDs in both the
outer and inner VLAN tags. If the match fails, the device matches the VLAN
ID in the inner VLAN tag, followed by that in the outer VLAN tag. If the
match still fails, the device considers the packet does not carry a VLAN ID,
and does not encapsulate the packet.
● For a single-tagged packet, the device matches the VLAN ID in the outer
VLAN tag. If the match fails, the device considers the packet does not carry a
VLAN ID, and does not encapsulate the packet.
If the pppoe intermediate-agent information format command is configured in
both the interface and system views, the configuration in the interface view takes
effect.
NOTE
Prerequisites
Separators must be added between keywords; otherwise, they cannot be parsed. The
separators cannot be numbers.
Example
# Configure the extended format for the remote-id field added to PPPoE packets.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information format remote-id extend
# Configure the user-defined format for the circuit-id field added to PPPoE
packets and encapsulate the port name, outer VLAN ID, inner VLAN ID, and host
name in ASCII format.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information format circuit-id user-defined "%portname:%svlan.
%cvlan %sysname"
# Configure the extended format for the remote-id field added to PPPoE packets
on GE1/0/1.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] pppoe intermediate-agent information format remote-id extend
Format
pppoe intermediate-agent information ignore-reply { disable | enable }
undo pppoe intermediate-agent information ignore-reply
Parameters
Parameter Description Value
disable Indicates that the device processes PPPoE reply packets sent -
by the PPPoE server.
enable Indicates that the device does not process PPPoE reply -
packets sent by the PPPoE server.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Generally, the device does not process PPPoE reply packets and directly forwards
them to the PPPoE client. Only when the PPPoE client cannot identify PPPoE
packets that the device directly forwards, the device needs to process the PPPoE
reply packets sent by the PPPoE server to ensure communication between the
PPPoE server and PPPoE client. The PPPoE reply packets are processed as follows:
● When the policy for processing original fields in PPPoE packets is replace or
keep:
– If fields are not contained in PPPoE reply packets sent by the PPPoE
server, the device directly forwards PPPoE reply packets.
– If fields are contained in PPPoE reply packets sent by the PPPoE server
and the format and content are consistent with those of the fields added
to the user-side PPPoE packets, the device removes the original fields
from PPPoE packets and forwards the packets. If the format and content
are different from those of the fields added to the user-side PPPoE
packets, the device directly forwards PPPoE reply packets.
● When the policy for processing original fields in PPPoE packets is drop, the
device directly forwards the PPPoE packets:
Precautions
The pppoe intermediate-agent information ignore-reply command takes effect
only after PPPoE+ is enabled globally. To modify the configuration, disable PPPoE+
globally first.
If the device is configured to process the PPPoE reply packets sent by the PPPoE
server, the user access rate is reduced when the PPPoE server sends a large
number of PPPoE+ packets.
Example
# Configure the device to process PPPoE reply packets sent by the PPPoE server.
<HUAWEI> system-view
[HUAWEI] undo pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information ignore-reply disable
[HUAWEI] pppoe intermediate-agent information enable
Format
pppoe intermediate-agent information policy { drop | replace | keep }
undo pppoe intermediate-agent information policy
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the policy for processing original fields in user-side PPPoE packets is
configured, the device can add information about the interface connected to the
PPPoE client such as the slot ID/subcard ID/interface number, VLAN ID, and MAC
address to PPPoE packets. The user account and access interface information are
both authenticated, preventing user account embezzling. If received PPPoE packets
contain fields related to the interface that connected to the PPPoE client, the
device removes or reserves original fields as required.
You can run the pppoe intermediate-agent information policy (system view)
command to configure the PPPoE packet processing policy for all interfaces in the
system view. To use a different policy on a specified interface, run the pppoe
intermediate-agent information policy command. In this case, the policy for
processing PPPoE packets on the interface depends on the interface configuration.
Prerequisites
PPPoE+ has been enabled globally by running the pppoe intermediate-agent
information enable command.
Example
# Configure GE0/0/1 to replace original fields in the received PPPoE packets with
the circuit ID and remote ID of the local device.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] pppoe intermediate-agent information policy replace
Function
The pppoe intermediate-agent information policy command configures the
policy for all interfaces to process original fields in user-side PPPoE packets.
By default, the policy configured on all interfaces to process original fields in user-
side PPPoE packets is replace.
Format
pppoe intermediate-agent information policy { drop | replace | keep }
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the policy for processing original fields in user-side PPPoE packets is
configured, the device can add information about the interface connected to the
PPPoE client such as the slot ID/subcard ID/interface number, VLAN ID, and MAC
address to PPPoE packets. The user account and access interface information are
both authenticated, preventing user account embezzling. If received PPPoE packets
contain fields related to the interface that connected to the PPPoE client, the
device removes or reserves original fields as required.
After the command is executed, the policy for processing PPPoE packets takes
effect on all interfaces. To configure a policy on a specified interface, run the
pppoe intermediate-agent information policy (interface view) command. In
this case, the policy for processing PPPoE packets on the interface depends on the
interface configuration.
Prerequisites
PPPoE+ has been enabled globally by running the pppoe intermediate-agent
information enable command.
Example
# Configure all interfaces to replace original fields in the received PPPoE packets
with the circuit ID and remote ID of the local device.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information policy replace
Format
pppoe intermediate-agent information vendor-id vendor-id
undo pppoe intermediate-agent information vendor-id
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After PPPoE+ is enabled, the device must negotiate with the PPPoE server using
PPPoE packets containing the vendor ID. By default, the device adds vendor ID
2011 to PPPoE packets. If the device is connected to a non-Huawei PPPoE server,
the vendor ID may not be 2011; for example, the vendor ID is 3561. In this case,
run the pppoe intermediate-agent information vendor-id vendor-id command
to set the vendor ID to be the same as that in PPPoE packets sent from the non-
Huawei PPPoE server.
Prerequisites
Example
# Set the vendor ID added to PPPoE packets to 3561.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information vendor-id 3561
Function
The pppoe uplink-port trusted command configures an interface as a trusted
interface.
Format
pppoe uplink-port trusted
undo pppoe uplink-port trusted
Parameters
None
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To prevent bogus PPPoE servers and the security risk caused by PPPoE packets
forwarded to non-PPPoE service interfaces, the interface connecting the device
and the PPPoE server must be configured as the trusted interface. Then PPPoE
protocol packets are forwarded to the PPPoE server through the trusted interface
only. In addition, only the PPPoE protocol packets received on the trusted interface
can be forwarded to the PPPoE client.
Prerequisites
PPPoE+ has been enabled globally by running the pppoe intermediate-agent
information enable command.
Precautions
The trusted interface controls PPPoE protocol packets at the PPPoE discovery stage
only. PPPoE service packets at the PPPoE session stage are not controlled.
If the trusted interface is configured on the device that has no ACL resources, the
system displays the following message "Warning: Allocate acl resources failed." In
this case, the trusted interface fails to be configured.
Example
# Configure GE0/0/1 as the PPPoE trusted interface.
<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] pppoe uplink-port trusted
Function
The display dhcp static user-bind command displays information about a static
binding table.
Format
display dhcp static user-bind { { interface interface-type interface-number | ip-
address ip-address | mac-address mac-address | vlan vlan-id } * | all } [ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command is used to view information about a configured static binding table.
The information includes the IP address, MAC address, VLAN information, and
interface information.
Example
# Display information about the static binding table.
<HUAWEI> display dhcp static user-bind all
DHCP static Bind-table:
Flags:O - outer vlan ,I - inner vlan ,P - Vlan-mapping
IP Address MAC Address VSI/VLAN(O/I/P) Interface
--------------------------------------------------------------------------------
10.1.1.1 00e0-fc02-0003 10 /-- /-- GE0/0/1
--------------------------------------------------------------------------------
Print count: 1 Total count: 1
Table 14-84 Description of the display dhcp static user-bind command output
Item Description
Item Description
VSI Name of the VSI that the online user belongs to.
Format
display dhcpv6 static user-bind { { interface interface-type interface-number |
ipv6-address { ipv6-address | all } | mac-address mac-address | vlan vlan-id } * |
all } [ verbose ]
display dhcpv6 static user-bind ipv6-prefix { prefix/prefix-length | all }
[ verbose ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command is used to view information about a configured DHCPv6 static
binding table. The information includes the IPv6 address, MAC address, VLAN
information, and interface information. If prefix delegation (PD) users exist on the
network, the device generates an IPv6 prefix binding entry. The display dhcpv6
static user-bind ipv6-prefix command displays the static IPv6 prefix binding
entries.
Example
# Display the DHCPv6 static binding table.
<HUAWEI> display dhcpv6 static user-bind all
DHCPV6 static Bind-table:
Flags:O - outer vlan ,I - inner vlan ,P - map vlan
IP Address MAC Address VSI/VLAN(O/I/P)/(BD-VLAN) Interface
--------------------------------------------------------------------------------
fc00:1::1 0001-0002-0003 10 /-- /-- --
--------------------------------------------------------------------------------
Print count: 1 Total count: 1
Table 14-85 Description of the display dhcpv6 static user-bind command output
Item Description
Item Description
Function
The display ip source check user-bind command displays the IPSG
configurations.
Format
display ip source check user-bind interface interface-type interface-number
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display ip source check user-bind command displays the IP packet check
configuration on an interface, including IP packet check items and the alarm
function of IP packet check.
Example
# Display the IP packet check configuration on GE0/0/1.
<HUAWEI> display ip source check user-bind interface gigabitethernet 0/0/1
ipv4 source check user-bind enable
ipv6 source check user-bind enable
ip source check user-bind check-item ip-address
ip source check user-bind alarm enable
ip source check user-bind alarm threshold 200
Table 14-86 Description of the display ip source check user-bind command output
Item Description
Format
display mac-address snooping [ interface-type interface-number | vlan vlan-id ] *
[ verbose ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
When you run the user-bind ip sticky-mac command in the interface view, the
device generates snooping MAC address entries based on the snooping binding
table. A snooping MAC address entry includes the user MAC address and VLAN ID.
The display mac-address snooping command displays snooping MAC address
entries generated based on the snooping binding table. If no interface or VLAN is
specified, all the snooping MAC address entries generated based on the snooping
binding table are displayed.
Example
# Display the snooping MAC address entries generated based on the snooping
binding table on the device.
<HUAWEI> display mac-address snooping
-------------------------------------------------------------------------------
MAC Address VLAN/VSI/BD Learned-From Type
-------------------------------------------------------------------------------
00e0-fc02-0602 10/-/- GE0/0/1 snooping
-------------------------------------------------------------------------------
Total items displayed = 1
Item Description
Function
The ip anti-attack source-ip equals destination-ip drop command enables the
device to discard IP packets with the same source and destination IP addresses.
By default, the device does not discard IP packets with the same source and
destination IP addresses.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S1730S-H, S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I,
S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this
command.
Format
ip anti-attack source-ip equals destination-ip drop
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Generally, IP packets with the same source and destination IP addresses can be
forwarded. When you determine that the IP packets are attack packets, you can
use the ip anti-attack source-ip equals destination-ip drop command to enable
the device to discard the IP packets.
Example
# Enable the device to discard IP packets with the same source and destination IP
addresses.
<HUAWEI> system-view
[HUAWEI] ip anti-attack source-ip equals destination-ip drop
Format
ip source check user-bind alarm enable
undo ip source check user-bind alarm enable
Parameters
None
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The ip source check user-bind alarm enable command enables the log and
alarm function for IP packet check. If the number of discarded packets reaches the
threshold, the device sends an alarm to the NMS device.
Prerequisites
IP packet check has been enabled using the ip source check user-bind enable
command on the interface.
Follow-up Procedure
Run the ip source check user-bind alarm threshold command to set the alarm
threshold.
Precautions
If the alarm function of IP packet check is enabled both in the VLAN view and in
the view of the interface added to the VLAN, it takes effect in the view where it
was first enabled. To change the order in which the function takes effect, disable it
in the view where it has taken effect, and then enable it in the desired view.
Example
# Enable the alarm function for IP packet check on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] ip source check user-bind enable
[HUAWEI-GigabitEthernet0/0/1] ip source check user-bind alarm enable
Format
ip source check user-bind alarm threshold threshold
undo ip source check user-bind alarm threshold
Parameters
Parameter Description Value
threshold Specifies an alarm threshold for The value is an integer that
IP packet check. ranges from 1 to 1000.
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the alarm function of IP packet check is enabled, run the ip source check
user-bind alarm threshold command to set the alarm threshold for IP packet
check.
Prerequisites
The alarm function of IP packet check has been enabled using the ip source check
user-bind alarm enable command.
Example
# Set the alarm threshold for IP packet check to 200 on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] ip source check user-bind enable
[HUAWEI-GigabitEthernet0/0/1] ip source check user-bind alarm enable
[HUAWEI-GigabitEthernet0/0/1] ip source check user-bind alarm threshold 200
Format
ip source check user-bind check-item { ip-address | mac-address | vlan } *
Parameters
Parameter Description Value
ip-address Checks whether the IP address of an IP packet matches a -
binding entry.
mac-address Checks whether the MAC address of an IP packet matches -
a binding entry.
vlan Checks whether VLAN information of an IP packet matches -
a binding entry.
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When you check an IP packet against the binding table, run the ip source check
user-bind check-item (interface view) command to specify items in the IP
packet to be checked on a specified interface. When the device receives an IP
packet, it checks the items against the binding table. Only packets that match the
binding entries can be forwarded; otherwise, packets are discarded. The optional
check items of an IP packet contain the source IP address, source MAC address,
and VLAN information. Interface information is a mandatory check item.
Prerequisites
IP packet check has been enabled using the ip source check user-bind enable
command in the interface view.
Precautions
When a large number of binding entries exist, it may take a long time to check IP
packets, reducing forwarding efficiency.
This command is valid only for dynamic binding entries. The device checks the
received packets against entries in the static binding table.
Example
# Enable IP packet check on GE0/0/1 to check whether the IP address in the IP
packet matches the binding entry.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
Format
ip source check user-bind check-item { ip-address | mac-address | interface } *
Parameters
Parameter Description Value
ip-address Checks whether the IP address of an IP packet matches a -
binding entry.
mac-address Checks whether the MAC address of an IP packet matches -
a binding entry.
interface Checks whether interface information of an IP packet -
matches a binding entry.
Views
VLAN view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When you check an IP packet against the binding table, run the ip source check
user-bind check-item (VLAN view) command to configure IP packet check items
in a specified VLAN. When the device receives an IP packet, it checks the items
against the binding table. Only packets that match the binding entries can be
forwarded; otherwise, packets are discarded. The optional check items of an IP
packet contain the source IP address, source MAC address, and interface
information. VLAN information is a mandatory check item.
Prerequisites
IP packet check has been enabled using the ip source check user-bind enable
command in the VLAN view.
Precautions
When a large number of binding entries exist, it may take a long time to check IP
packets, reducing forwarding efficiency.
This command is valid only for dynamic binding entries. The device checks the
received packets against entries in the static binding table.
Example
# Enable IP packet check in VLAN 100 and check whether the IP address in the IP
packet matches the binding entry.
<HUAWEI> system-view
[HUAWEI] vlan 100
[HUAWEI-vlan100] ip source check user-bind enable
[HUAWEI-vlan100] ip source check user-bind check-item ip-address
Format
ip source check user-bind enable
undo ip source check user-bind enable
ipv4 source check user-bind enable
undo ipv4 source check user-bind enable
ipv6 source check user-bind enable
undo ipv6 source check user-bind enable
Parameters
None
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Unauthorized users often send bogus packets with the source IP address and MAC
address of authorized users to access or attack the network. Then authorized users
cannot access stable and secure networks. To address this problem, you can
configure IP packet check.
When IP packet check is enabled, the device checks the IP address, MAC address,
VLAN information, and interface information against the binding table. You can
run the ip source check user-bind check-item or ip source check user-bind
check-item command to specify IP packet check items. Only packets that match
the binding entries can be forwarded; otherwise, packets are discarded.
Prerequisites
The IP packet check is based by binding table. So,
● The dynamic DHCP snooping binding table has been generated for DHCP
users.
● The static binding table has been configured manually for users using static IP
addresses.
● The dynamic ND snooping binding table has been generated for users
dynamically obtaining IPv6 addresses through Stateless Address
Autoconfiguration.
Precautions
After IP packet check is enabled using the ip source check user-bind enable
command, the device checks the source IPv4 and IPv6 addresses of users' IP
packets. The configuration file is displayed as follows:
ipv4 source check user-bind enable
ipv6 source check user-bind enable
To check only IPv4 or IPv6 packets, run the ipv4 source check user-bind enable
or ipv6 source check user-bind enable command.
Example
# Enable IPv4 and IPv6 packet check on GE0/0/1.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] ip source check user-bind enable
Format
user-bind static { { { ip-address | ipv6-address } { start-ip [ to end-ip ] } &<1-10>
| ipv6-prefix prefix/prefix-length } | mac-address mac-address } * [ interface
interface-type interface-number ] [ vlan vlan-id [ ce-vlan ce-vlan-id ] ]
undo user-bind static [ { ip-address { start-ip [ to end-ip ] } &<1-10> | ipv6-
address [ start-ip [ to end-ip ] ] &<1-10> | ipv6-prefix [ prefix/prefix-length ] } |
mac-address mac-address | interface interface-type interface-number | vlan vlan-
id [ ce-vlan ce-vlan-id ] ] *
Parameters
Parameter Description Value
interface Specifies the interface connected -
interface-type to a user in a static binding entry.
interface- ● interface-type specifies the
number interface type.
● interface-number specifies the
interface number.
ip-address Indicates the static IPv4 address. -
ipv6-address Indicates the static IPv6 address. -
start-ip [ to Specifies the user IP address in a The IPv4 address is in
end-ip ] static binding entry. dotted decimal notation in
● start-ip specifies the first IP the format of X.X.X.X. The
address. value is a 32-digit
hexadecimal number, in
● to end-ip specifies the last IP the format X:X:X:X:X:X:X:X.
address. The value of end-ip
must be larger than the value
of start-ip. start-ip and end-ip
identify a VLAN range.
If to end-ip is not specified, only
the start IP address is added to
the static binding entry.
You can specify a maximum of 10
VLAN ranges at a time. The
entered VLAN ranges cannot
overlap.
vlan vlan-id Specifies the user VLAN ID in a The value is an integer that
static binding entry. ranges from 1 to 4094.
ce-vlan ce-vlan- Specifies the inner VLAN tag of a The value is an integer that
id QinQ packet in a static binding ranges from 1 to 4094.
entry.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When DHCP snooping is enabled, a dynamic binding table is automatically
generated for dynamic users. However, a static binding table cannot be generated
for static users. If IP source guard is enabled but no static binding table is
available, the device discards all static users' forwarding packets. To enable the
device to forward static users' packets, run the user-bind static command to
configure a static binding table.
Precautions
After a static binding table is configured and IP source guard is enabled, the
device performs a match check on IP packets based on the configured binding
entries. If the match check fails, the device discards the IP packets.
Example
# Configure a static binding entry for a user in VLAN 2 with the IP address
10.1.1.1.
<HUAWEI> system-view
[HUAWEI] user-bind static ip-address 10.1.1.1 vlan 2
Format
user-bind ip sticky-mac
undo user-bind ip sticky-mac
Parameters
None
Views
VLAN view, Ethernet interface view, GE interface view, XGE interface view, 25GE
interface view, MultiGE interface view, 40GE interface view, 100GE interface view,
Eth-Trunk interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To prevent the users with unauthorized MAC addresses from attacking the
network, run the user-bind ip sticky-mac command to configure the device to
generate snooping MAC entries on the interface that is prone to attack. After the
device is configured to generate snooping MAC entries, it translates the dynamic
MAC entries learned by the interface into snooping MAC entries (snooping MAC
entries are a type of static MAC entries) based on the DHCP snooping binding
table and ND snooping binding table, or generates snooping MAC entries based
on the static binding entries.
After the configuration is complete, the interface forwards only the IP packets of
which the source MAC addresses are included in the static MAC entries (static and
snooping), and discards other IP packets.
NOTE
Prerequisites
Before using the user-bind ip sticky-mac command, ensure that the DHCP
snooping function has been enabled by the dhcp snooping enable command.
Precautions
Command Description
Example
# Configure the GE0/0/1 interface to generate snooping MAC entries based on the
snooping binding table.
<HUAWEI> system-view
[HUAWEI] dhcp enable
[HUAWEI] dhcp snooping enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] user-bind ip sticky-mac
Function
The savi max dad-delay command sets the time for listening to an NA packet
responding to address conflicts.
The undo savi max dad-delay command restores the default setting.
Format
savi max dad-delay value
Parameters
Parameter Description Value
value Specifies the time for listening to The value is an integer that
an NA packet responding to ranges from 1 to 100, in
address conflicts. seconds.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The savi max dad-delay command is applicable only for SLAAC-Only scenarios
and DHCPv6+SLAAC scenarios.
● In SLAAC-Only scenarios:
When obtaining an IP address in SLAAC mode, an ND client generates the
IPv6 address based on the prefix in the RA packet. After the IPv6 address is
generated, the ND client sends an NS packet to check whether duplicate
addresses exist on the network. When detecting the NS packet in the DAD
process from the ND client, the device generates an ND snooping entry, sets
the entry to the detect state, and listens to the mapping NA packet.
– If a mapping NA packet is detected in the configured listening period,
IPv6 address conflict occurs and the device deletes this ND snooping
entry.
– If no mapping NA packet is detected in the configured listening period,
the IPv6 address is available and the device sets the ND snooping entry
to the bound state. The device deletes the ND snooping entry only when
the entry ages out. If automatic user status detection for users mapping
ND snooping dynamic binding entries is enabled using the nd user-bind
detect enable command on the device, and no NA packet is returned
from the user after NS packets are sent for times configured using the nd
user-bind detect retransmit retransmit-times interval retransmit-
interval command, the device considers the user to be offline and deletes
the mapping ND snooping entry.
● In DHCPv6+SLAAC scenarios:
– The procedure for processing packets by SAVI in SLAAC mode is the same
as that in SLAAC-Only scenarios.
– When obtaining an IP address in DHCPv6 mode, a DHCPv6 client may
send an NS packet to check whether duplicate addresses exist on the
network. When detecting the NS packet in the DAD process from the
DHCPv6 client, the device sets the mapping DHCPv6 snooping entry to
the detect state, and listens to the mapping NA packet.
Example
# Set the time for listening to an NA packet responding to address conflicts to 5
seconds.
<HUAWEI> system-view
[HUAWEI] savi enable
[HUAWEI] savi max dad-delay 5
Format
savi max dad-prepare-delay value
undo savi max dad-prepare-delay
Parameters
Parameter Description Value
value Specifies the time for listening to the The value is an integer that
duplicate address detection ranges from 1 to 100, in
performed by the DHCPv6 client. seconds.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The savi max dad-prepare-delay command is applicable only for DHCPv6-Only
scenarios and DHCPv6+SLAAC scenarios.
After detecting that the DHCPv6 client obtains the IPv6 address, the device detects
whether the DHCPv6 client sends an NS packet for duplicate address detection.
● In DHCPv6-Only scenarios:
– If no NS packet in the DAD process is detected in the configured listening
period, the device sets the DHCPv6 snooping entry to the bound state. It
indicates that the DHCPv6 does not perform the duplicate address
detection on the obtained IPv6 address or no duplicate IPv6 address
exists.
– If an NS packet in the DAD process is detected in the configured listening
period, the device does not change the status of the mapping DHCPv6
snooping entry. The device sets the DHCPv6 snooping entry to the bound
state only when the listening period expires.
In DHCPv6-Only scenarios, when detecting the DHCPv6 Decline packet or
DHCPv6 Release packet from the DHCPv6 client, the device deletes the
corresponding DHCPv6 snooping entry.
● In DHCPv6+SLAAC scenarios:
– If no NS packet in the DAD process is detected in the configured listening
period, the device sets the DHCPv6 snooping or ND snooping entry to the
bound state. It indicates that the client does not perform the duplicate
address detection on the obtained IPv6 address or no duplicate IPv6
address exists, and the client can use this IPv6 address.
– If an NS packet in the DAD process is detected in the configured listening
period, the device sets the mapping DHCPv6 snooping or ND snooping
entry to the detection state, and listens to the mapping NA packet. For
the listening method, see savi max dad-delay.
Prerequisites
The SAVI function has been enabled using the savi enable command.
Precautions
This command is used together with ND snooping and DHCPv6 snooping.
Example
# Set the time for listening to the duplicate address detection performed by the
DHCPv6 client to 5 seconds.
<HUAWEI> system-view
[HUAWEI] savi enable
[HUAWEI] savi max dad-prepare-delay 5
Function
The savi max-binding-table command sets the maximum number of SAVI
binding entries on an interface.
The undo savi max-binding-table command restores the default maximum
number of SAVI binding entries on an interface.
By default, the maximum number of SAVI binding entries is the same as the
number of binding entries supported by the device.
Format
savi max-binding-table max-number
Parameters
Parameter Description Value
Views
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view,
MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk
interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
An SAVI binding table is a set of the ND snooping binding table and DHCPv6
snooping binding table. When the sum of ND snooping binding entries and
DHCPv6 snooping binding entries on an interface reaches the configured
maximum number of SAVI binding entries, subsequent users cannot connect to
the network. After the maximum number of SAVI binding entries is set, the device
does not process many ND packets and DHCPv6 packets with invalid source
addresses to defend against attacks.
Prerequisites
Ensure that SAVI has been enabled globally using the savi enable command.
Example
# Set the maximum number of SAVI binding entries on the GE0/0/1 to 8.
<HUAWEI> system-view
[HUAWEI] savi enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] savi max-binding-table 8
Format
savi enable
undo savi enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the SAVI function is enabled, the device checks the validity of the source
addresses in the ND, DHCPv6, and IPv6 data packets based on the bindings
between IP addresses and ports and filters out invalid packets. The bindings
between IP addresses and ports are generated based on ND snooping and
DHCPv6 snooping.
Precautions
The SAVI function must be used together with ND snooping, DHCPv6 snooping, or
IP source guard.
After the SAVI function is enabled, only when both ND snooping and IP source
guard are enabled or both DHCPv6 snooping and IP source guard are enabled on
an interface, the device checks the validity of the source addresses in IPv6 data
packets received on this interface.
Example
# Enable the SAVI function.
<HUAWEI> system-view
[HUAWEI] savi enable
Function
The urpf command enables URPF on an interface and configures the URPF mode.
NOTE
Only the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S5735-S, S5735S-S, S5735-S-I,
S6735-S, S6720-EI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this
command.
For the S6735-S, S6720-EI, and S6720S-EI, only Layer 2 Ethernet interfaces support URPF
strict check.
Format
urpf { loose | strict } [ allow-default-route ]
undo urpf
Parameters
Views
Interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A Denial of Service (DoS) attack disables users from connecting to a server. DoS
attacks aim to occupy many resources by sending a large number of connection
requests to a specified server. The attacked server cannot respond to authorized
users.
URPF searches for the route to the source IP address in the routing table based on
the source IP address of the packet, and checks whether the inbound interface of
the packet is the same as the outbound interface of the route. If no route to the
source IP address of the packet exists in the routing table, or the inbound interface
of the packet is different from the outbound interface of the route, the packet is
discarded. This prevents IP spoofing attacks, especially DoS attacks with bogus
source IP address.
In a complicated networking environment, asymmetric routes may exist. That is,
the routes recorded on the local end and remote end are different. A URPF-
enabled device on this network may discard the packets transmitted along the
correct path, but forward the packets transmitted along incorrect paths. The
device provides the following two URPF modes to solve this problem:
● Strict mode
In strict mode, a packet passes the check only when the device has a route to
the source IP address of the packet in the routing table, and the inbound
interface of the packet should be the same as the outbound interface of the
route.
If route symmetry is ensured, you are advised to use the URPF strict mode.
For example, if there is only one path between two network edge devices,
URPF strict mode can be used to ensure network security.
● Loose mode
In loose mode, a packet passes the check as long as the device has a route to
the source IP address of the packet in the routing table, and the inbound
interface of the packet is not required to be the same as the outbound
interface of the route.
If route symmetry is not ensured, you are advised to use the URPF loose
mode. For example, if there are multiple paths between two network edge
devices, URPF loose mode can be used to ensure network security and prevent
the packets transmitted along the correct path from being discarded.
Prerequisites
For the S5735-S, S5735S-S, S5735-S-I, S6735-S, S6720-EI, and S6720S-EI,
configurations on the interface take effect only after global URPF is enabled using
the urpf command.
Precautions
In the Eth-Trunk interface view, this command conflicts with the service type
tunnel, service type multicast-tunnel, or service type vxlan-tunnel command
and cannot be run in the same Eth-Trunk interface view.
For the S6720-EI, S6735-S and S6720S-EI, even if no default route is configured,
the urpf loose allow-default-route command takes effect when the resource
allocation mode is set to enhanced-ipv4 or ipv4-ipv6 6:1 using the assign
resource-mode command. The device allows the route to the source IP address of
the packet to be configured as the default route during the URPF loose check.
For the S5735-S-I, only URPF check in loose mode is supported. For the S5735-S
and S5735S-S, V200R019C10 and later versions support only URPF check in loose
mode. If URPF check in strict mode is configured in V200R019C00, the
configuration will be changed to URPF check in loose mode after the version is
upgraded to V200R019C10 or later.
Example
# Enable URPF strict check on a Layer 2 interface GE0/0/1 and allow the route to
the source IP address of the packet to be configured as the default route.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] urpf strict allow-default-route
# Enable URPF loose check on a Layer 3 interface GE0/0/2 and allow the route to
the source IP address of the packet to be configured as the default route.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/2
[HUAWEI-GigabitEthernet0/0/2] undo portswitch
[HUAWEI-GigabitEthernet0/0/2] urpf loose allow-default-route
Function
The urpf command enables global URPF.
NOTE
Only S5720I-SI, S5735-S, S5735S-S, S5735-S-I, S5735S-H, S5736-S, S6735-S, S6720-EI, and
S6720S-EI support this command.
Format
For S5720I-SI, S5735S-H, and S5736-S:
Parameters
Parameter Description Value
slot slot-id ● Specifies the slot ID if stacking is not Set the value
configured. according to the
● Specifies the stack ID if stacking is device
configured. configuration.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A Denial of Service (DoS) attack disables users from connecting to a server. DoS
attacks aim to occupy many resources by sending a large number of connection
requests to a specified server. The attacked server cannot respond to authorized
users.
URPF searches for the route to the source IP address in the routing table based on
the source IP address of the packet, and checks whether the inbound interface of
the packet is the same as the outbound interface of the route. If no route to the
source IP address of the packet exists in the routing table, or the inbound interface
of the packet is different from the outbound interface of the route, the packet is
discarded. This prevents IP spoofing attacks, especially DoS attacks with bogus
source IP address.
In strict mode, a packet passes the check only when the device has a route to
the source IP address of the packet in the routing table, and the inbound
interface of the packet should be the same as the outbound interface of the
route.
If route symmetry is ensured, you are advised to use the URPF strict mode.
For example, if there is only one path between two network edge devices,
URPF strict mode can be used to ensure network security.
● Loose mode
In loose mode, a packet passes the check as long as the device has a route to
the source IP address of the packet in the routing table, and the inbound
interface of the packet is not required to be the same as the outbound
interface of the route.
If route symmetry is not ensured, you are advised to use the URPF loose
mode. For example, if there are multiple paths between two network edge
devices, URPF loose mode can be used to ensure network security and prevent
the packets transmitted along the correct path from being discarded.
Precautions
● Enabling or disabling global URPF will affect packet forwarding in a short
period of time.
● The S5720I-SI, S5735S-H, and S5736-S only support URPF strict check.
● For the S5720I-SI, S5735S-H, and S5736-S, after a stack is set up, if slot slot-
id is not specified when the urpf (system view) command is executed, URPF
takes effect only on the master switch.
● For theS6720-EI and S6720S-EI, the number of FIB entries are reduced by half
if URPF is enabled. You are advised to enable URPF before services are
deployed. If you need to enable URPF after services are deployed, configure
URPF when less traffic is transmitted and ensure that network requirements
are met if the number of FIB entries is reduced by half.
● If both the urpf slot slot-id and urpf slot slot-id based-logic-port commands
are executed, the last configured one takes effect.
Follow-up Procedure
For the S5735-S, S5735S-S, S5735-S-I, S6735-S, S6720-EI, and S6720S-EI, run the
urpf(interface view) command to enable URPF on an interface and configure the
URPF mode.
Example
# Enable global URPF on the device.
<HUAWEI> system-view
[HUAWEI] urpf slot 0
Warning: Changing the global URPF status may interrupt some services for several seconds and FIB entries
supported may be reduced. Continue? [Y/N]:y
14.15.2 algorithm
Function
The algorithm command configures the authentication algorithm of a key.
Format
algorithm { hmac-md5 | hmac-sha-256 | hmac-sha1-12 | hmac-sha1-20 | md5 |
sha-1 | sha-256 | simple | sm3 }
undo algorithm
Parameters
Parameter Description Value
Views
Key-ID view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
If the length of an entered message is less than 512 bits, 0s are added to make up a
512-bit message. If the length of an entered message is greater than 512 bits, the
message is converted into a 128-bit message based on the MD5 algorithm. Then, 0s
are added to make up a 512-bit message.
● HMAC-SHA1-12: The 160-bit HMAC-SHA1-12 message digest is calculated
based on the 512-bit message that is converted from the entered message of
any length. The leftmost 96 bits (12 x 8) are used as the authentication code.
● HMAC-SHA1-20: The 160-bit HMAC-SHA1-20 message digest is calculated
based on the 512-bit message that is converted from the entered message of
any length. All the 160 bits are used as the authentication code.
● SHA-256: The 256-bit SHA-2 message digest is calculated based on the
entered message with the length shorter than the 64th power of 2.
● HMAC-SHA-256: The 256-bit HMAC-SHA-256 message digest is calculated
based on the 512-bit message that is converted from the entered message of
any length. All the 256 bits are used as the authentication code.
● SM3: The 256-bit SM3 message digest is calculated based on the entered
message of any length. All the 256 bits are used as the authentication code.
Prerequisites
key-id has been configured.
Precautions
SHA-1 has low security, for higher security purposes, you are advised to specify the
hmac-sha-256 or sha2-256 parameter.
Keys configured on the sender and receiver of packets must correspond to the
same authentication and encryption algorithms. Otherwise, packet transmission
fails for not passing the authentication.
If algorithm is not configured, key will never be active.
Different protocols support different algorithms.
● RIP supports MD5 and simple.
● BGP and BGP4+ support MD5.
● IS-IS supports HMAC-MD5 and simple.
● OSPF supports MD5, simple and HMAC-MD5.
● MSDP supports MD5.
● MPLS LDP supports MD5. MPLS TE supports HMAC-MD5.
Example
# Specify sha-256 as the authentication algorithm of key-id 1.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] key-id 1
[HUAWEI-keychain-test-keyid-1] algorithm sha-256
Format
default send-key-id
undo default send-key-id
Parameters
None
Views
Key-ID view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
In keychain authentication mode, secure protocol packet transmission is provided
by changing the authentication algorithm and key sting dynamically. This can
reduce the workload of changing the algorithm and key manually. A keychain
consists of multiple authentication keys, each of which is valid within different
time periods. When a key becomes valid, the authentication algorithm
corresponding to the key is used, and packets passing the authentication will be
sent or received.
If a key for packet sending is not configured in a keychain or no key for packet
sending is valid within a certain period, protocol packets cannot be authenticated
and encrypted. As a result, protocol packet transmission fails. To address such a
problem, configure a default key for packet sending. If no key is valid, the default
key for packet sending is used.
Precautions
Each keychain can have only one default key for packet sending.
● If the default key for packet sending is an existing key, the authentication and
encryption algorithms, and key corresponding to the key are used.
● If the default key for packet sending is a newly created key, configure the
authentication and encryption algorithms.
Example
# Configure the key-1 as default send key in keychain test.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] key-id 1
[HUAWEI-keychain-test-keyid-1] default send-key-id
Format
display keychain keychain-name [ key-id key-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To troubleshoot a keychain authentication failure or collect required information
before configuration, run the display keychain command to view configurations
of a specified keychain.
Example
# Display the configuration of keychain test when no key ID is configured for the
keychain.
<HUAWEI> display keychain test
Keychain Information:
---------------------
Keychain Name : test
Timer Mode : Absolute
Time Type : Lmt
Receive Tolerance(min) : 0
TCP Kind : 254
TCP Algorithm IDs :
HMAC-MD5 :5
HMAC-SHA1-12 :2
HMAC-SHA1-20 :6
HMAC-SHA-256 :7
SHA-256 :8
MD5 :3
SHA1 :4
Number of Key IDs :0
Active Send Key ID : None
Active Receive Key IDs : None
Default send Key ID : Not configured
# Display the configuration of keychain test when a key ID is configured for the
keychain.
<HUAWEI> display keychain test
Keychain Information:
---------------------
Keychain Name : test
Timer Mode : Absolute
Time Type : Lmt
Receive Tolerance(min) : 100
TCP Kind : 182
TCP Algorithm IDs :
HMAC-MD5 :5
HMAC-SHA1-12 :2
HMAC-SHA1-20 :6
HMAC-SHA-256 :7
SHA-256 :8
MD5 :3
SHA1 :4
Number of Key IDs :1
Active Send Key ID :1
Active Receive Key IDs : 01
Default send Key ID :1
Key ID Information:
-------------------
Key ID :1
Key string : ******
Algorithm : MD5
SEND TIMER :
Start time : 2012-03-14 00:00
End time : 2012-08-08 23:59
Status : Active
RECEIVE TIMER :
Start time : 2012-03-14 00:00
End time : 2012-08-08 23:59
Status : Active
Key ID :2
Key string :-
Algorithm :-
SEND TIMER :
Status : Inactive
RECEIVE TIMER :
Status : Inactive
Key ID Information:
-------------------
Key ID :1
Key string : ******
Algorithm : MD5
SEND TIMER :
Start time : 2012-03-14 00:00
End time : 2012-08-08 23:59
Status : Active
RECEIVE TIMER :
Start time : 2012-03-14 00:00
End time : 2012-08-08 23:59
Status : Active
DEFAULT SEND KEY ID INFORMATION
Default : Configured
Status : Inactive
Item Description
Item Description
Item Description
Item Description
Item Description
14.15.5 keychain
Function
The keychain command creates a new set of keychain rules or displays the
keychain view.
The undo keychain command deletes the keychain configuration.
By default, no keychain is configured.
Format
keychain keychain-name [ mode { absolute | periodic { daily | weekly | monthly
| yearly } } ]
undo keychain keychain-name
Parameters
Parameter Description Value
keychain-name Specifies the keychain name. All the The value is a string of
applications identify the set of 1 to 47 case-insensitive
keychain rules by keychain name. characters. Except the
question mark (?) and
space. However, when
double quotation marks
(") are used around the
string, spaces are
allowed in the string.
Views
System view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
Each keychain consists of multiple keys that are valid within different time periods
and each key is configured with an authentication algorithm. When a key
becomes valid, the corresponding authentication algorithm is used.
Follow-up Procedure
Run the key-id command to configure a key. If the key is not configured, the
keychain cannot authenticate and encrypt protocol packets.
The time mode of a key must be the same as the time mode of the keychain.
Precautions
Example
# Configure the keychain test and enter keychain view.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-huawei]
14.15.6 key-id
Function
The key-id command creates a new set of key-ids or displays the key-id view.
Format
key-id key-id
Parameters
Parameter Description Value
key-id Specifies the key identification The integer value ranges from
number of a keychain. 0 to 63.
Views
Keychain view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
In keychain authentication mode, secure protocol packet transmission is provided
by changing the authentication algorithm and key string dynamically. This can
reduce the workload of manually changing the algorithm and key.
The dynamic change of the keychain authentication algorithm is implemented
based on the keys. Each keychain consists of multiple keys that are valid within
different time periods and each key is configured with an authentication
algorithm. When a key becomes valid, the corresponding authentication algorithm
is used.
Follow-up Procedure
After key-id is specified, perform the following operations:
● Run the algorithm command to configure an algorithm used by the key.
● Run the key-string command to specify a key string.
● Run the send-time command to specify the send time of the key.
● Run the receive-time command to specify the receive time of the key.
Precautions
A key-id represents a key on the device.
A keychain supports 64 keys, but only one key takes effect during one period.
No active key can be used to authenticate and encrypt protocol packets at the
intervals of keys. Therefore, run the default send-key-id command to specify a
default key.
The time mode of the key must be the same as the time mode of Keychain.
Example
# Configure key-id 1.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] key-id 1
[HUAWEI-keychain-test-keyid-1]
14.15.7 key-string
Function
The key-string command specifies a key used for keychain authentication.
The undo key-string command deletes a key used for keychain authentication.
By default, no key is configured for keychain authentication.
Format
key-string { plain plain-text | [ cipher ] cipher-text }
undo key-string
Parameters
Parameter Description Value
plain plain- Indicates the plain text used The value is case-sensitive and
text for authentication. The ranges from 1 to 255 characters.
configured text will be Spaces are not supported.
stored as unencrypted text
and displayed as If a password contains a space, the
unencrypted text. password must be placed into a pair
of double quotation marks. Only one
NOTE pair of double quotation marks can
If plain is selected, the be used for each user name.
password is saved in the
configuration file in plain text.
This brings security risks. It is
recommended that you select
cipher to save the password in
cipher text.
Views
Key-ID view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
Each keychain consists of multiple keys that are valid within different time periods
and each key is configured with an authentication algorithm. When a key
becomes valid, the corresponding authentication algorithm is used.
Precautions
Example
# Configure the key string test@1234.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] key-id 1
[HUAWEI-keychain-test-keyid-1] key-string cipher test@1234
14.15.8 receive-time
Function
The receive-time command configures a key as a receive key for the specified
interval of time.
The undo receive-time command deletes the receive time configuration.
By default, no receive time is configured.
Format
receive-time start-time start-date { duration { duration-value | infinite } | to end-
time end-date }
receive-time daily start-time to end-time
receive-time day { start-day-name to end-day-name | day-name &<1-7> }
receive-time date { start-date-value to end-date-value | date-value &<1-31> }
receive-time month { start-month-name to end-month-name | month-name
&<1-12> }
undo receive-time
Parameters
Parameter Description Value
to Indicates a separator. -
day-name &<1-7> Specifies the day of the It can be Mon, Tue, Wed,
week to be configured as Thur, Fri, Sat, and Sun.
the receive day for the One or more days can be
given key. configured.
date-value &<1-31> Specifies the date of the The value ranges from 1
month to be configured to 31. One or more dates
as the receive date for can be configured.
the given key.
Views
Key-ID view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
Each keychain consists of multiple keys that are valid within different time periods
and each key is configured with an authentication algorithm and key string. When
a key becomes valid, the corresponding authentication algorithm and the key
string are used. Configure different keys for packet sending and receiving to be
valid within different time periods.
When the system time is within the specified interval, the receive key is in active
state.
The mode in which receive keys become valid must be the same as that
configured for the keychain.
Precautions
Multiple receive keys can be active at the same time. The device will select a key
for decryption based on the received packet.
Example
# Configure the time for packet receiving with the timing mode as absolute and
range as infinite.
<HUAWEI> system-view
[HUAWEI] keychain one mode absolute
[HUAWEI-keychain-one] key-id 5
[HUAWEI-keychain-one-keyid-5] receive-time 14:52 2014-11-1 duration infinite
# Configure the time for packet receiving with the timing mode as absolute.
<HUAWEI> system-view
[HUAWEI] keychain two mode absolute
[HUAWEI-keychain-two] key-id 5
[HUAWEI-keychain-two-keyid-5] receive-time 14:52 2014-11-1 to 14:52 2040-10-1
# Configure the time for packet receiving with the timing mode as daily periodic.
<HUAWEI> system-view
[HUAWEI] keychain three mode periodic daily
[HUAWEI-keychain-three] key-id 5
[HUAWEI-keychain-three-keyid-5] receive-time daily 14:52 to 18:10
# Configure the time for packet receiving with the timing mode as weekly
periodic.
<HUAWEI> system-view
[HUAWEI] keychain four mode periodic weekly
[HUAWEI-keychain-four] key-id 5
[HUAWEI-keychain-four-keyid-5] receive-time day mon
# Configure the time for packet receiving with the timing mode as monthly
periodic.
<HUAWEI> system-view
[HUAWEI] keychain five mode periodic monthly
[HUAWEI-keychain-five] key-id 5
[HUAWEI-keychain-five-keyid-5] receive-time date 12 to 25
# Configure the time for packet receiving with the timing mode as yearly periodic.
<HUAWEI> system-view
[HUAWEI] keychain six mode periodic yearly
[HUAWEI-keychain-six] key-id 5
[HUAWEI-keychain-six-keyid-5] receive-time month oct to dec
14.15.9 receive-tolerance
Function
The receive-tolerance command sets receive tolerance for all the receive keys in
the keychain.
Format
receive-tolerance { value | infinite }
undo receive-tolerance
Parameters
Parameter Description Value
value Specifies the receive tolerance value for a The integer value ranges
keychain. from 1 to 14400 in
minutes.
Views
Keychain view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
Implementation Procedure
After a tolerance time is set, the tolerance time is added to the start time and end
time when the key ID for packet receiving becomes valid.
Precautions
A tolerance time is required for each keychain. The configured tolerance time
takes effect for all keys in the keychain.
Example
# Configure the receive tolerance time as 570 minutes.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] receive-tolerance 570
14.15.10 send-time
Function
The send-time command configures a key as a send key at a specified interval.
Format
send-time start-time start-date { duration { duration-value | infinite } | to end-
time end-date }
send-time daily start-time to end-time
undo send-time
Parameters
Parameter Description Value
to Indicates a separator. -
day-name &<1-7> Specifies the day of the It can be Mon, Tue, Wed,
week to be configured as Thur, Fri, Sat, and Sun.
the send day for the
given key. One or more days can be
configured.
date-value &<1-31> Specifies the date of the The value ranges from 1
month to be configured to 31. One or more dates
as the send date for the can be configured.
given key.
Views
Key-ID view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
Each keychain consists of multiple keys that are valid within different time periods
and each key is configured with an authentication algorithm and a key string.
When a key becomes valid, the corresponding authentication algorithm and the
key string are used. Configure different send and receive keys to be valid within
different time periods.
When the system is within the send time range of the key, the device will use the
algorithm and key of the configured key to encrypt the packet.
There are two keychain validity modes:
● Absolute time range: In this mode, keychains are valid within a certain period.
● Periodic time range: In this mode, keychains are valid periodically.
The mode in which send keys become valid must be the same as that configured
for the keychain.
Precautions
Multiple receive keys cannot be active at the same time. Only one key takes effect
during a period in a keychain.
Example
# Configure the time for packet sending with the timing mode as absolute.
<HUAWEI> system-view
[HUAWEI] keychain one mode absolute
[HUAWEI-keychain-one] key-id 5
[HUAWEI-keychain-one-keyid-5] send-time 14:52 2014-11-1 to 14:52 2040-10-1
# Configure the time for packet sending with the timing mode as daily periodic.
<HUAWEI> system-view
[HUAWEI] keychain two mode periodic daily
[HUAWEI-keychain-two] key-id 5
[HUAWEI-keychain-two-keyid-5] send-time daily 14:52 to 18:10
# Configure the time for packet sending with the timing mode as weekly periodic.
<HUAWEI> system-view
[HUAWEI] keychain three mode periodic weekly
[HUAWEI-keychain-three] key-id 5
[HUAWEI-keychain-three-keyid-5] send-time day mon
# Configure the time for packet sending with the timing mode as monthly
periodic.
<HUAWEI> system-view
[HUAWEI] keychain four mode periodic monthly
[HUAWEI-keychain-four] key-id 5
[HUAWEI-keychain-four-keyid-5] send-time date 12
# Configure the time for packet sending with the timing mode as yearly periodic.
<HUAWEI> system-view
[HUAWEI] keychain five mode periodic yearly
[HUAWEI-keychain-five] key-id 5
[HUAWEI-keychain-five-keyid-5] send-time month apr
# Configure the time for packet sending with the timing mode as yearly periodic,
and a few months are available.
<HUAWEI> system-view
[HUAWEI] keychain six mode periodic yearly
[HUAWEI-keychain-six] key-id 5
[HUAWEI-keychain-six-keyid-5] send-time month oct to dec
14.15.11 tcp-algorithm-id
Function
The tcp-algorithm-id command specifies an algorithm ID to represent a TCP
authentication algorithm supported by the keychain.
Format
tcp-algorithm-id { hmac-md5 | hmac-sha-256 | hmac-sha1-12 | hmac-sha1-20 |
md5 | sha-1 | sha-256 } algorithm-id
Parameters
Parameter Description Value
Views
Keychain view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
A keychain ensures secure protocol packet transmission by dynamically changing
the authentication algorithm and key string. Packets to be transmitted over non-
TCP and TCP connections are authenticated using authentication and encryption
algorithms and key string corresponding to a key. The TCP connection needs to be
authenticated to enhance security.
If the length of an entered message is less than 512 bits, 0s are added to make up a
512-bit message. If the length of an entered message is greater than 512 bits, the
message is converted into a 128-bit message based on the MD5 algorithm. Then, 0s
are added to make up a 512-bit message.
● HMAC-SHA1-12: The 160-bit HMAC-SHA1-12 message digest is calculated
based on the 512-bit message that is converted from the entered message of
any length. The leftmost 96 bits (12 x 8) are used as the authentication code.
● HMAC-SHA1-20: The 160-bit HMAC-SHA1-20 message digest is calculated
based on the 512-bit message that is converted from the entered message of
any length. All the 160 bits are used as the authentication code.
● SHA-256: The 256-bit SHA-2 message digest is calculated based on the
entered message with the length shorter than the 64th power of 2.
● HMAC-SHA-256: The 256-bit HMAC-SHA-256 message digest is calculated
based on the 512-bit message that is converted from the entered message of
any length. All the 256 bits are used as the authentication code.
● SM3: The 256-bit SM3 message digest is calculated based on the entered
message of any length. All the 256 bits are used as the authentication code.
Prerequisites
Before configuring algorithm IDs for the communicating parties, run the tcp-kind
command to configure TCP types for the communicating parties.
Precautions
SHA-1 has low security, for higher security purposes, you are advised to specify the
hmac-sha-256 or sha2-256 parameter.
Each algorithm has a unique algorithm ID. And the algorithm IDs configured for
the two communication devices must be identical.
Example
# Specify 1 as the algorithm ID of hmac-sha-256.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] tcp-algorithm-id hmac-sha-256 1
14.15.12 tcp-kind
Function
The tcp-kind command specifies the option type in the TCP enhanced
authentication option.
The undo tcp-kind command restores the default TCP kind value.
Format
tcp-kind kind-value
undo tcp-kind
Parameters
Parameter Description Value
kind-value Specifies the TCP kind value to be used The value ranges from 28
for that keychain. to 255.
Views
Keychain view
Default Level
2: Configuration Level
Usage Guidelines
Usage Scenario
TCP connection request packets carry enhanced authentication options and are
authenticated by a specified authentication algorithm. Different vendors use
different kind values to specify the enhanced authentication option. Kind values
configured for the communicating parties must be the same.
Follow-up Procedure
After configuring the same TCP kind value for the communicating parties, run the
tcp-algorithm-id command to specify TCP algorithm IDs for the communicating
parties.
Precautions
If TCP connection request packets carry enhanced authentication options, the kind
value must be specified in the packets.
Example
# Configure the TCP kind value as 252 for the keychain test.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] tcp-kind 252
Function
The time mode command configures the time mode for Keychain.
The undo time mode command restores the default time mode for Keychain.
Format
time mode { utc | lmt }
Parameters
Parameter Description Value
Views
Keychain view
Default Level
2: Configuration level
Usage Guidelines
Each keychain consists of multiple key IDs that are valid within different time
periods and each key ID is configured with an authentication algorithm. When a
key ID becomes valid, the corresponding authentication algorithm is used,
ensuring the dynamic change of authentication algorithms. Configure different
key IDs for packet sending and receiving to be valid within different time periods.
To configure the time mode for Keychain, run the time mode command. You can
configure UTC or LMT for Keychain based on the network planning. Ensure that
the time mode remains the same on the entire network.
Example
# Configure the time mode for Keychain as UTC.
<HUAWEI> system-view
[HUAWEI] keychain test mode absolute
[HUAWEI-keychain-test] time mode utc
Function
The description command configures the description for an MPAC policy.
Format
description text
undo description
Parameters
Parameter Description Value
Views
MPAC policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To configure description for a created MPAC policy, use the description command.
The descriptions facilitate MPAC policy management on the device.
Prerequisites
An MPAC policy has been created using the service-security policy command.
Example
# Configure a description for an MPAC policy.
<HUAWEI> system-view
[HUAWEI] service-security policy ipv4 test
[HUAWEI-service-sec-test] description SwitchA-GE0/0/1 to SwitchB-GE0/0/1
Format
display service-security binding { ipv4 | ipv6 } [ interface interface-type
interface-number ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To check information about bound MPAC policies, run this command.
The display service-security binding { ipv4 | ipv6 } command displays all MPAC
policies bound to interfaces and bound globally.
The display service-security binding { ipv4 | ipv6 } interface interface-type
interface-number command displays the MPAC policies bound to a specified
interface.
Example
# Display all IPv4 MPAC policies bound on the device.
<HUAWEI> display service-security binding ipv4
Configured : Global
Policy Name : test
Interface : GigabitEthernet0/0/1
Policy Name: A1
Interface : Eth-Trunk1
Policy Name: A2
Format
display service-security policy { ipv4 | ipv6 } [ security-policy-name ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
An MPAC policy protects device security by controlling the packets destined for the
CPUs.
To check the MPAC rules, step, and description configured on a device, run the
display service-security policy command.
Example
# Display all IPv4 MPAC policy configurations on a device.
<HUAWEI> display service-security policy ipv4
Policy Name : A1
Step :5
Item Description
Function
The display service-security statistics command displays statistics about
matched rules in MPAC policies.
Format
display service-security statistics { ipv4 | ipv6 } [ security-policy-name ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
An MPAC policy protects device security by controlling the packets destined for the
CPUs.
Example
# Display statistics about matched rules in all IPv4 MPAC policies.
<HUAWEI> display service-security statistics ipv4
Policy Name : A1
Step :5
# Display statistics about matched rules in the IPv4 MPAC policy named test.
<HUAWEI> display service-security statistics ipv4 test
Policy Name : test
Step :5
rule 5 permit protocol tcp source-ip 127.1.1.1 0 source-port 1000 (10 times matched)
rule 10 permit protocol ip source-ip 10.10.1.0 0.0.0.255 (1 times matched)
Item Description
Format
reset service-security counters { ipv4 | ipv6 } [ security-policy-name ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If excess MPAC policy statistics are generated on a device and you want to view
new MPAC information, run the reset service-security counters to delete the
existing statistics first.
With the security-policy-name parameter specified, you can delete statistics about
the specified IPv4 or IPv6 MPAC policy. Without the security-policy-name
parameter specified, you can delete statistics about all IPv4 or IPv6 MPAC policies.
Precautions
All existing MPAC policy statistics will be deleted after this command is executed.
Example
# Delete statistics about the IPv4 MPAC policy test.
Function
The rule command adds a rule to the MPAC policy view.
The undo rule command deletes a rule or some configurations from the MPAC
policy view.
Format
rule [ rule-id ] { permit | deny } protocol { protocol-number | ftp | ssh | snmp |
telnet | tftp | bgp | ldp | rsvp | ospf | rip | ntp | lsp-ping | dhcp-c | dhcp-r | ip }
[ [ source-ip { source-ipv4-address { source-ipv4-mask | 0 } | any } ] |
[ destination-ip { destination-ipv4-address { destination-ipv4-mask | 0 } | any } ] ]
*
Parameters
Views
MPAC policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To match specific users or packets, run the rule command with the protocol name
or five packet attributes specified.
The MPAC matching rules for TCP/UDP are described in Table 14-92.
Prerequisites
An MPAC policy has been created using the service-security policy command.
Precautions
● The MPAC rules configured in the service6-sec policy view do not support ISIS.
● Exercise caution when using the rule [ rule-id ] deny protocol any command.
If this command is executed in the system view, no protocol packets can be
sent to the CPU, causing the device to be out of management.
● If a whitelist is configured for an MPAC IPv6 policy, run the rule permit
protocol 58 command to allow ICMPv6 packets to pass.
Example
# Add a rule to an MPAC policy.
<HUAWEI> system-view
[HUAWEI] service-security policy ipv4 test
Function
The service-security binding command binds an MPAC policy to an interface.
Format
service-security binding { ipv4 | ipv6 } security-policy-name
NOTE
Parameters
Views
Ethernet interface view, Ethernet sub-interface view, GE interface view, MultiGE
interface view, MultiGE sub-interface view, GE sub-interface view, XGE interface
view, 25GE interface view, XGE sub-interface view, 25GE sub-interface view, 40GE
interface view, 40GE sub-interface view, 100GE interface view, 100GE sub-interface
view, Eth-Trunk interface view, Eth-Trunk sub-interface view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Some attackers may pose as authorized users to send protocol packets to network
devices or control these devices. Such attacks affect network running. You can
configure MPAC on network devices to allow the specified protocol packets to be
sent to the CPUs or discard these packets, improving device security and reliability.
Prerequisites
An MPAC policy has been created using the service-security policy command.
Example
# Create an IPv4 MPAC policy and apply it to an interface.
<HUAWEI> system-view
[HUAWEI] service-security policy ipv4 test
[HUAWEI-service-sec-test] rule 5 permit protocol tcp source-port 1000 source-ip 127.1.1.1 0
[HUAWEI-service-sec-test] quit
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] service-security binding ipv4 test
Function
The service-security global-binding command binds an MPAC policy to a device
globally.
Format
service-security global-binding { ipv4 | ipv6 } security-policy-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Some attackers may pose as authorized users to send protocol packets to network
devices or control these devices. Such attacks affect network running. You can
configure MPAC on network devices to allow the specified protocol packets to be
sent to the CPUs or discard these packets, improving device security and reliability.
After an MPAC policy is created, run the service-security global-binding
command to bind it to a device globally.
Prerequisites
An MPAC policy has been created using the service-security policy command.
Example
# Create an IPv4 MPAC policy and apply it to a device globally.
<HUAWEI> system-view
[HUAWEI] service-security policy ipv4 test
[HUAWEI-service-sec-test] rule 5 permit protocol tcp source-port 1000 source-ip 127.1.1.1 0
[HUAWEI-service-sec-test] quit
[HUAWEI] service-security global-binding ipv4 test
Function
The service-security policy command creates an MPAC policy and displays its
view.
Format
service-security policy { ipv4 | ipv6 } security-policy-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Some attackers may pose as authorized users to send protocol packets to network
devices or control these devices. Such attacks affect network running. You can
configure MPAC on network devices to allow the specified protocol packets to be
sent to the CPUs or discard these packets, improving device security and reliability.
Example
# Create an IPv4 MPAC policy.
<HUAWEI> system-view
[HUAWEI] service-security policy ipv4 test
[HUAWEI-service-sec-test]
Format
step step-value
undo step
Parameters
Parameter Description Value
step-value Specifies the step between two The value is an integer that
MPAC rule IDs. ranges from 1 to 20.
Views
MPAC policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A step is an increment between neighboring MPAC rule IDs automatically
allocated by the system. For example, if the step is 5, the system allocates MPAC
rules with IDs 5, 10, 15, 20...
To allow insertion of new rules, set a step for MPAC rule IDs by using the step
command.
Prerequisites
MPAC policies have been created using the service-security policy command.
Configuration Impact
After you set a step, all the rule IDs in the MPAC policy are re-arranged using the
new step.
Precautions
Setting the step only changes rule IDs, but will not change the rule priorities.
Example
# Set the step for MPAC rule IDs to 10.
<HUAWEI> system-view
[HUAWEI] service-security policy ipv4 test
[HUAWEI-service-sec-test] step 10
Format
management-plane isolate enable
undo management-plane isolate enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Precautions
Example
# Enables management plane separation.
<HUAWEI> system-view
[HUAWEI] management-plane isolate enable
Function
The management-port isolate enable command isolates management interfaces
from service interfaces.
Format
management-port isolate enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Precautions
Example
# Isolate management interfaces from service interfaces.
<HUAWEI> system-view
[HUAWEI] management-port isolate enable
Format
display security risk [ trap-info ] [ feature feature-name ] [ level { high |
medium | low } ]
Parameters
Parameter Description Value
Views
All views
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Protocols have different security performances, and some protocols may have
security risks. Run the display security risk command to identify security risks in
the system. Then clear the security risks according to the repair action in the
command output. For example, if SNMPv1 is configured, the display security risk
command output will prompt for the use of SNMPv3.
You can filter the security risks by specifying the security level, feature, or both.
Precautions
The security risks that are displayed vary with user levels. The system
administrators can view all security risks in the system. Other users can only view
the security risks matching their levels.
Example
# Display security risks in the system.
<HUAWEI> display security risk
Risk level : high
Feature name : SNMP
Risk information : SNMPv1/SNMPv2c is enabled.
Repair action : Use SNMPv3.
NOTE
The command output provided here is used for reference only. The actual output information
depends on the situation.
Item Description
14.19.2 auto-enroll
Function
The auto-enroll command enables automatic certificate enrollment and update.
Format
auto-enroll [ percent ] [ regenerate [ key-bit ] ] [ updated-effective ]
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Automatic certificate enrollment: When the certificates are unavailable, will expire,
or have expired, an entity automatically requests a new certificate or renews the
certificate using the Simple Certification Enrollment Protocol (SCEP).
Precautions
● If you do not specify regenerate, the system uses the original RSA key pairs
during automatic updates.
● If you specify regenerate, the system generates new RSA key pairs during
certificate updates for certificate requests and overwrites the original
certificates and RSA key pairs with the new ones.
● After this command is run, the device checks whether the certificate has
expired every 60 minutes. If the certificate has expired, the device updates the
certificate.
Example
# Enable automatic certificate enrollment and update for the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] auto-enroll 50 regenerate
14.19.3 ca id
Function
The ca id command specifies a certificate authority (CA) trusted by a PKI realm.
Format
ca id ca-name
undo ca id
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
After the ca id command is executed to specify the CA trusted by the device, the
device's local certificate is requested, obtained, revoked, or queried through the
CA.
Example
# Specify the CA root_ca trusted by the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] ca id root_ca
14.19.4 cdp-url
Function
The cdp-url command configures the CRL distribution point (CDP) URL.
Format
cdp-url [ esc ] url-addr
cdp-url from-ca
undo cdp-url
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a PKI entity needs to use HTTP to update CRL, it must set up a connection
with the HTTP server based on CDP URL, and obtain the CRL from the HTTP
server. By default, a PKI entity locates and downloads CRL based on the method
(HTTP) in the CDP information of the local certificate. If you do not want to
download CRL based on the CDP URL in the local certificate, run this command to
configure the PKI entity to obtain CDP URL from the CA certificate or manually
configure the CDP URL.
When CRL is automatically updated by SCEP, you can also manually configure a
CDP URL address.
Precautions
Manually configuring a CDP URL address overwrites the CDP carried in the
certificate. If the certificate does not contain CDP information and no CDP URL
address is manually configured, the device requests the CRL from the CA server
using SCEP.
Keyword esc only supports the URLs that include the question mark (?) in ASCII
code. The URL must be in \x3f format, and 3f is the hexadecimal ASCII code for
the question mark (?). For example, if a user wants to enter http://***.com?
page1, the URL is http://***.com\x3fpage1. If a user wants to enter http://
www.***.com?page1\x3f that includes both a question mark (?) and \x3f, the
URL is http://www.***.com\x3fpage1\\x3f.
Example
# Set the CDP URL to http://10.1.1.1/certenroll/ca_root.crl.
<HUAWEI> system-view
[HUAWEI] pki realm d1
[HUAWEI-pki-realm-d1] crl scep
[HUAWEI-pki-realm-d1] cdp-url http://10.1.1.1/certenroll/ca_root.crl
14.19.5 certificate-check
Function
The certificate-check command sets the method of checking whether a certificate
in the PKI realm is revoked.
The undo certificate-check command cancels the method of checking whether a
certificate in the PKI realm is revoked.
By default, the system checks using CRLs whether a certificate in the PKI realm is
revoked.
Format
certificate-check { { crl | ocsp } * [ none ] | none }
undo certificate-check
NOTE
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
After this command is executed, the PKI entity validates the peer certificate, for
example, whether the peer certificate has expired and whether it is added to CRL.
In this case, you can run the certificate-check command to check the peer
certificate status.
The system supports the following methods to check whether a certificate in the
PKI realm is revoked:
● CRL
– If the CA server can function as a CDP, the certificate issued by CA
contains the CDP information about obtaining the certificate CRL. The PKI
entity then uses the specified method (HTTP) to find the CRL from the
specified location and download the CRL. If the CDP URL is configured in
the PKI realm, the PKI entity obtains the CRL from the specified URL.
– If the CA does not support CDPs and no CDP URL is configured on the PKI
entity, the PKI entity uses the SCEP protocol to obtain the CRL.
● OCSP
The PKI entity can use OCSP to check certificate status online, and you do not
need to frequently download CRLs.
When two PKI entities use certificates to perform IPSec negotiation, they
check the peer certificate status through OCSP in real time.
● None
This mode is used when no CRL or OCSP server is available to the PKI entity
or the PKI entity does not need to check the peer certificate status. In this
mode, the PKI entity does not check whether a certificate has been revoked.
Precautions
After the certificate-check crl command is configured, if the device does not have
the CRL file, the device fails the certificate verification, and the certificate becomes
invalid.
Example
# Set the certificate check method to crl none in PKI realm test. If the CRL mode
is unavailable, the certificate is regarded as valid.
<HUAWEI> system-view
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] certificate-check crl none
Function
The certificate auto-update enable command enables CMPv2-based automatic
certificate update.
The undo certificate auto-update enable command disables CMPv2-based
automatic certificate update.
By default, the CMPv2-based automatic certificate update is disabled.
Format
certificate auto-update enable
undo certificate auto-update enable
Parameters
None
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
If a certificate obtained through CMPv2 is about to expire, run this command to
enable CMPv2-based automatic certificate update to ensure certificate validity.
After the command is executed, the system performs checks (for example,
referenced PKI entity, URL for the CMPv2 server, RSA key pair for CMPv2-based
certificate application). The configuration is successful only when the conditions
are met.
When the system detects that the remaining validity period of the local certificate
has reached the value specified in certificate update expire-time, the system
automatically initiates the certificate update request and decides whether to
Example
# Enable CMPv2-based automatic certificate update.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] certificate auto-update enable
Function
The certificate update expire-time command specifies when the certificate starts
to update. The time is represented by a percentage of the total validity period.
The undo certificate update expire-time command restores the default
certificate update time.
By default, the certificate is automatically updated when the validity period is only
50% left.
Format
certificate update expire-time valid-percent
undo certificate update expire-time
Parameters
Parameter Description Value
valid-percent Specifies the remaining The value is an integer that ranges
percentage of the validity from 10 to 100. The default value is
period. 50.
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
If the automatic certificate update through CMPv2 is enabled, the system sends an
update request to the CMPv2 server when the specified updated time is reached.
This command sets the time (percentage of the total validity period) to update
the certificate.
Example
# Enable the automatic certificate update when the used time is 60% of the
validity period of the certificate.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] certificate update expire-time 60
Function
The cmp-request authentication-cert command configures the certificate for
identity authentication in the request through CMPv2.
Format
cmp-request authentication-cert cert-name
Parameters
Parameter Description Value
cert-name Specifies the name of a The value must be an existing
certificate file. certificate file name.
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Run this command to configure the certificate for identity authentication if you
need to apply for a certificate through CMPv2. For different requests through
CMPv2, the required certificates are as follows:
Example
# Configure the certificate for identity authentication in the request through
CMPv2.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request authentication-cert bb.cer
Function
The cmp-request ca-name command sets a CA name for the CMP session.
The undo cmp-request ca-name command deletes the CA name of the CMP
session.
By default, no CA name is configured for a CMP session.
Format
cmp-request ca-name ca-name
undo cmp-request ca-name
Parameters
Parameter Description Value
ca-name Indicates the name of the The value starts and ends with the
CA and is the field of quotation mark (") and is a string of 1
subject in the CA to 128 characters (including the
certificate. quotation marks). A comma (,) is used
to separate adjacent fields in the string.
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
A trusted authority enrolls and issues certificates to entities. Therefore, a trusted
CA name must be configured.
The field order in the CA name must be the same as that in the actual CA
certificate. Otherwise, the server regards the name as incorrect.
Example
# Set the CA name for CMP session test.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request ca-name "C=cn,ST=beijing,L=shangdi,O=BB,OU=BB,CN=BB"
Function
The cmp-request entity command sets the entity name used to apply for
certificate through CMPv2.
The undo cmp-request entity command deletes the entity name used to apply
for certificate through CMPv2.
By default, the entity name used to apply for certificate through CMPv2 is not
configured.
Format
cmp-request entity entity-name
undo cmp-request entity
Parameters
Parameter Description Value
entity-name Specifies the entity name for The value must be an existing
certificate application through PKI entity name.
CMPv2.
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To apply for a certificate through CMPv2, create a CMP session and specify the
entity name in the CMP session.
Prerequisites
1. A PKI entity has been created using the pki entity command.
2. A PKI entity common name has been created using the common-name
command.
Precautions
The specified entity can be referenced only by one CMP session or PKI realm.
Example
# Set the entity name the device uses when applying for a certificate through
CMPv2 to entity1.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] common-name test1
[HUAWEI-pki-entity-entity1] quit
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request entity entity1
Function
The cmp-request message-authentication-code command configures the
reference value and secret value of the message authentication code (MAC).
By default, the reference value and secret value of the MAC are not configured.
Format
cmp-request message-authentication-code reference-value secret-value
Parameters
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
When a device is configured to use MAC for initial request (IR), you need to check
the reference value and secret value of the MAC from the CMPv2 server in out-of-
band mode, and then run this command to set the values on the device.
Example
# Configure the reference value and secret value of the MAC.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request message-authentication-code 1234 123456
Function
The cmp-request origin-authentication-method command configures the
authentication method used for initial request (IR) through CMPv2.
Format
cmp-request origin-authentication-method { message-authentication-code |
signature }
Parameters
Parameter Description Value
message-authentication- Indicates the MAC method for the IR. -
code
signature Indicates the signature method for the IR. -
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
During the IR using CMPv2, a security protection measure needs to be taken:
● After you select the MAC method, run the cmp-request message-
authentication-code command to configure the reference value and secret
value. The device uses the reference value and secret value to protect
messages during the IR.
● After you select the signature method, run the cmp-request authentication-
cert command to configure the external certificate. The device uses the
external certificate to protect signatures during the IR.
Example
# Configure the authentication method used for IR through CMPv2.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request origin-authentication-method signature
Function
The cmp-request realm command specifies a PKI realm to which the CMPv2
server certificate belongs.
The undo cmp-request realm command deletes the specified PKI realm.
Format
cmp-request realm realm-name
Parameters
Parameter Description Value
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When applying for a certificate through CMPv2, run the cmp-request realm
command to specify the PKI realm to which the CMPv2 server certificate belongs.
Prerequisites
A PKI realm has been created using the pki realm command.
Example
# Set a PKI realm name of the CMPv2 server certificate to abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request realm abc
Function
The cmp-request rsa local-key-pair command configures the RSA key pair used
for certificate application through CMPv2.
The undo cmp-request rsa local-key-pair command deletes the RSA key pair
used for certificate application through CMPv2.
By default, the RSA key pair used to apply for certificate through CMPv2 is not
configured.
Format
cmp-request rsa local-key-pair key-name [ regenerate [ key-bit ] ]
undo cmp-request rsa local-key-pair
Parameters
Parameter Description Value
key-name Specifies the name of the RSA key The value must be an
pair. existing RSA key pair name.
key-bit Specifies the bits of the RSA key pair The value is an integer that
generated during the certificate ranges from 2048 to 4096.
update. The default value is 2048.
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When CMPv2 is used to apply for a certificate, the certificate request message sent
by the PKI entity to CA must contain public key information. Therefore, you need
to configure an RSA key pair for certificate application through CMPv2. Note the
following during the configuration:
● If regenerate is unspecified, the system uses the original RSA key pairs during
automatic updates.
● If regenerate is specified, the system generates new RSA key pairs during
certificate updates for the application for certificates and overwrites the
original certificates and RSA key pairs with the new ones.
Prerequisites
The RSA key pair for certificate application has been created using the pki rsa
local-key-pair create command or the RSA key pair has been imported to the
memory using the pki import rsa-key-pair command.
Precautions
One RSA key pair can be referenced only by one CMP session.
Example
# Configure the RSA key pair to be referenced by CMP session test and update the
RSA key pair during the certificate update.
<HUAWEI> system-view
[HUAWEI] pki rsa local-key-pair create test
Info: The name of the new key-pair will be: test
The size of the public key ranges from 2048 to 4096.
Input the bits in the modules:2048
Generating key-pairs...
.........................+++
................................................................................
........+++
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request rsa local-key-pair test regenerate 2048
Function
The cmp-request server url command specifies the URL address of a CMPv2
server.
The undo cmp-request server url command deletes the URL address of a CMPv2
server.
Format
cmp-request server url [ esc ] url-addr
Parameters
Parameter Description Value
url-addr Specifies the URL of the CMPv2 The value is a string starting with
server. http:// and consisting of 1 to 128
case-insensitive characters without
spaces.
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
Configure a URL for the CMPv2 server before certificate application. Then the PKI
entity sends a request message to the server's URL.
A user cannot enter command lines that include a question mark (?). Therefore,
keyword esc supports the entering of URLs that include the question mark (?) in
the ASCII code. The URL must be in \x3f format, and 3f is the hexadecimal ASCII
code for the question mark (?). For example, if a user wants to enter http://
***.com?page1, the URL is http://***.com\x3fpage1. If a user wants to enter
http://www.***.com?page1\x3f that includes both a question mark (?) and \x3f,
the URL is http://www.***.com\x3fpage1\\x3f.
Example
# Set the URL of the CMPv2 server for CMP session test to http://10.1.1.1:8080.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request server url http://10.1.1.1:8080
# Set the URL of the CMPv2 server for CMP session test to http://www.***.com?
page1\x3f.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request server url esc http://www.***.com\x3fpage1\\x3f
Function
The cmp-request verification-cert command configures the certificate file for
verifying the CA response signature.
The undo cmp-request verification-cert command deletes the certificate file for
verifying the CA response signature.
By default, no certificate file for verifying the CA response signature is configured.
Format
cmp-request verification-cert cert-file-name
undo cmp-request verification-cert
Parameters
Parameter Description Value
cert-file-name Specifies the certificate file The value must be an existing
name. certificate file name.
Views
CMP session view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After this command is executed, the device uses the configured certificate to verify
the CA response signature. This command configures the CA certificate.
If this command is not executed and the CA response mode is signature, the
device constructs a certificate chain based on the certificates in the response
messages sent by the device itself and CA to verify the CA response signature. If
the MAC mode is set, the device uses the MAC to verify the CA response signature.
That is, this command does not take effect.
Prerequisites
The certificate file for verifying the CA response signature exists.
Example
# Configure the certificate file for verifying the CA response signature.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] cmp-request verification-cert aa.der
14.19.17 common-name
Function
The common-name command configures a common name for a PKI entity.
The undo common-name command cancels the configuration.
By default, a PKI entity does not have a common name.
Format
common-name common-name
undo common-name
Parameters
Parameter Description Value
common- Specifies the The value is a string of 1 to 64 case-
name common name of a sensitive characters, including letters,
PKI entity. numerals, apostrophes ('), equal signs (=),
parentheses (), plus signs (+), commas (,),
minus signs (-), periods (.), slashes (/),
colons (:), and spaces.
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
After a PKI entity is created, a common name must be configured to uniquely
identify the PKI entity.
After the common name is configured for a PKI entity, the certificate request
packet sent by the device to the CA server carries this name. The CA server verifies
every received certificate request packet. For each valid packet, the CA server
generates a digital certificate carrying the common name of the PKI entity.
Example
# Set the common name to test for a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] common-name test
Function
The country command configures a country code for a PKI entity.
The undo country command deletes the country code of a PKI entity.
By default, no country code is configured for a PKI entity.
Format
country country-code
undo country
Parameters
Parameter Description Value
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity contain the identity information of the entity. The
CA identifies a certificate applicant based on identity information provided by the
entity. To facilitate applicant identification, configure the country code for the PKI
entity, which is used as an alias of the entity.
After the country code is configured for a PKI entity, the certificate request packet
sent by the device to the CA server carries this country code. The CA server verifies
every received certificate request packet. For each valid packet, the CA server
generates a digital certificate carrying the country code of the PKI entity.
Example
# Configure the country code to CN for a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] country CN
Function
The crl auto-update enable command enables the automatic CRL update
function.
The undo crl auto-update enable command disables the automatic CRL update
function.
By default, automatic CRL update is enabled.
Format
crl auto-update enable
undo crl auto-update enable
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
To configure the automatic CRL update function, enable the function first.
Example
# Enable the automatic CRL update function.
<HUAWEI> system-view
[HUAWEI] pki realm d1
[HUAWEI-pki-realm-d1] crl auto-update enable
Function
The crl cache command configures the device to use the cached CRL.
The undo crl cache command configures the device to retrieve the latest CRL
each time.
By default, the PKI realm is allowed to use cached CRLs.
Format
crl cache
undo crl cache
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
The system overwrites the CRL in memory with the cached URL for certificate
verification. If the PKI realm is not allowed to use cached CRL, the system must
download the latest CRL every time to overwrite the CRL in memory.
Example
# Allow the device to use the cached CRL in the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] crl cache
Function
The crl http command enables automatic CRL update using HTTP.
By default, the CRL is updated automatically using HTTP.
Format
crl http
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
This command is required when CRL is updated using HTTP, and ensure that there
is sufficient space in the device storage for the CRL file.
Example
# Configure automatic CRL update using HTTP.
<HUAWEI> system-view
[HUAWEI] pki realm d1
[HUAWEI-pki-realm-d1] crl http
Function
The crl scep command configures a device to use SCEP to automatically update a
CRL.
By default, a device uses HTTP to automatically update a CRL.
Format
crl scep
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
This command is required when CRL is updated using SCEP, and ensure that there
is sufficient space in the device storage for the CRL file.
Example
# Use SCEP to automatically update a CRL.
<HUAWEI> system-view
[HUAWEI] pki realm d1
[HUAWEI-pki-realm-d1] crl scep
Function
The crl update-period command sets the interval for automatic CRL update.
The undo crl update-period command restores the default interval for automatic
CRL update.
Format
crl update-period interval
Parameters
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
The CRL update interval is the interval at which a PKI entity using a certificate
downloads a CRL from the CRL storage server. The CA/RA does not issue the CRL
to an entity. Instead, the entity initiates CRL query to obtain a CRL.
Example
# Set the interval at which a CRL is automatically updated to 21 hours.
<HUAWEI> system-view
[HUAWEI] pki realm d1
[HUAWEI-pki-realm-d1] crl update-period 21
Function
The display pki ca-capability command displays the CA capabilities of a PKI
realm.
Format
display pki ca-capability realm realm-name
Parameters
Parameter Description Value
Views
All views
Default Level
3: Management level
Usage Guidelines
The display pki ca-capability command displays the CA capabilities of a PKI
realm.
Example
# Display the CA capabilities of the PKI realm asdf.
<HUAWEI> display pki ca-capability realm asdf
PKI CA Capabilities :
GetNextCACert : ----
POSTPKIOperation : ----
Renewal : ----
SHA-512 : ----
SHA-256 : ----
SHA-1 : ----
DES3 : ----
Item Description
Function
The display pki cert-req command displays the content of a certificate request
file.
Format
display pki cert-req filename file-name
Parameters
Parameter Description Value
Views
All views
Default Level
3: Management level
Usage Guidelines
This command displays content of a certificate request file, including the subject,
public key algorithm, key modulus, attributes, and signature algorithm.
Example
# Display the content of a certificate request file named test.req.
<HUAWEI> display pki cert-req filename test.req
Certificate Request:
Data:
Version: 0 (0x0)
Subject: C=CN, ST=Jiangsu, L=Beijing, O=org1, OU=Group1,Sale, CN=huawei
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
00:c4:01:cf:95:bb:fb:35:f0:3e:cd:1d:10:9e:11:
08:2e:77:48:ba:1b:e6:00:1b:43:30:56:f9:9a:6b:
ed:8b:fe:3e:03:57:38:02:48:88:e3:9b:39:d0:1c:
2b:8f:6a:9b:91:17:9b:ce:cb:fc:87:40:78:39:08:
1c:53:c3:71:cc:db:64:6f:ec:5a:cd:33:a5:68:5e:
e6:52:61:ad:a1:58:55:f0:a0:0f:db:ab:05:eb:a4:
fe:e1:68:61:8c:af:2c:3a:34:95:d2:41:ee:09:e7:
b0:fc:59:d9:f4:12:00:de:ab:14:b6:a3:fe:29:75:
f7:dd:7b:aa:03:81:fc:ae:41:8c:e4:ad:e3:d9:65:
d4:be:a0:c1:e0:43:8a:91:ad:20:7b:6f:12:25:6e:
0d:67:7d:4c:fe:8d:1b:6d:f3:96:07:31:ed:73:d3:
71:6b:51:18:64:bd:41:d6:18:2d:2d:86:b7:fa:26:
eb:cc:cb:a3:0f:0b:61:22:fd:dd:5f:b4:4d:9b:7d:
bc:fa:af:e6:95:d7:27:f1:60:31:56:83:58:2c:40:
1a:5e:6a:94:63:aa:70:2f:9b:00:e0:a3:9e:fb:73:
62:5e:1c:3c:5f:48:42:7c:26:8f:5f:cf:39:b9:5d:
25:90:8e:6c:e0:04:ec:e2:1b:1f:a8:0d:d2:ef:20:
41:79
Exponent: 65537 (0x10001)
Attributes:
challengePassword :******
Requested Extensions:
X509v3 Subject Alternative Name:
IP Address:10.1.1.1, DNS:example.com, email:test@example.com
Signature Algorithm: sha256WithRSAEncryption
71:e7:c0:5f:36:c9:16:eb:fc:0c:8e:d1:4f:3d:ee:25:6b:47:
65:86:4b:89:ec:22:01:42:a5:0e:5c:aa:01:0a:57:a9:25:ba:
1b:59:6d:77:5f:74:80:3b:af:f9:37:75:97:9a:ca:80:73:8b:
36:14:2c:4b:9a:2f:53:5c:5b:4a:93:31:88:94:0f:4d:58:84:
36:41:e8:a8:6c:cd:f0:bb:9f:51:50:b2:a4:40:f4:ec:37:c5:
42:08:69:b5:c5:fd:af:3d:8a:aa:47:53:d3:ce:bc:76:ec:47:
ca:36:90:0b:49:2b:2f:04:c4:1f:f1:12:b6:99:d0:f8:33:d8:
08:d0:32:ac:ee:34:0f:07:ef:72:9f:6b:71:80:3e:8d:37:cc:
ca:b5:c1:56:3d:65:c7:e6:99:1b:2b:53:01:69:f5:8a:18:05:
d1:b1:48:3e:50:e0:4c:7f:db:dc:b7:cd:a2:37:f9:96:cd:0d:
ee:61:c2:80:61:6b:99:c0:76:0d:ab:2c:46:ce:b7:aa:6a:12:
72:b7:6f:64:cc:78:b7:16:bd:c5:32:45:79:42:cf:4c:28:91:
ce:cd:7d:da:eb:2b:3a:cf:90:1f:61:5e:02:25:fe:3c:82:66:
d4:e8:c7:f8:5e:84:2c:f6:b2:f0:ba:ee:7a:c1:9b:d4:68:02:
a4:e3:27:89
Item Description
Item Description
Function
The display pki certificate command displays the content about the CA or local
certificate loaded to the device and OCSP server certificate.
Format
display pki certificate { ca | local | ocsp } realm realm-name
NOTE
Parameters
Parameter Description Value
realm realm-name Specifies the PKI realm name of a The PKI realm
certificate to be checked. name must
already exist.
Views
All views
Default Level
2: Configuration level
Usage Guidelines
This command shows information about the CA certificate, local certificate, and
OCSP server's certificate, including signature algorithm, issuer, validity period,
subject, and subject public key.
Example
# Display information about the CA certificate.
<HUAWEI> display pki certificate ca realm abc
The x509 object type is certificate:
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
0c:f0:1a:f3:67:21:44:9a:4a:eb:ec:63:75:5d:d7:5f
Signature Algorithm: sha1WithRSAEncryption
Issuer: CN=ca_root
Validity
Not Before: Jun 4 14:58:17 2015 GMT
Not After : Jun 4 15:07:10 2020 GMT
Subject: CN=ca_root
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
00:d9:5f:2a:93:cb:66:18:59:8c:26:80:db:cd:73:
d5:68:92:1b:04:9d:cf:33:a2:73:64:3e:5f:fe:1a:
53:78:0e:3d:e1:99:14:aa:86:9b:c3:b8:33:ab:bb:
76:e9:82:f6:8f:05:cf:f6:83:8e:76:ca:ff:7d:f1:
bc:22:74:5e:8f:4c:22:05:78:d5:d6:48:8d:82:a7:
5d:e1:4c:a4:a9:98:ec:26:a1:21:07:42:e4:32:43:
ff:b6:a4:bd:5e:4d:df:8d:02:49:5d:aa:cc:62:6c:
34:ab:14:b0:f1:58:4a:40:20:ce:be:a5:7b:77:ce:
a4:1d:52:14:11:fe:2a:d0:ac:ac:16:95:78:34:34:
21:36:f2:c7:66:2a:14:31:28:dc:7f:7e:10:12:e5:
6b:29:9a:e8:fb:73:b1:62:aa:7e:bd:05:e5:c6:78:
6d:3c:08:4c:9c:3f:3b:e0:e9:f2:fd:cb:9a:d1:b7:
de:1e:84:f4:4a:7d:e2:ac:08:15:09:cb:ee:82:4b:
6b:bd:c6:68:da:7e:c8:29:78:13:26:e0:3c:6c:72:
39:c5:f8:ad:99:e4:c3:dd:16:b5:2d:7f:17:e4:fd:
e4:51:7a:e6:86:f0:e7:82:2f:55:d1:6f:08:cb:de:
84:da:ce:ef:b3:b1:d6:b3:c0:56:50:d5:76:4d:c7:
fb:75
Exponent: 65537 (0x10001)
X509v3 extensions:
1.3.6.1.4.1.311.20.2:
...C.A
X509v3 Key Usage: critical
Digital Signature, Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Subject Key Identifier:
B8:63:72:A4:5E:19:F3:B1:1D:71:E1:37:26:E1:46:39:01:B6:82:C5
X509v3 CRL Distribution Points:
Full Name:
URI:http://vasp-e6000-127.china.huawei.com/CertEnroll/ca_root.
crl
URI:file://\\vasp-e6000-127.china.huawei.com\CertEnroll\ca_roo
t.crl
1.3.6.1.4.1.311.21.1:
...
Signature Algorithm: sha1WithRSAEncryption
52:21:46:b8:67:c8:c3:4a:e7:f8:cd:e1:02:d4:24:a7:ce:50:
be:33:af:8a:49:47:67:43:f9:7f:79:88:9c:99:f5:87:c9:ff:
08:0f:f3:3b:de:f9:19:48:e5:43:0e:73:c7:0f:ef:96:ef:5a:
5f:44:76:02:43:83:95:c4:4e:06:5e:11:27:69:65:97:90:4f:
04:4a:1e:12:37:30:95:24:75:c6:a4:73:ee:9d:c2:de:ea:e9:
05:c0:a4:fb:39:ec:5c:13:29:69:78:33:ed:d0:18:37:6e:99:
bc:45:0e:a3:95:e9:2c:d8:50:fd:ca:c2:b3:5a:d8:45:82:6e:
ec:cc:12:a2:35:f2:43:a5:ca:48:61:93:b9:6e:fe:7c:ac:41:
bf:88:70:57:fc:bb:66:29:ae:73:9c:95:b9:bb:1d:16:f7:b4:
6a:da:03:df:56:cf:c7:c7:8c:a9:19:23:61:5b:66:22:6f:7e:
1d:26:92:69:53:c8:c6:0e:b3:00:ff:54:77:5e:8a:b5:07:54:
fd:18:39:0a:03:ac:1d:9f:1f:a1:eb:b9:f8:0d:21:25:36:d5:
06:de:33:fa:7b:c8:e9:60:f3:76:83:bf:63:c6:dc:c1:2c:e4:
58:b9:cb:48:15:d2:a8:fa:42:72:15:43:ef:55:63:39:58:77:
e8:ae:0f:34
Item Description
Function
The display pki certificate enroll-status command displays the certificate
enrollment status.
Format
display pki certificate enroll-status [ realm realm-name ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display pki certificate enroll-status command displays the certificate
enrollment status.
Example
# Display the certificate enrollment status.
<HUAWEI> display pki certificate enroll-status realm abc
Certificate Request Transaction 1
Status: Pending
Key Usage: ENC&SIG
Entity name: test
Remain polling count: 1
Next polling after : 35 seconds
<HUAWEI> display pki certificate enroll-status realm abc
info: No certificate request transaction in realm abc.
Item Description
Function
The display pki certificate filename command displays the content of a
certificate.
Format
display pki certificate filename file-name
Parameters
Parameter Description Value
Views
All views
Default Level
3: Management level
Usage Guidelines
This command shows information about the certificate including signature
algorithm, issuer, validity period, subject, and subject public key.
Example
# Display information about the certificate ca.cer.
<HUAWEI> display pki certificate filename ca.cer
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
f3:a3:3a:46:f6:09:8d:18
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=CN, ST=JS, L=NJ, O=HW, OU=VPN, CN=CA-210235G7G410FB000060
Validity
Not Before: May 16 11:48:04 2017 GMT
Not After : May 14 11:48:04 2027 GMT
Subject: C=CN, ST=JS, L=NJ, O=HW, OU=VPN, CN=CA-210235G7G410FB000060
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:ba:cc:ef:2f:55:9c:d0:09:c5:1b:d2:52:63:92:
c8:f0:88:ed:1b:88:f1:e4:3c:90:07:85:01:8c:d5:
80:d9:91:ef:64:e9:79:0c:7d:0e:b9:6c:00:a2:72:
e2:1b:aa:9b:2d:11:6b:6f:2d:de:5d:58:22:cf:9e:
2f:7d:f1:ad:71:e9:25:0e:bc:26:f1:77:57:02:3d:
7f:09:8f:49:63:ae:11:75:57:65:a0:bd:9c:94:c6:
df:21:f7:c8:5a:4d:5e:f8:5e:84:b0:b0:fd:a6:c7:
e0:78:d1:1c:8a:55:d9:e9:66:1c:e5:4e:ce:88:dd:
fa:0f:60:d0:7e:86:a1:ec:b1:34:aa:f7:dd:72:c6:
0a:90:c7:4a:6b:a0:86:01:30:b6:6f:23:ff:ce:ae:
39:fb:de:18:ce:2f:b9:d7:17:09:8c:29:19:34:7a:
69:75:dc:ee:bf:2e:d4:93:fb:f6:a6:5b:f8:2a:6d:
fe:bd:f4:8b:30:49:5c:a8:94:76:12:9d:64:78:4a:
48:d3:2d:63:da:0a:79:b2:ee:8e:2d:5a:a0:71:99:
cf:b9:68:77:d3:d9:cf:12:64:80:bb:42:8c:28:1f:
d9:bf:7c:4b:8f:39:1e:dc:92:a4:ff:8e:b3:02:58:
c5:79:96:f2:a1:f9:17:cb:ea:49:57:b0:b0:3c:af:
db:19
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Key Usage: critical
Certificate Sign, CRL Sign
X509v3 Subject Key Identifier:
83:08:A4:F4:BC:EC:1B:B6:7D:B0:27:F6:10:47:77:AA:2A:66:59:D5
Netscape Cert Type:
SSL CA
Signature Algorithm: sha256WithRSAEncryption
1e:6b:2a:76:7e:8e:b0:0e:72:4e:02:53:b0:77:0d:13:28:4e:
c3:e5:f8:0b:76:fd:56:2c:e6:5b:d1:f8:48:19:17:95:1a:79:
5e:d9:50:b9:68:bd:36:c4:ce:7b:ce:0c:98:55:b1:44:9f:20:
66:66:33:3c:b5:40:ad:50:c8:64:1c:07:0e:08:42:72:88:35:
d4:af:f0:8d:5d:64:90:5d:ec:f0:5c:07:76:10:ed:9b:22:18:
ef:44:4e:c2:29:32:40:68:fe:04:dc:0e:f6:2b:25:c2:73:f5:
9b:64:df:25:56:c6:bb:6e:a4:2f:07:b3:9d:c0:18:60:72:cb:
51:62:94:ee:f7:21:0a:a0:92:58:a1:bf:c8:30:0e:0c:0a:91:
cb:f4:8f:07:52:ba:df:25:88:8a:b3:3f:f0:68:fa:4c:b7:31:
c8:97:e0:49:08:8a:74:fc:c2:90:d7:3c:0b:00:38:90:3b:19:
ab:66:96:24:1f:86:b9:62:49:6d:9c:2d:02:99:38:bb:96:b6:
dd:0f:3c:6e:24:7b:3d:1e:77:58:e7:46:2b:42:cc:14:6a:a4:
16:45:ed:3c:b1:d6:30:94:c0:30:d0:46:fa:bc:da:9a:2b:f1:
fa:f3:df:1b:84
Table 14-98 Description of the display pki certificate filename command output
Item Description
Item Description
Function
The display pki cmp statistics command displays CMP session statistics.
Format
display pki cmp statistics [ session session-name ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command displays CMP session statistics, including the number of sent IR
packets, sent CR packets, sent KUR packets, and received IP packets.
If a CMP session is specified, the statistics of the session are displayed. If no CMP
session is specified, the statistics of all sessions are displayed.
Example
# Display the statistics of the CMP session test.
<HUAWEI> display pki cmp statistics session test
CMP Context Name: test
Ir Send Counts :0
Cr Send Counts :0
Kur Send Counts :0
PollReq Send Counts : 0
Ip Receive Counts :0
Cp Receive Counts :0
Kup Receive Counts : 0
PollRep Receive Counts: 0
Table 14-99 Description of the display pki cmp statistics command output
Item Description
Item Description
Function
The display pki credential-storage-path command displays the default path
where a PKI certificate is stored.
Format
display pki credential-storage-path
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The display pki credential-storage-path command displays the default path
where a PKI certificate is stored.
Example
# Display the default path where a PKI certificate is stored.
<HUAWEI> display pki credential-storage-path
The pki credential-storage-path is flash:/ .
Function
The display pki crl command displays the content of the CRL in the device.
Format
display pki crl { realm realm-name | filename filename }
Parameters
Parameter Description Value
realm realm-name Specifies the name of the PKI The PKI realm name
realm associated with the CRL. must already exist.
filename filename Specifies the file name of the The certificate file name
certificate to be imported. must already exist.
Views
All views
Default Level
3: Management level
Usage Guidelines
This command shows information about local CRL, including signature algorithm,
issuer, update time, revoked certificate, CRL sequence number, and revocation
time.
Example
# Display information about the CRL associated with the PKI realm abc.
<HUAWEI> display pki crl realm abc
The x509 object type is CRL:
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: sha1WithRSAEncryption
Issuer: /CN=ca_root
Last Update: Dec 15 08:24:28 2015 GMT
Next Update: Dec 22 20:44:28 2015 GMT
CRL extensions:
X509v3 Authority Key Identifier:
keyid:B8:63:72:A4:5E:19:F3:B1:1D:71:E1:37:26:E1:46:39:01:B6:82:C
5
1.3.6.1.4.1.311.21.1:
...
X509v3 CRL Number:
365
1.3.6.1.4.1.311.21.4:
151222083428Z .
Revoked Certificates:
Serial Number: 28C63371000000003E04
Revocation Date: Dec 15 08:34:27 2015 GMT
CRL entry extensions:
X509v3 CRL Reason Code:
Key Compromise
Serial Number: 28C2AB44000000003E01
Revocation Date: Dec 15 08:30:35 2015 GMT
CRL entry extensions:
X509v3 CRL Reason Code:
Key Compromise
Serial Number: 2364247C000000003D48
Revocation Date: Dec 14 07:29:05 2015 GMT
CRL entry extensions:
X509v3 CRL Reason Code:
Key Compromise
Serial Number: 23627E0F000000003D47
Revocation Date: Dec 14 07:27:29 2015 GMT
CRL entry extensions:
X509v3 CRL Reason Code:
Key Compromise
Serial Number: 2360F397000000003D46
Revocation Date: Dec 14 07:25:48 2015 GMT
CRL entry extensions:
X509v3 CRL Reason Code:
Key Compromise
Signature Algorithm: sha1WithRSAEncryption
7a:71:54:d1:66:13:6f:9f:62:03:ac:9a:5f:42:10:15:87:46:
e2:a1:49:0f:44:19:ce:ed:6f:c3:0e:9f:31:fe:62:d5:08:0b:
a4:a7:7e:80:4d:9a:5b:a9:55:5c:1a:73:30:62:48:e1:28:0e:
5b:bd:ae:04:7e:83:36:43:62:fc:f7:12:0d:f9:f6:ac:2b:be:
9c:50:6c:67:19:43:12:31:67:c2:06:31:97:e1:34:75:1c:87:
53:5f:e6:15:a1:33:ad:00:e7:14:68:59:05:67:28:78:a0:91:
49:7b:ab:87:9f:9e:53:18:4b:54:53:1c:b7:1c:2d:3e:b3:57:
63:95:1d:01:29:9e:6c:41:07:40:2d:28:d8:82:7b:d6:22:e6:
0d:0c:4c:af:84:96:8e:f1:29:28:d4:9e:1c:37:3b:1b:2e:34:
a7:15:e3:29:d1:c0:69:0a:7f:24:b1:ce:00:f1:b3:da:ef:8a:
1b:14:36:f9:14:6c:b0:66:86:a8:92:95:fc:e3:78:aa:d6:d0:
cb:4d:26:b4:bc:41:c4:47:19:d0:2a:0c:ac:c6:aa:95:c2:03:
33:8a:39:45:3e:c3:ad:46:7d:8a:03:4d:08:e2:d0:9a:ae:39:
fa:8d:61:d0:1c:6c:03:d4:48:2e:4d:37:60:a1:06:a4:ea:c8:
0d:20:59:c2
Item Description
Function
The display pki entity command displays information about PKI entities.
Format
display pki entity [ entity-name ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command displays information about PKI entities, including names, common
names, countries, province, and location where the entities reside, and
organizations to which entities belong.
Example
# Display information about all PKI entities.
<HUAWEI> display pki entity
PKI Entity Information:
Entity Name :a
Common name : chi
Country :-
State :A
Locality :-
Organization :A
Organization unit: -
FQDN : www. e
IP address :-
Email :-
Serial-number : -
Total Number: 1
Item Description
Item Description
Function
The display pki ocsp cache statistics command displays statistics about cached
OCSP responses.
Format
display pki ocsp cache statistics
NOTE
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command shows statistics about cached OCSP responses, including the
maximum number of OCSP responses that can be cached, cache update interval,
and number of cached responses.
Example
# Display statistics about cached OCSP responses.
<HUAWEI> display pki ocsp cache statistics
=====================================================
OCSP Cache Function: Enable
OCSP Cache Max Number: 2
OCSP Cache Refresh Interval: 5 minutes
OCSP Cache Current Number: 0
=====================================================
Table 14-102 Description of the display pki ocsp cache statistics command
output
Item Description
Function
The display pki ocsp cache detail displays the detail information of the OCSP
cache.
NOTE
Format
display pki ocsp cache detail
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
You can run this command to view detail information of the OCSP cache.
Example
# Display the detail information of the OCSP cache.
<HUAWEI> display pki ocsp cache detail
=====================================================
Cache Hash Status Info:
num_items =0
num_nodes =8
num_alloc_nodes = 16
num_expands =0
num_expand_reallocs = 0
num_contracts =0
num_contract_reallocs = 0
num_hash_calls =0
num_comp_calls =0
num_insert =0
num_replace =0
num_delete =0
num_no_delete =0
num_retrieve =0
num_retrieve_miss =0
num_hash_comps =0
Cache Hash Node Status Info:
node 0 -> 0
node 1 -> 0
node 2 -> 0
node 3 -> 0
node 4 -> 0
node 5 -> 0
node 6 -> 0
node 7 -> 0
Cache Hash Node Usage Status Info:
Table 14-103 Description of the display pki ocsp cache detail command output
Item Description
Item Description
Cache Hash Node Status Info Hash node status in the OCSP cache. For
example, node 0 -> 0 indicates that the
number 0 node is unused; node 0 -> 1
indicates that the number 0 node is in use.
Cache Hash Node Usage Status Hash node use status in the OCSP cache.
Info
n nodes used out of 8 There are 8 hash nodes, and n nodes are in
use.
Function
The display pki ocsp server down-information command displays the Down
state information of the OCSP server recorded on the device.
NOTE
Format
display pki ocsp server down-information
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
There is a mechanism to determine whether the OCSP server is Down. When the
OCSP server corresponding to a URL cannot be accessed, the server status is set to
Down. In this case, the device will not send OCSP requests to the URL within 10
minutes.
Example
# Display the Down state information of the OCSP server.
<HUAWEI> display pki ocsp server down-information
=====================================================
Item Description
Item Description
Last timeout until now Time elapsed since the last connection
timeout and now.
Function
The display pki peer-certificate command displays the imported certificates of
the remote device.
Format
display pki peer-certificate { name peer-name | all }
Parameters
Parameter Description Value
Views
All views
Default Level
2: Configuration level
Usage Guidelines
This command shows information about imported certificates of the remote
device, including signature algorithm, issuer, validity period, subject, public key,
and PKI realm.
Example
# Display brief information about all certificates of the remote device.
<HUAWEI> display pki peer-certificate all
Peer certificate name :abcd
Serial Number:
12 19 3c d3 00 00 00 00 04 9a
Subject:
CN=a
Total Number: 1
# Display detailed information about the certificate abcd of the remote device.
<HUAWEI> display pki peer-certificate name abcd
The x509 object type is certificate:
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
12:19:3c:d3:00:00:00:00:04:9a
Signature Algorithm: sha1WithRSAEncryption
Issuer: CN=CA_ROOT
Validity
Not Before: Feb 19 13:00:22 2013 GMT
Not After : Feb 19 13:10:22 2014 GMT
Subject: CN=a
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (512 bit)
Modulus:
00:b9:8b:47:65:a9:99:ed:58:b2:63:74:65:56:d1:
08:bb:1d:8f:4e:ed:72:a2:4a:ef:d8:45:3d:53:db:
c8:eb:df:53:9e:5f:c7:96:46:65:14:1a:ab:72:e9:
a2:71:c8:7a:f0:51:0c:cc:39:bb:14:75:7d:f1:bc:
88:2c:a7:2e:e9
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
E2:5B:8A:03:58:01:C8:E3:14:BC:18:5B:F9:BD:00:68:5B:D1:90:4E
X509v3 Authority Key Identifier:
keyid:CE:BA:CA:39:C7:AD:6A:CB:85:17:D0:8A:8E:28:02:0B:52:D4:D9:2
B
Full Name:
URI:http://10.1.1.1:8080/CertEnroll/CA_ROOT.crl
1.3.6.1.4.1.311.20.2:
.0.I.P.S.E.C.I.n.t.e.r.m.e.d.i.a.t.e.O.f.f.l.i.n.e
Signature Algorithm: sha1WithRSAEncryption
bb:8b:77:af:ae:df:2e:0c:bd:7a:29:6e:76:23:ad:7d:69:6d:
0d:16:d9:18:82:ad:4f:52:b3:cd:1c:1a:fc:34:00:33:36:8d:
47:2a:20:24:52:b7:02:75:cc:ab:3b:4c:f8:2a:a9:a9:4f:46:
fb:c2:21:00:c1:b5:c2:67:0c:b1:99:2a:62:7b:71:4d:e7:c2:
93:29:bb:ec:b1:e9:28:82:2f:77:61:ec:28:66:35:cb:5f:15:
04:73:77:d8:26:91:7b:a2:56:74:51:33:0b:f1:04:28:24:b2:
71:58:ad:5c:f8:96:17:0d:f7:b7:5f:4b:b9:ed:09:79:bc:54:
21:c5:9b:90:f7:7b:21:aa:5a:aa:6f:51:e4:79:ce:b8:35:8b:
19:90:51:94:e6:c2:61:f8:24:46:85:4c:a9:69:bd:8a:ef:c2:
64:b8:19:ab:0b:6b:ec:34:41:8d:43:43:44:d1:1b:4c:4a:23:
cd:40:52:7a:2e:8c:5d:b6:62:55:93:45:c8:3e:de:b1:51:82:
d0:bb:7c:b8:09:7b:97:08:7b:93:17:40:a8:6f:2d:ed:f4:3e:
36:10:2a:20:e3:47:e1:fb:ad:fe:97:73:a7:53:d0:f8:52:ca:
b6:0e:e8:f1:df:6c:7a:37:39:bb:82:f9:03:c9:4a:71:65:df:
6f:37:e6:b7
Function
The display pki realm command displays PKI realm information.
Format
display pki realm [ realm-name ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
This command displays details about PKI realms, including PKI realm name,
associated CA, CA certificate subject name, URL of the certificate enrolled through
SCEP, PKI entity name, digital fingerprint algorithm of CA certificate, and digital
fingerprint of CA certificate.
Example
# Display information about all PKI realms.
<HUAWEI> display pki realm abc
Realm Name : abc
CA ID: CA_ROOT
CA Name: "/CN=ca_root"
Enrollment URL: http://10.136.7.196:8080/certsrv/mscep/mscep.dll
Certificate Request Interval(Minutes): 1
Certificate Request Times: 5
Enrollment Mode: RA
Enrollment Method: SCEP
Entity Name: abc
Total Number: 1
Realm Name PKI realm name. It is configured using the pki realm
(system view) command.
Item Description
OCSP URL OCSP server's URL. It is configured using the ocsp url
command.
Crl Cache Whether the PKI realm is allowed to use the CRL in
cache.
● Enable: The PKI realm is allowed to use the CRL in
cache.
● Disable: The PKI realm is not allowed to use the CRL
in cache.
To configure whether to allow the PKI realm to use the
CRL in cache, run the crl cache command.
RSA Key Name RSA key. It is configured using the rsa local-key-pair
command.
Item Description
Function
The display pki rsa local-key-pair command displays RSA key pairs and public
keys.
Format
display pki rsa local-key-pair { pem | pkcs12 } filename [ password password ]
NOTE
The pem file-name parameter is supported only when the WEAKEA plug-in is installed. For
details about how to install the plug-in, see the plug-in installation guide.
Parameters
filename Specifies the name of the file that The file name must
contains the RSA key pair. already exist.
password Specifies the decryption password for The value must be the
password the RSA key pair file. The value must name of an existing
be the same as the password decryption password of
configured using the pki export rsa- the RSA key pair.
key-pair command.
name key-name Specifies the RSA key pair name. The RSA key pair name
must already exist.
Views
All views
Default Level
3: Management level
Usage Guidelines
This command shows information about the RSA key pair and public key, including
key pair creation time, key pair name, whether the key can be exported, and
public key information.
If key-name is not specified, all RSA key pairs and public keys are displayed. If key-
name is specified, the specified RSA key pair and public key are displayed.
Example
# Display information about all RSA key pairs.
<HUAWEI> display pki rsa local-key-pair public
=====================================================
Time of Key pair created: 17:43:42 2016/4/18
Key Name: abc
Key Index: 0
Key Modules: 2048 bit
Key Exportable: Yes
Key Type: RSA signature key
=====================================================
Key code:
30820109
02820100
C23344E1 B2C2D653 EB134011 9266C6CC 7C18C45F
440AF31F 98B29D4C D436757B F6785BB5 09EFA2A1
09FDBB24 62F1914D 4F10678F 3BE8E3C0 E6F02FC9
AFE2ADDE 98E07D2C A5732288 A5280D2B 6A785F59
A8D19D37 9B80F7EF 1B15FB77 BD9C54D0 01AF270F
90258F65 1A631282 50002C4F 23EF0482 1F62E356
AC700041 B31AB3B4 5C7EB4C0 AFF2E5AF 3DDA4F4E
F5B86502 08BA7AFE 37204C67 7149AE52 1462F25E
16B777E8 E71BCFBE 0E9E02A7 C5FE6120 304BE6C3
CEB2575A EA24EBB6 BA420994 C50F3662 D8F24F25
0D833865 5A127754 2E954F7F 16292DAA AF9D2371
E669ADFF 4EA9FFF8 CE8488D7 344EBCEB AAA74116
B30EF506 C64A726E B1013CB4 E8FA6707
0203
010001
Table 14-107 Description of the display pki rsa local-key-pair command output
Item Description
Time of Key pair created Time when the RSA key pair is created.
14.19.39 email
Function
The email command configures an email address for a PKI entity.
The undo email command cancels the configuration.
By default, no email address is configured for a PKI entity.
Format
email email-address
undo email
Parameters
Parameter Description Value
email-address Specifies the email The value is a string of 1 to 128 case-
address of a PKI sensitive characters, including letters,
entity. numerals, apostrophes ('), equal signs (=),
parentheses (), plus signs (+), minus signs
(-), periods (.), slashes (/), colons (:), at signs
(@), underscores (_), and spaces.
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity contain the identity information of the entity. The
CA identifies a certificate applicant based on identity information provided by the
entity. To facilitate applicant identification, configure an email address for the PKI
entity, which is used as an alias of the entity.
After the email address is configured for a PKI entity, the certificate request packet
sent by the device to the CA server carries this email address. The CA server
verifies every received certificate request packet. For each valid packet, the CA
server generates a digital certificate carrying the email address of the PKI entity.
Example
# Set the email address to test@example.com for a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] email test@example.com
Function
The enrollment self-signed command configures self-signed certificate obtaining
in the PKI realm.
The undo enrollment self-signed command restores the default certificate
obtaining method.
By default, self-signed certificate obtaining in the PKI realm is not configured.
Format
enrollment self-signed
undo enrollment self-signed
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The enrollment self-signed command configures self-signed certificate obtaining
in the PKI realm. The device can use the self-signed certificate obtained from the
PKI realm to support default HTTPS functions. The certificate issuer name is in the
format: device name-Self-Signed-Certificate-ESN.
Prerequisites
The RSA key pair has been configured by using the rsa local-key-pair command.
Precautions
The device generates a self-signed certificate only when the PKI domain is applied
to the service.
The device does not support lifecycle management for self-signed certificates. For
example, self-signed certificates cannot be registered, updated, or revoked on the
device. To ensure security of the device and certificates, it is recommended the
user's certificate be used.
To configure self-signed certificate obtaining, delete the certificate in the PKI
realm.
After the enrollment self-signed command is run, the device will not generate
certificate expiration logs when its self-signed certificate expires.
Example
# Configure self-signed certificate obtaining in the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] enrollment self-signed
Function
The enrollment-request signature message-digest-method command
configures the digest algorithm used to sign certificate enrollment requests.
Format
enrollment-request signature message-digest-method { md5 | sha1 | sha-256 |
sha-384 | sha-512 }
Parameters
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
In SCEP local certificate application mode, after a CA server receives a certificate
enrollment request from a PKI entity, the CA server requests a signature for
authentication, and generates a local certificate only after the authentication is
successful.
For security purposes, SHA2 is recommended. You are not advised to configure
MD5 and SHA1.
Example
# Set the digest algorithm used to sign certificate enrollment requests to sha-384.
<HUAWEI> system-view
[HUAWEI] pki realm e
[HUAWEI-pki-realm-e] enrollment-request signature message-digest-method sha-384
14.19.42 enrollment-url
Function
The enrollment-url command configures the URL of the CA server.
Format
enrollment-url [ esc ] url [ interval minutes ] [ times count ] [ ra ]
undo enrollment-url
Parameters
Parameter Description Value
ra Configures an RA to -
authenticate a PKI
entity's identity
information during local
certificate application. By
default, a CA
authenticates a PKI
entity's identity
information during local
certificate application.
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
The URL refers to the address provided by a CA server for certificate application.
For example, a CA server running Windows Server 2008 uses a URL address in the
The keyword esc supports the entering of URLs that include the question mark (?)
in ASCII code. The URL must be in \x3f format, and 3f is the hexadecimal ASCII
code for the question mark (?). For example, if a user wants to enter http://
***.com?page1, the URL is http://***.com\x3fpage1. If a user wants to enter
http://www.***.com?page1\x3f that includes both a question mark (?) and \x3f,
the URL is http://www.***.com\x3fpage1\\x3f.
Example
# Create a PKI realm test and configure the URL in HTTP mode for the CA server.
<HUAWEI> system-view
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] enrollment-url http://10.13.14.15:8080/certsrv/mscep/mscep.dll ra
14.19.43 entity
Function
The entity command specifies a PKI entity that applies for a certificate.
Format
entity entity-name
undo entity
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a PKI entity requests the local certificate in the PKI realm, the device
encapsulates the configuration of the specified PKI entity into the certificate
request.
Prerequisites
1. The specified PKI entity has been configured by using the pki entity
command.
2. The common name of the PKI entity has been configured using the common-
name command.
Precautions
A PKI realm can be bound to only one PKI entity.
Example
# Bind the PKI entity a to the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki entity a
[HUAWEI-pki-entity-a] common-name test
[HUAWEI-pki-entity-a] quit
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] entity a
14.19.44 fingerprint
Function
The fingerprint command configures the CA certificate fingerprint used in CA
certificate authentication.
The undo fingerprint command deletes the CA certificate fingerprint used in CA
certificate authentication.
By default, no CA certificate fingerprint is configured for CA certificate
authentication.
Format
fingerprint { md5 | sha1 | sha256 } fingerprint
undo fingerprint
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Precautions
The MD5 and SHA1 algorithms have a low security level. SHA256 is
recommended.
Example
# Configure the CA certificate fingerprint used in CA certificate authentication.
<HUAWEI> system-view
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] fingerprint sha256
e71add0744360e91186b828412d279e06dcc15a4ab4bb3d13842820396b526a0
14.19.45 fqdn
Function
The fqdn command configures a fully qualified domain name (FQDN) for a PKI
entity.
The undo fqdn command cancels the configuration.
By default, no FQDN is configured for a PKI entity.
Format
fqdn fqdn-name
undo fqdn
Parameters
Parameter Description Value
fqdn-name Specifies the FQDN The value is a string of 1 to 255 case-sensitive
of a PKI entity. characters, including letters, numerals,
apostrophes ('), equal signs (=), parentheses (),
plus signs (+), minus signs (-), periods (.),
slashes (/), colons (:), at signs (@), underscores
(_), and spaces.
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity contain the identity information of the entity. The
CA identifies a certificate applicant based on identity information provided by the
entity. To facilitate applicant identification, configure an FQDN for the PKI entity,
which is used as an alias of the entity.
An FQDN is the unique identifier of a PKI entity. It consists of a host name and a
domain name, and can be translated into an IP address. A sample of an FQDN is
www.example.com.
After the FQDN is configured for a PKI entity, the certificate request packet sent by
the device to the CA server carries this FQDN. The CA server verifies every received
certificate request packet. For each valid packet, the CA server generates a digital
certificate carrying the FQDN of the PKI entity.
Example
# Set the FQDN to example.com for a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] fqdn example.com
14.19.46 ip-address
Function
The ip-address command configures an IP address for a PKI entity.
The undo ip-address command deletes the configuration.
By default, a PKI entity does not have an IP address.
Format
ip-address { ipv4-address | interface-type interface-number }
undo ip-address
Parameters
Parameter Description Value
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity include the identity information of the PKI entity.
The CA identifies a certificate applicant based on identity information provided by
a PKI entity. To facilitate applicant identification, configure an IP address for the
PKI entity, which is used as an alias of the PKI entity.
After an IP address is configured for a PKI entity, the certificate request packet
sent by the device to the CA server carries this IP address. After receiving the
certificate request packet, the CA server verifies the packet. For each valid packet,
the CA server generates a digital certificate carrying the device IP address.
Example
# Set an IP address 10.1.1.1 for a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] ip-address 10.1.1.1
14.19.47 key-usage
Function
The key-usage command configures the purpose description for a certificate
public key.
Format
key-usage { ike | ssl-client | ssl-server } *
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
To improve certificate security, you can add the usage information of a key to the
certificate request packet sent from the device to the CA server.
After receiving the certificate request packet, the CA server verifies the packet. For
each valid packet, the CA server generates a digital certificate carrying the usage
information of the key.
For example, when setting up an SSL session, the SSL client adds a digital
signature and encrypts the key by using the certificate. After you specify the usage
of a key as ssl-client by using the key-usage ssl-client command, the certificate
generated by the CA server carries the usage information, including a digital
signature and encrypted key. If you use this key to encrypt data, the key will be
invalid.
Example
# Specify the usage of a key as ssl-client.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] key-usage ssl-client
14.19.48 locality
Function
The locality command configures a locality name for a PKI entity.
The undo locality command cancels the configuration.
By default, a PKI entity does not have a locality name.
Format
locality locality-name
undo locality
Parameters
Parameter Description Value
locality-name Specifies the The value is a string of 1 to 32 case-
locality name of a sensitive characters, including letters,
PKI entity. numerals, apostrophes ('), equal signs (=),
parentheses (), plus signs (+), commas (,),
minus signs (-), periods (.), slashes (/),
colons (:), and spaces.
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity contain the identity information of the entity. The
CA identifies a certificate applicant based on identity information provided by the
entity. To facilitate applicant identification, configure a locality name for the PKI
entity, which is used as an alias of the entity.
After the locality name is configured for a PKI entity, the certificate request packet
sent by the device to the CA server carries this locality name. The CA server
verifies every received certificate request packet. For each valid packet, the CA
server generates a digital certificate carrying the locality name of the PKI entity.
Example
# Set the locality name to Beijing for a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] locality Beijing
Function
The ocsp nonce enable command adds a nonce extension to the OCSP request
sent by a PKI entity.
By default, the OCSP request sent by a PKI entity contains a nonce extension.
NOTE
Format
ocsp nonce enable
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
To improve security and reliability of communication between a PKI entity and
OCSP server, this command adds a nonce extension (a random value) to the OSCP
request sent by the PKI entity. If the nonce extension values on the PKI entity and
OCSP server are different, communication fails.
Example
# Add a nonce extension to the OCSP request sent by a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] ocsp nonce enable
Function
The ocsp signature enable command enables the function of signing OCSP
request packets.
The undo ocsp signature enable command disables the function of signing OCSP
request packets.
NOTE
Format
ocsp signature enable
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
When the certificate check mode is set to OCSP, the device sends OCSP request
packets to the OCSP server. To improve access security, run the ocsp signature
enable command to enable the function of signing OCSP request packets.
Example
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] ocsp signature enable
Function
The ocsp url command configures the Uniform Resource Locator (URL) address
for an Online Certificate Status Protocol (OCSP) server.
The undo ocsp url command deletes the URL address of an OCSP server.
NOTE
Format
ocsp url [ esc ] url-address
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
If a certificate to be checked through OCSP does not contain the AIA option, run
this command to configure the OCSP server's URL. If the certificate contains the
AIA option, run the ocsp-url from-ca command to configure the PKI entity to
obtain OSCP server's URL from the AIA option.
The keyword esc supports the entering of URLs that include the question mark (?)
in ASCII code, and 3f is the hexadecimal ASCII code for the question mark (?).
Therefore, the entered URL must be in \x3f format. For example, the URL that an
administrator needs to enter is http://www.***.com\x3fpage1, instead of http://
www.***.com?page1. If the administrator wants to configure http://
www.***.com?page1\x3f that includes both a question mark (?) and \x3f, the
administrator should add an escape character (\) to \x3f and enter http://
www.***.com\x3fpage1\\x3f.
Example
# Set the OCSP server's URL address to http://10.1.1.1.
<HUAWEI> system-view
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] ocsp url http://10.1.1.1
Function
The ocsp-url from-ca command configures a PKI entity to obtain the OCSP
server's URL from the Authority Info Access (AIA) option in a CA certificate.
The undo ocsp-url from-ca command disables a PKI entity from obtaining the
OCSP server's URL from the AIA option in a CA certificate.
By default, a PKI entity does not obtain OCSP server's URL from a CA certificate's
AIA option.
NOTE
Format
ocsp-url from-ca
undo ocsp-url from-ca
Parameters
None
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
If a certificate to be checked through OCSP contains the AIA option, run this
command to configure the PKI entity to obtain OSCP server's URL from the AIA
option. If the certificate does not contain the AIA option, run the ocsp url
command to configure the OCSP server's URL.
Example
# Configure a PKI entity to obtain OCSP server's URL from a CA certificate's AIA
option.
<HUAWEI> system-view
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] ocsp-url from-ca
14.19.53 organization-unit
Function
The organization-unit command configures the department name for a PKI
entity.
The undo organization-unit command restores the default setting.
By default, no department name is configured for a PKI entity.
Format
organization-unit organization-unit-name
undo organization-unit
Parameters
Parameter Description Value
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity contain the identity information of the entity. The
CA identifies a certificate applicant based on identity information provided by the
entity. To facilitate applicant identification, configure a department name for the
PKI entity, which is used as an alias of the entity.
After the department name is configured for a PKI entity, the certificate request
packet sent by the device to the CA server carries this department name. The CA
server verifies every received certificate request packet. For each valid packet, the
CA server generates a digital certificate carrying the department name of the PKI
entity.
Example
# Configure the department name of a PKI entity to Group1,Sale.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] organization-unit Group1,Sale
14.19.54 organization
Function
The organization command configures a PKI entity's organization name.
Format
organization organization-name
undo organization
Parameters
Parameter Description Value
organization- Specifies the The value is a string of 1 to 32 case-
name organization name sensitive characters, including letters,
of a PKI entity. numerals, apostrophes ('), equal signs (=),
parentheses (), plus signs (+), commas (,),
minus signs (-), periods (.), slashes (/),
colons (:), and spaces.
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity contain the identity information of the entity. The
CA identifies a certificate applicant based on identity information provided by the
entity. To facilitate applicant identification, configure an organization name for the
PKI entity, which is used as an alias of the entity.
After the organization name is configured for a PKI entity, the certificate request
packet sent by the device to the CA server carries this organization name. The CA
server verifies every received certificate request packet. For each valid packet, the
CA server generates a digital certificate carrying the organization name of the PKI
entity.
Example
# Set the organization name of a PKI entity to org1.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] organization org1
Function
The password command sets the challenge password used for certificate
application through SCEP, which is also used to revoke a certificate.
The undo password command deletes the challenge password used for certificate
application through SCEP.
By default, no challenge password is configured.
Format
password cipher password
undo password
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
3: Management level
Usage Guidelines
When a PKI entity uses SCEP to apply for a certificate from a CA, the CA needs to
verify the challenge password of the entity. The CA accepts the certificate
application request only when the challenge password is correct. You need to run
this command to set a challenge password for the PKI entity.
Example
# Set the challenge password used to apply for certificate through SCEP.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] password cipher 6AE73F21E6D3571D
Function
The pki cmp certificate-request session command configures a device to send a
certificate request (CR) to the CMPv2 server based on CMP session information.
Format
pki cmp certificate-request session session-name
Parameters
Parameter Description Value
session-name Specifies the name of a CMP The value must be an existing
session. CMP session name.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a device has a certificate issued by a CA, the device can send a CR to apply
for a certificate for another device.
After this command is executed, the system checks whether the configuration in
the CMP session can be used for certificate application. If not, the system displays
an error message. If so, the system initiates the CR according to the configuration.
The obtained certificate is saved in a file on the CF card or Hda1, but not imported
to the memory.
NOTE
The device does not support the message authentication code mode. If the CMP session mode is
set to message authentication code, the system displays an error message.
Prerequisites
A CMP session has been created using the pki cmp session command.
Example
# Send a CR to the CMPv2 server.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] quit
[HUAWEI] pki cmp certificate-request session test
Info: Initializing configuration.
Info: Creatting certification request packet.
Info: Connectting to CMPv2 server.
Info: Sending certification request packet.
Info: Waitting for certification response packet.
Info: Creatting confirm packet.
Info: Connectting to CMPv2 server.
Info: Sending confirm packet.
Info: Waitting for confirm packet from server.
Info: CMPv2 operation finish.
Function
The pki cmp initial-request session command configures a device to send an
initial request (IR) to the CMPv2 server based on CMP session information.
Format
pki cmp initial-request session session-name
Parameters
Parameter Description Value
session-name Specifies the name of a CMP The value must be an existing
session. CMP session name.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the command is executed, the system checks whether the configuration in
the CMP session can be used for certificate application. If not, the system displays
an error message. If so, the system performs an IR according to the configuration.
The obtained certificate is saved in a file on the CF card or Hda1, but not imported
to the memory. If the server issues the CA certificate during the response period,
the CA certificate is also saved in a file.
Prerequisites
A CMP session has been created using the pki cmp session command.
Example
# Send an IR to the CMPv2 server.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] quit
[HUAWEI] pki cmp initial-request session test
Info: Initializing configuration.
Info: Creatting initial request packet.
Info: Connectting to CMPv2 server.
Info: Sending initial request packet.
Info: Waitting for initial response packet.
Info: Creatting confirm packet.
Info: Connectting to CMPv2 server.
Info: Sending confirm packet.
Info: Waitting for confirm packet from server.
Info: CMPv2 operation finish.
Function
The pki cmp keyupdate-request session command configures a device to send a
key update request (KUR) to the CMPv2 server based on CMP session information.
Format
pki cmp keyupdate-request session session-name
Parameters
Parameter Description Value
session-name Specifies the name of a CMP The value must be an existing
session. CMP session name.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When a device has a certificate issued by a CA, the device can send a KUR to
update the certificate.
After the command is executed, the system checks whether the configuration in
the CMP session can be used for certificate update application. If not, the system
displays an error message. If so, the system initiates a KUR according to the
configuration. The updated certificate is saved in a file on the device storage, but
not imported to the memory.
NOTE
The device does not support the message authentication code mode. If the CMP session mode is
set to message authentication code, the system displays an error message.
Prerequisites
A CMP session has been created using the pki cmp session command.
Example
# Send a KUR to the CMPv2 server.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] quit
[HUAWEI] pki cmp keyupdate-request session test
Info: Initializing configuration.
Info: Creatting key update request packet.
Info: Connectting to CMPv2 server.
Error: CMPv2 server connect failed.
Info: CMPv2 operation finish.
Function
The pki cmp session command creates a CMP session and displays the CMP
session view, or displays the view of an existing CMP session.
Format
pki cmp session session-name
Parameters
Parameter Description Value
session-name Specifies the name of a The value is a string of 1 to 63 case-
CMP session. insensitive characters without spaces
or question marks.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Before choosing CMPv2 for certificate application, run the pki cmp session
command to create a CMP session. CMPv2 configuration is performed in the CMP
session view.
Example
# Create the CMP session test and enter the CMP session view.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test]
Function
The pki create-certificate command creates a self-signed certificate.
Format
pki create-certificate self-signed filename file-name
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you run the pki create-certificate command, the system asks you to enter
certificate information, for example, PKI entity parameters, certificate file name,
certificate validity period, and RSA key length.
Precautions
The device does not provide lifecycle management for self-signed certificates. For
example, self-signed certificates cannot be updated or revoked on the device. To
ensure security of the device and certificates, a local certificate is recommended.
Example
# Create a self-signed certificate test.
<HUAWEI> system-view
[HUAWEI] pki create-certificate self-signed filename test
Function
The pki delete replaced-file to recycle-bin enable command moves overwritten
files to the recycle bin.
Format
pki delete replaced-file to recycle-bin enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Overwritten files are permanently deleted by default and cannot be restored. If
you want to restore overwritten files in case that new files are unavailable, run the
pki delete replaced-file to recycle-bin enable command to move these files to
the recycle bin.
The pki delete replaced-file to recycle-bin enable command applies only to the
following scenarios:
● The existing certificates have been overwritten using the pki get-certificate
command.
● The existing certificates and CRL have been overwritten using the pki http
command.
● The existing certificates have been overwritten using the pki cmp initial-
request session command.
● The existing certificates have been overwritten using the pki cmp certificate-
request session command.
● The existing certificates have been overwritten using the pki cmp keyupdate-
request session command.
● The existing CRL has been overwritten using the pki get-crl command.
● The existing certificates have been overwritten using the pki enroll-
certificate command.
● The existing certificates have been overwritten using the pki create-
certificate command.
● The existing certificates have been overwritten using the pki export-
certificate command.
● The existing RSA key pair has been overwritten using the pki export rsa-key-
pair command.
● The existing certificates have been overwritten using the pki import-
certificate peer command.
● The existing CRL has been overwritten using the pki import-crl command.
● The existing RSA key pair and certificates have been overwritten using the pki
import rsa-key-pair command.
Example
# Enable the function of moving overwritten files to the recycle bin.
<HUAWEI> system-view
[HUAWEI] pki delete replaced-file to recycle-bin enable
Function
The pki delete-certificate command deletes a certificate from the memory.
Format
pki delete-certificate { ca | local | ocsp } realm realm-name
NOTE
Parameters
Parameter Description Value
ca Deletes a CA certificate. -
realm realm-name Specifies the name of the PKI realm The value must be
to which a certificate belongs. an existing PKI realm
name.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When the certificate expires or you want to apply for a new certificate, run this
command to delete the CA certificate, OCSP server certificate, or local certificate
from the memory.
Prerequisites
A PKI realm has been created using the pki realm (system view) command.
Precautions
Deleting a certificate may interrupt certificate-related services.
Example
# Delete the local certificate from the memory.
<HUAWEI> system-view
[HUAWEI] pki delete-certificate local realm abc
Function
The pki delete-crl command deletes a CRL from the memory.
Format
pki delete-crl realm realm-name
Parameters
Parameter Description Value
realm realm- Specifies the name of the PKI realm The value must be an
name that the certificate belongs to. existing PKI realm
name.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a CRL expires, run this command to delete a CRL file from the memory. This
command will not delete the CRL files in storage card.
Prerequisites
A PKI realm has been created using the pki realm (system view) command.
Example
# Delete the CRL of PKI realm abc from the memory.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki delete-crl realm abc
Function
The pki enroll-certificate command configures manual certificate enrollment.
Format
pki enroll-certificate realm realm-name [ pkcs10 [ filename filename ] ]
[ password password ]
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Manual certificate application is online or offline.
● Online mode (in-band mode)
The device requests certificates online by communicating with the CA server
through SCEP. Then the device stores the obtained certificates on the flash.
● Offline mode (outband mode)
The device generates a certificate request file. The administrator sends the file
to the CA server using methods such as disks and emails.
Prerequisites
A PKI realm has been created using the pki realm (system view) command.
Precautions
● If pkcs10 is specified, an entity applies to a CA for a certificate in offline
mode. The entity saves the certificate request information in a file in PKCS#10
format and sends the file to the CA in outband mode.
● If pkcs10 is not specified, an entity applies to a CA for a certificate in online
mode.
● In online mode, a PKI entity obtains a CA certificate and imports it to
memory, and then obtains a local certificate and imports it to memory.
● After the enrollment self-signed command is used in the PKI realm, it is not
allowed to use the pki enroll-certificate command to configure manual
certificate enrollment.
Example
# Enroll a certificate for the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki enroll-certificate realm abc
Function
The pki entity command creates a PKI entity and displays the PKI entity view, or
displays the view of an existing PKI entity.
The undo pki entity command deletes a PKI entity.
Format
pki entity entity-name
Parameters
Parameter Description Value
entity-name Specifies the name of a PKI The value is a string of 1 to 64 case-
entity. sensitive characters without spaces.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
A PKI entity refers to the applicant or user of a certificate. A PKI entity is required
when you use PKI features. After a PKI entity is created, you can configure
attributes for it, for example, common name, country code, email address, FQDN,
IP address, geographic area, organization, department, state, and province. These
attributes include identity information of the PKI entity. The identity information
will be added to the subject of a PKI entity.
NOTE
Windows Server 2003 has a low processing performance. For the device to connect to a
Windows Server 2003, the device cannot have too many entities configured or use a large-sized
key pair.
Example
# Configure a PKI entity entity1 and enter the PKI entity view.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1]
Function
The pki export-certificate command exports a certificate to the device storage.
Format
pki export-certificate { ca | local | ocsp } realm realm-name { pem | pkcs12 }
NOTE
Parameters
Parameter Description Value
ca Exports a CA certificate. -
realm realm- Specifies the PKI realm name of a The PKI realm name
name certificate. must already exist.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before using this command, run the display pki certificate command to view
information about certificates on the device.
Prerequisites
A PKI realm has been created using the pki realm (system view) command.
Precautions
When the exported certificate file does not contain a private key, the device does
not encrypt this file.
If the exported certificate is in .pem format, you need to install the WEAKEA plug-
in to export the certificate that contains the private key. For details about how to
install the plug-in, see the plug-in installation guide.
When you export the private key, the system asks you to enter the private key file
name. If the private key file name and the certificate file name are the same, the
private key and certificate are stored in the same file. If they are different, they are
stored in different files.
When you export the private key, the system asks you to enter the private key file
format and set the password. The password will be used when you run the pki
import-certificate command to import this private key.
After the enrollment self-signed command is used in the PKI realm, you cannot
use the pki export-certificate command to export certificates to files.
Example
# Export the local certificate in the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki export-certificate local realm abc pem
Please enter the name of certificate file <length 1-127>: aa
If you only export the certificate, do not export the private key.
You can directly enter empty of private key file.
Please enter the name of private key file <length 1-127>:
Info: Succeeded in exporting the certificate.
Function
The pki export rsa-key-pair command exports the RSA key pair to the flash and
allows the export of the associated certificate.
Format
pki export rsa-key-pair key-name [ and-certificate certificate-name ] { pem file-
name aes | pkcs12 file-name } password password
NOTE
The pem file-name parameter is supported only when the WEAKEA plug-in is installed. For
details about how to install the plug-in, see the plug-in installation guide.
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To transfer or back up an RSA key pair, run this command to generate the PEM or
PKCS12 file carrying this RSA key pair (which may include the certificate) in the
flash.
Before using this command, run the display pki rsa local-key-pair command to
view information about the RSA key pairs on the device.
Prerequisites
The RSA key pair has been created and configured to be exportable using the pki
rsa local-key-pair create command or the RSA key pair has been imported to the
memory using the pki import rsa-key-pair command.
Precautions
The RSA key pair is sensitive information. Delete and destroy the exported RSA key
pair on the device or storage device immediately after you do not need it.
The system software does not contain the 3des and des parameters. To use these
parameters, you need to install the WEAKEA plug-in. However, this algorithm is
less secure. For security purposes, you are advised to use other algorithms.
Example
# Export the RSA key pair key1 in PEM format to the aaa.pem file with the AES
encryption mode after installing the WEAKEA plug-in.
<HUAWEI> system-view
[HUAWEI] pki rsa local-key-pair create key1 exportable
Info: The name of the new key-pair will be: key1
The size of the public key ranges from 512 to 4096.
Input the bits in the modules:2048
Generating key-pairs...
......+++
....................+++
[HUAWEI] pki export rsa-key-pair key1 pem aaa.pem aes password Admin@1234
Warning: Exporting the key pair impose security risks, are you sure you want to
export it? [y/n]:y
Info: Succeeded in exporting the RSA key pair in PEM format.
Function
The pki file-format command sets the format for the saved certificate request,
certificate, and CRL.
By default, the device stores certificate request, certificate, and CRL in PEM format.
Format
pki file-format { der | pem }
Parameters
Parameter Description Value
der Indicates that the format of a certificate request file is DER. -
pem Indicates that the format of a certificate request file is PEM. -
Views
System view
Default Level
2: Configuration level
Usage Guidelines
To change the format for the saved certificate request, certificate, and CRL, for
example, to use the certificate and CRL obtained through CMPv2, SCEP, run the
pki file-format command.
However, the certificate and CRL obtained through HTTP are downloaded directly
and are not saved in the format configured using this command. The created self-
signed certificate or local certificate can only be saved in PEM format.
Example
# Set the format of saved certificate request, certificate, and CRL to DER.
<HUAWEI> system-view
[HUAWEI] pki file-format der
Function
The pki get-certificate command downloads a certificate to the device storage.
Format
pki get-certificate ca realm realm-name
Parameters
Parameter Description Value
ca Specifies a CA or RA certificate to be -
obtained.
realm realm-name Specifies the PKI realm name of a The value must be an
certificate to be obtained. existing PKI realm
name.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When you request a local certificate for the PKI entity through SCEP, run this
command to download a CA certificate to the device storage, and request a local
certificate using the encrypted CA public key.
Prerequisites
A PKI realm has been created using the pki realm (system view) command.
Precautions
Example
# Obtain the CA certificate in the PKI realm abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki get-certificate ca realm abc
Function
The pki get-crl command updates CRL immediately.
Format
pki get-crl realm realm-name
Parameters
Parameter Description Value
realm realm- Specifies the PKI realm The value must be an existing PKI
name name of the CRL. realm name, which is a string of 1
to 52 case-insensitive characters.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The CRL status is checked periodically when it is updated automatically. If the CRL
on the device is likely to expire, configure this command to update CRL
immediately.
After this command is executed, the new CRL replaces the old CRL in the storage,
and is automatically imported to the memory to replace the old one.
Prerequisites
A PKI realm has been created using the pki realm (system view) command.
Example
# Configure CRL immediate update.
<HUAWEI> system-view
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] quit
[HUAWEI] pki get-crl realm test
Format
pki http [ esc ] url-address save-name
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Before you configure a device to use HTTP to download a CA certificate, local
certificate, or CRL, ensure that the flash of the device has enough space to
accommodate the CA certificate, local certificate, or CRL.
The keyword esc supports the entering of URLs that include the question mark (?)
in ASCII code, and 3f is the hexadecimal ASCII code for the question mark (?).
Therefore, the entered URL must be in \x3f format. For example, the URL that an
administrator needs to enter is http://www.***.com\x3fpage1, instead of http://
www.***.com?page1. If the administrator wants to configure http://
www.***.com?page1\x3f that includes both a question mark (?) and \x3f, the
administrator should add an escape character (\) to \x3f and enter http://
www.***.com\x3fpage1\\x3f.
Example
# Configure a device to use HTTP to download a local certificate.
<HUAWEI> system-view
[HUAWEI] pki http http://10.1.1.1/test.cer local.cer
Function
The pki import-certificate command imports a certificate to the device memory.
Format
pki import-certificate { ca | local } realm realm-name { der | pkcs12 | pem }
[ filename filename ] [ replace ] [ no-check-validate ] [ no-check-hash-alg ]
NOTE
Parameters
Parameter Description Value
realm realm- Specifies the PKI realm name of the The PKI realm name
name imported certificate. must already exist.
NOTE
The domain name cannot
contain spaces. Otherwise,
the certificate cannot be
imported.
filename Specifies the name of the imported The file name must
filename certificate. already exist.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After a certificate is saved to the storage, run this command to import the
certificate to the memory for it to take effect.
The device supports the following certificate import modes:
● terminal: Import or copy the certificate file of the peer to the local device.
That is, you can open the PEM certificate file using a text tool and copy the
certificate content to the local device.
● file: The filename parameter is specified to import the certificate file of the
peer.
Multiple certificates can be imported on the device, including the CA certificate,
local certificate, and private key.
NOTE
If you do not know the format of the certificate you want to import, configure each format in
turn and check whether the certificate is successfully imported.
Prerequisites
The PKI realm has been created using the pki realm (system view) command,
and the certificate file already exists on the storage device.
Precautions
If a certificate file contains a key pair file, the pki import-certificate command
imports only the certificate file, but not the key pair file. To import the key pair
file, run the pki import rsa-key-pair command after the pki import-certificate
command, or run the pki import rsa-key-pair command to import the certificate
and key pair files simultaneously.
It is not recommended that multiple local certificates be imported into the same
PKI realm. Otherwise, certificate-related services may use the certificates that do
not match the services, causing services to become unavailable.
When a certificate in pkcs12 format is imported, the PKI system deletes the file
name extension of the original certificate file, adds _localx.cer to generate a new
file name, and saves it to the storage component. Therefore, the name of the
certificate file to be imported should be less than 50 characters, so the total
certificate file name does not exceed 64 characters, and the certificate file cannot
be imported to the storage component.
The device supports the import of digital certificates generated through the RSA
encryption algorithm or SM2 key hash algorithm.
Example
# Import a local certificate to the PKI realm abc in file transfer mode.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki import-certificate local realm abc pem filename local.cer
Info: Succeeded in importing the certificate.
Function
The pki import-certificate peer command imports a certificate of the remote
device to the device memory.
Format
pki import-certificate peer peer-name { der | pem | pkcs12 } filename
[ filename ]
pki import-certificate peer peer-name pkcs12 filename filename password
password
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Where digital envelop authentication is used, configure the public key of the
remote device. The public key can be obtained from the public and private key
management module or certificate of the remote device.
Prerequisites
The certificate file of the remote device must already exist on the storage device.
Precautions
When a certificate in pkcs12 format is imported, the PKI system deletes the file
name extension of the original certificate file, adds _localx.cer to generate a new
file name, and saves it to the storage component. Therefore, the name of the
certificate file to be imported cannot exceed 50 characters. Otherwise, the total
certificate file name will exceed 64 characters, and the certificate file cannot be
imported to the storage component.
You can import a peer certificate generated using the RSA encryption algorithm or
SM2 key hash algorithm to the device.
Example
# Import the certificate aa.pem of the remote device in the file mode.
<HUAWEI> system-view
[HUAWEI] pki import-certificate peer abcd pem file aa.pem
Info: Succeeded in importing the peer certificate.
Function
The pki import-crl command imports the CRL to the memory.
Format
pki import-crl realm realm-name filename file-name
Parameters
Parameter Description Value
realm realm-name Specifies the PKI realm name. The value must be an
existing PKI realm name.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To enable the CRL that is obtained in out-of-band mode or is updated manually,
run this command to import the CRL to the memory.
Prerequisites
A PKI realm has been created using the pki realm (system view) command and
the CRL file has been downloaded using HTTP.
Example
# Import the CRL in the PKI realm to the memory.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki http esc http://www.***.com\x3fpage1\\x3f abc.crl
[HUAWEI] pki import-crl realm abc filename abc.crl
Function
The pki import rsa-key-pair command imports the RSA key pair to the device
memory.
Format
pki import rsa-key-pair key-name [ include-cert realm realm-name ] { pem |
pkcs12 } file-name [ exportable ] [ password password ]
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Run this command to use the RSA key pair generated by other entities. After the
configuration, the imported RSA key pair can be referenced by the PKI module for
operations such as signing.
NOTE
Windows Server 2003 has a low processing performance. For the device to connect to a
Windows Server 2003, the device cannot have too many entities configured or use a large-sized
key pair.
If you do not know the format of the key pair you want to import, configure each format in turn
and check whether the key pair is successfully imported.
Prerequisites
The RSA key pair must already exist on the storage device.
Example
# Import the RSA key pair aaa.pem. In the system, the RSA key pair is named
key-1, is marked exportable and has the decryption password Test!123456.
<HUAWEI> system-view
[HUAWEI] pki import rsa-key-pair key-1 pem aaa.pem exportable password Test!123456
Info: Succeeded in importing the RSA key pair in PEM format.
Function
The pki key enhance enable command enables the PKI module to use the
enhanced key algorithm for encryption and decryption.
The undo pki key enhance enable command disables the PKI module from using
the enhanced key algorithm for encryption and decryption.
By default, the PKI module is enabled to use the enhanced key algorithm for
encryption and decryption.
Format
pki key enhance enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
In V200R020C00SPC300 and later versions, the PKI module uses the enhanced key
algorithm for encryption and decryption by default. The enhanced key algorithm is
incompatible with the key algorithm used by the PKI module in versions earlier
than V200R020C00SPC300. Therefore, before downgrading a device from
V200R020C00SPC300 or a later version to a version earlier than
V200R020C00SPC300, run the undo pki key enhance enable command to disable
this function so that the PKI module uses the same key algorithm before and after
the device downgrade, ensuring service continuity.
Precautions
Example
# Before a device is downgraded from V200R020C00SPC300 or a later version to a
version earlier than V200R020C00SPC300, disable the PKI module from using the
enhanced key algorithm for encryption and decryption so that the key algorithms
before and after the downgrade are the same.
<HUAWEI> system-view
[HUAWEI] undo pki key enhance enable
Warning: The current operation has security risks. You are not advised to perform this operation.
Function
The pki match-rsa-key command configures a device to search for the RSA key
pair associated with a specific certificate.
Format
pki match-rsa-key certificate-filename file-name
Parameters
Parameter Description Value
certificate-filename Specifies the name of a The value must be an
file-name certificate file. existing certificate file
name.
Views
System view
Default Level
3: Management level
Usage Guidelines
Run this command to check the RSA key pair corresponding to a certificate. After
configuration, the system searches for all the local RSA key pairs, compares them
with the specified certificate and outputs the matched RSA key pair name once it
is searched out.
Example
# Configure a device to search for the RSA key pair that matches the certificate
file local.cer.
<HUAWEI> system-view
[HUAWEI] pki match-rsa-key certificate-filename local.cer
Info: The file local.cer contains certificates 1.
Info: Certificate 1 from file local.cer matches RSA key rsa2.key.
Function
The pki ocsp response cache enable command enables a PKI entity to cache
OCSP responses.
The undo pki ocsp response cache enable command disables a PKI entity from
caching OCSP responses.
By default, OCSP response caching is disabled on a PKI entity.
NOTE
Format
pki ocsp response cache enable
undo pki ocsp response cache enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
After you enable a PKI entity to cache OCSP responses, the PKI entity first searches
its cache for the certificate revocation status. If the search fails, the PKI entity
sends a request to the OCSP server. In addition, the PKI entity caches valid OCSP
responses for subsequent query. OCSP responses have a validity period. With OCSP
response caching enabled, a PKI entity refreshes the cached OCSP responses every
minute to clear expired OCSP responses.
Example
# Enable a PKI entity to cache OCSP responses.
<HUAWEI> system-view
[HUAWEI] pki ocsp response cache enable
Function
The pki ocsp response cache number command sets the maximum number of
OCSP responses that can be cached on a PKI entity.
The undo pki ocsp response cache number command restores the default
maximum number of OCSP responses that can be cached on a PKI entity.
By default, the maximum number of OCSP responses that can be cached on a PKI
entity is 2.
NOTE
Format
pki ocsp response cache number number
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
A PKI entity caches valid OCSP responses for subsequent query. If the number of
cached OCSP responses reaches the value specified by number, the PKI entity
stops caching OCSP responses.
Example
# Set the maximum number of OCSP responses that can be cached on a PKI entity
to 3.
<HUAWEI> system-view
[HUAWEI] pki ocsp response cache number 3
Function
The pki ocsp response cache refresh interval command sets the interval at
which the OCSP response cache is refreshed.
The undo pki ocsp response cache refresh interval command restores the
default interval at which a PKI entity refreshes the OCSP response cache.
By default, the interval at which a PKI entity refreshes the OCSP response cache is
5 minutes.
NOTE
Format
pki ocsp response cache refresh interval interval
undo pki ocsp response cache refresh interval
Parameters
Parameter Description Value
interval Specifies the interval at which The value is an integer that ranges
the OCSP response cache is from 1 to 1440, in minutes. The
refreshed. default value is 5.
Views
System view
Default Level
3: Management level
Usage Guidelines
A PKI entity refreshes the OCSP response cache periodically and deletes the OCSP
responses that have expired based on the interval value.
Example
# Set the interval at which the OCSP response cache is refreshed to 30 minutes.
<HUAWEI> system-view
[HUAWEI] pki ocsp response cache refresh interval 30
Function
The pki realm command creates a PKI realm and displays the PKI realm view, or
displays the view of an existing PKI realm.
The undo pki realm command deletes a PKI realm.
By default, the device has a PKI realm named default. This realm can only be
modified but cannot be deleted.
Format
pki realm realm-name
undo pki realm realm-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
A PKI realm is a set of identity information required when a PKI entity enrolls a
certificate.
Precautions
When a certificate is requested using a PKI realm, the system names the certificate
file PKI realm name_local.cer. Therefore, ensure that the name of a created PKI
realm does not exceed 50 characters. Otherwise, the certificate file name may
exceed 64 characters and cannot be saved on a storage device.
The name of a CRL file requested using a PKI realm is suffixed with .crl. Therefore,
ensure that the name of a created PKI realm does not exceed 52 characters.
Otherwise, the CRL file name may exceed 64 characters and cannot be saved on a
storage device.
Example
# Create a PKI realm named abc.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc]
Function
The pki release-certificate peer command releases a certificate of the remote
device.
Format
pki release-certificate peer { name peer-name | all }
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If the specified certificate of the remote device is not required, run the pki
release-certificate peer command to release the certificate of the remote device.
Before using this command, run the display pki peer-certificate command to
view the certificate information of the remote device.
Prerequisites
The pki import-certificate peer command has been used to import the certificate
of the remote device.
Example
# Release the certificate test of the remote device.
<HUAWEI> system-view
[HUAWEI] pki release-certificate peer name test
Info: Succeeded in releasing the peer certificate.
Function
The pki rsa local-key-pair create command creates the specified RSA key pair.
Format
pki rsa local-key-pair create key-name [ modulus modulus-size ] [ exportable ]
Parameters
Parameter Descripti Value
on
exportable Indicates -
that the
new RSA
key pair
can be
exported
from the
device.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When a PKI entity requests a certificate from the CA, the certificate enrollment
request that it sends contains information such as the public key. Run this
command to create the RSA key pair for the certificate request.
NOTE
Windows Server 2003 has a low processing performance. For the device to connect to a
Windows Server 2003, the device cannot have too many entities configured or use a large-sized
key pair.
Precautions
When creating the key pair, the system prompts the user to enter the number of
bits of the RSA key pair. The longer the key pair, the harder it is to crack, and the
more secure but slow the encryption algorithm. It is recommended that the
number of bits of the RSA key pair exceed 2048; otherwise, it has security risks.
The name of an RSA key pair cannot exceed 50 characters. Because when an RSA
key pair is imported, if the certificate is imported at the same time, the PKI system
adds _localx.cer after the name of the RSA key pair to generate a new certificate
file name, and saves it to the storage component. If the name exceeds 50
characters, the total number of characters exceeds 64, and the certificate file
cannot be saved to the storage component.
The RSA key pair referenced by PKI realms cannot be overwritten. They can be
overwritten only after the reference relationship is removed.
If the name of the new RSA key pair is the same as that of a pair on the device,
the system prompts the user to decide whether to overwrite the existing pair.
Example
# Create 2048-bit RSA key pair test.
<HUAWEI> system-view
[HUAWEI] pki rsa local-key-pair create test
Info: The name of the new key-pair will be: test
The size of the public key ranges from 2048 to 4096.
Input the bits in the modules:2048
Generating key-pairs...
......+++
.......+++
Function
The pki rsa local-key-pair destroy command deletes the specified RSA key pair.
Format
pki rsa local-key-pair destroy key-name
Parameters
Parameter Description Value
key-name Specifies the name of the RSA key The value must be the name of
pair to be deleted. an existing key pair.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
It is recommended that you run this command to destroy the specified RSA key
pair if it is leaked, damaged, unused, or lost.
After this command is executed, the specified RSA key pair is deleted from the
active device and the standby device.
Prerequisites
The RSA key pair has been created using the pki rsa local-key-pair create
command or the RSA key pair has been imported to the memory using the pki
import rsa-key-pair command.
Precautions
The RSA key pair referenced by a PKI realm or CMP session cannot be deleted.
They can be deleted only after the reference relationship is removed.
Example
# Delete the RSA key pair test.
<HUAWEI> system-view
[HUAWEI] pki rsa local-key-pair create test
Info: The name of the new key-pair will be: test
The size of the public key ranges from 512 to 4096.
Input the bits in the modules:2048
Generating key-pairs...
.....+++
..........................+++
[HUAWEI] pki rsa local-key-pair destroy test
Warning: The name of the key pair to be deleted is test.
Are you sure you want to delete the key pair? [y/n]:y
Info: Delete RSA key pair success.
Function
The pki set-certificate expire-prewarning command sets the expiration warning
date for the local certificate and the CA certificate in the memory.
By default, the expiration warning date for the local certificate and the CA
certificate in the memory is 90 days.
Format
pki set-certificate expire-prewarning day
Parameters
Parameter Description Value
day Specifies the expiration The value is an integer that ranges from
warning date. 7 to 180. By default, the value is 90.
Views
System view
Default Level
3: Management level
Usage Guidelines
After this command is executed, you will be prompted the expiration of a
certificate in advance. If the system detects that a certificate in the memory is to
expire in less than day, the device sends an expiration warning to the user.
Example
Set the expiration warning date for the local certificate and the CA certificate in
the memory as 30 days.
<HUAWEI> system-view
[HUAWEI] pki set-certificate expire-prewarning 30
Function
The pki validate ocsp-server-certificate enable command enables the function
that uses the OCSP server certificate to verify OCSP server packets.
By default, the function that uses the OCSP server certificate to verify OCSP server
packets is enabled.
Format
pki validate ocsp-server-certificate enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
For security purposes, you are advised to enable the function that uses the OCSP
server certificate to verify OCSP server packets. If OCSP server packets fail the
verification, the device discards these packets.
Precautions
If the imported OCSP server certificate is not the correct one, OCSP server packets
fail the verification, causing the local certificate to become unavailable. To prevent
this problem, import the correct OCSP server certificate. If no OCSP server
certificate can be obtained, run the undo pki validate ocsp-server-certificate
enable command to disable the function that uses the OCSP server certificate to
verify OCSP server packets.
Example
# Enable the function that uses the OCSP server certificate to verify OCSP server
packets.
<HUAWEI> system-view
[HUAWEI] pki validate ocsp-server-certificate enable
Function
The pki validate-certificate command allows you to verify the validity of a CA
certificate or a local certificate.
Format
pki validate-certificate { ca | local } realm realm-name
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When an end entity verifies a peer certificate, it checks the status of the peer
certificate. For example, the end entity checks whether the peer certificate has
expired and whether the certificate is in a CRL.
To verify the validity of a CA certificate or a local certificate, run the pki validate-
certificate command.
Prerequisites
A PKI realm has been configured using the pki realm (system view) command.
Precautions
The pki validate-certificate ca command allows you to verify only the root CA
certificate, but not subordinate CA certificates. When multiple CA certificates are
imported on a device, you can use only the pki validate-certificate local
command to verify the validity of subordinate certificates.
Example
# Configure the device to check validity of the local certificate using CRL.
<HUAWEI> system-view
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] certificate-check crl
[HUAWEI-pki-realm-abc] quit
[HUAWEI] pki validate-certificate local realm abc
Function
The reset pki cmp statistics command clears the statistics on CMP sessions.
Format
reset pki cmp statistics [ session session-name ]
Parameters
Parameter Description Value
session session- Specifies the name of a CMP The value must be an
name session. existing CMP session name.
Views
User view
Default Level
2: Configuration level
Usage Guidelines
If a CMP session is specified, this command will clear the statistics of the session.
If no CMP session is specified, this command will clear the statistics of all sessions.
Example
# Clear statistics on the CMP session test.
<HUAWEI> reset pki cmp statistics session test
Function
The reset pki ocsp response cache command resets an OCSP response cache.
NOTE
Format
reset pki ocsp response cache
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
The PKI entity caches valid OCSP responses for future searches. If the number of
cached OCSP responses reaches the maximum value, no more OCSP responses can
be cached. To ensure that the latest OCSP responses can be cached, you can run
this command to clear the OCSP response cache first.
Example
# Reset an OCSP response cache.
<HUAWEI> reset pki ocsp response cache
Function
The reset pki ocsp server down-information command clears Down state
information of the OCSP server recorded on the device.
NOTE
Format
reset pki ocsp server down-information [ url [ esc ] url-addr ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
There is a mechanism to determine whether the OCSP server is Down. When the
OCSP server corresponding to a URL cannot be accessed, the server status is set to
Down. In this case, the device will not send OCSP requests to the URL within 10
minutes. However, this mechanism may falsely set the state of a transiently
disconnected server to Down. Using this command, the user can manually clear
the falsely reported Down state of the OCSP server so that the device can send
OCSP requests to the server.
The keyword esc supports the entering of URLs that include the question mark (?)
in ASCII code. The URL must be in \x3f format, and 3f is the hexadecimal ASCII
code for the question mark (?). For example, if a user wants to enter http://
***.com?page1, the URL is http://***.com\x3fpage1. If a user wants to enter
http://www.***.com?page1\x3f that includes both a question mark (?) and \x3f,
the URL is http://www.***.com\x3fpage1\\x3f.
Example
# Clear the OCSP server Down information of the specified URL.
<HUAWEI> reset pki ocsp server down-information
Function
The rsa local-key-pair command configures the RSA key pair used to request a
certificate using SCEP or in offline mode.
The undo rsa local-key-pair command deletes the RSA key pair used to request a
certificate using SCEP or in offline mode.
By default, the system does not configure the RSA key pair used to request a
certificate using SCEP or in offline mode.
Format
rsa local-key-pair key-name
Parameters
Parameter Description Value
key-name Specifies the name of the RSA The value must be an existing
key pair. RSA key pair name.
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The PKI entity that requests a certificate from the CA using SCEP or in offline
PKCS#10 mode must contain a public key. Run this command to configure the
RSA key pair.
Prerequisites
The RSA key pair for certificate application has been created using the pki rsa
local-key-pair create command or the RSA key pair has been imported to the
memory using the pki import rsa-key-pair command.
Precautions
Example
# Configure the RSA key pair that is referenced by the PKI realm test.
<HUAWEI> system-view
[HUAWEI] pki rsa local-key-pair create test
Info: The name of the new key-pair will be: test
The size of the public key ranges from 2048 to 4096.
Input the bits in the modules:2048
Generating key-pairs...
.........................+++
................................................................................
........+++
[HUAWEI] pki realm test
[HUAWEI-pki-realm-test] rsa local-key-pair test
14.19.92 serial-number
Function
The serial-number command adds the serial number of a device to a PKI entity.
Format
serial-number
undo serial-number
Parameters
None
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity include the identity information of the PKI entity.
The CA identifies a certificate applicant based on identity information provided by
a PKI entity. To further identify the applicant, add the serial number of the device
to the PKI entity.
After the serial number of the device is added to a PKI entity, the certificate
request packet sent by the device to the CA server carries this serial number. After
receiving the certificate request packet, the CA server verifies the packet. For each
valid packet, the CA server generates a digital certificate carrying the device serial
number.
Example
# Add the serial number of the device to a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] serial-number
14.19.93 source
Function
The source command configures the source address used in TCP connection setup.
The undo source command restores the default setting.
By default, the device uses an outbound interface's IP address as the source IP
address used in TCP connection setup.
Format
source { interface interface-type interface-number | ip-address }
undo source
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If the device needs to establish a TCP connection with an SCEP or OCSP server, you
must run the source command to specify the source IP address used in TCP
connection setup.
In the multi-output scenario, if the interfaces for sending and receiving a TCP
packet are different, the IP address in the received TCP packet is different from the
IP address of the receiving interface. Then the TCP packet is dropped, and the TCP
connection is torn down. In this situation, you can run this command to specify
the loopback interface address.
Precautions
If the source interface used in TCP connection setup has been specified, the source
interface must be a Layer 3 interface with an IP address configured.
Example
# Configure the IP address of VLANIF 100 as the source address used in TCP
connection setup.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ip address 10.136.2.25 24
[HUAWEI-Vlanif100] quit
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] source interface vlanif 100
Function
The state command configures a state or province name for a PKI entity.
Format
state state-name
undo state
Parameters
Views
PKI entity view
Default Level
2: Configuration level
Usage Guidelines
The parameters of a PKI entity contain the identity information of the entity. The
CA identifies a certificate applicant based on identity information provided by the
entity. To facilitate applicant identification, configure a state or province name for
a PKI entity.
After the state or province name is configured for a PKI entity, the certificate
request packet sent by the device to the CA server contains this province name.
The CA server verifies every received certificate request packet. For each valid
packet, the CA server generates a digital certificate carrying the state or provision
name of the PKI entity.
Example
# Configure the province name to Jiangsu for a PKI entity.
<HUAWEI> system-view
[HUAWEI] pki entity entity1
[HUAWEI-pki-entity-entity1] state Jiangsu
Function
The undo pki cmp poll-request session command cancels CMP polling requests.
Format
undo pki cmp poll-request session session-name
Parameters
Parameter Description Value
session-name Specifies the name of a CMP The value must be an existing
session. CMP session name.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If the server cannot deliver the results immediately after the client initiates
certificate-related requests, the server requires the client to send the requests in
polling mode until the server deliver the final result. The process duration varies
with the actual situation. To cancel the process, run the command. Then the
certificate-related request is also canceled.
Prerequisites
A CMP session has been created using the pki cmp session command.
Example
# Cancel CMP polling requests.
<HUAWEI> system-view
[HUAWEI] pki cmp session test
[HUAWEI-pki-cmp-session-test] quit
[HUAWEI] undo pki cmp poll-request session test
14.19.96 vpn-instance
Function
The vpn-instance command adds a PKI realm to a specified VPN.
The undo vpn-instance command unbinds a PKI realm from a specified VPN.
By default, a PKI realm is not added to any VPN.
Format
vpn-instance vpn-instance-name
undo vpn-instance
Parameters
Parameter Description Value
Views
PKI realm view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To obtain and verify certificates, the device needs to communicate with the CA or
SCEP server. When the CA or SECP server is in a VPN, add the PKI realm to the
specified VPN.
Prerequisites
1. A VPN instance has been created using the ip vpn-instance command.
2. The RD has been configured using the route-distinguisher command.
Example
# Add a PKI realm to the VPN named vrf1.
<HUAWEI> system-view
[HUAWEI] ip vpn-instance vrf1
[HUAWEI-vpn-instance-vrf1] route-distinguisher 22:1
[HUAWEI-vpn-instance-vrf1-af-ipv4] quit
[HUAWEI-vpn-instance-vrf1] quit
[HUAWEI] pki realm abc
[HUAWEI-pki-realm-abc] vpn-instance vrf1
14.20.2 cpu-overload-control
Function
The cpu-overload-control command configures the CPU usage thresholds and
adjustment factor of the leak rate.
By default, the level-1 CPU usage threshold is 95%, the level-2 CPU usage
threshold is 98%, and the adjustment factor of the leak rate is 10.
Format
cpu-overload-control { threshold1 threshold1–value | threshold2 threshold2–
value | adjustfactor adjustfactor–value } * slot slot-id
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Only when the CPU usage reaches the OLC start threshold (the same as the
level-1 CPU usage threshold), the OLC function is started to lower the leak rate so
that the rate of packets sent to the CPU is lowered. When the CPU usage reaches
the level-2 CPU usage threshold, the system lowers the leak rate twice as fast.
When the CPU usage falls below the OLC stop threshold (the level-1 CPU usage
threshold minus 20%), the OLC function is stopped. The adjustment factor
specifies the frequency at which the leak rate is adjusted. The smaller the
adjustment factor, the faster the adjustment frequency, and vice versa. A smaller
adjustment factor will allow the system to adjust more quickly to service changes
but may lead t o flapping of the leak rate. The default leak rate is recommended.
Example
# Set the level-1 CPU usage threshold to 90%, level-2 CPU usage threshold to
95%, and adjustment factor of the leak rate to 15 in slot 0.
<HUAWEI> system-view
[HUAWEI] cpu-overload-control threshold1 90 threshold2 95 adjustfactor 15 slot 0
Format
cpu-overload-control alarm disable
undo cpu-overload-control alarm disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
By default, the OLC alarm function is enabled. When the CPU usage is greater
than the OLC start threshold or lower than the OLC stop threshold, an alarm is
generated to notify users of the CPU running status and the status of the OLC
function.
When the service traffic of monitored protocols or tasks on the live network is
light and the CPU usage remains stably low, you can disable the OLC alarm
function.
Example
# Enable the OLC alarm function.
<HUAWEI> system-view
[HUAWEI] undo cpu-overload-control alarm disable
Format
cpu-overload-control { packet-type packet-type | task task-name } bucket-
weight bucket-weight-value slot slot-id
undo cpu-overload-control { packet-type packet-type | task task-name }
bucket-weight bucket-weight-value slot slot-id
Parameters
Parameter Description Value
whitelisted protocol
packets)
● cos-0: packet with
priority 0 (excluding
whitelisted protocol
packets)
NOTE
S1720GF, S1720GW-E,
S1720GFR-P, S1720GWR-E,
S2720-EI, S5720I-SI,
S5720-LI, S1730S-H,
S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L,
S5735S-L, S5735S-L1,
S5735S-L-M, S5720S-LI,
S5735-S, S500, S5735S-S,
S5735-S-I, S5735S-H, and
S5736-S do not support
arp-miss parameter.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Each protocol or task for which OLC is enabled is associated with a bottom leaky
bucket. By default, the device assigns each leaky bucket a weight based on
priorities of the monitored protocols and tasks. The weight of a leaky bucket
determines its weighted water level (that is, the number of tokens that it can
apply for). You can run this command to configure weights of the leaky buckets
for monitored protocols and tasks based on service requirements.
Example
# Set the weight of the leaky bucket for the DHCP protocol to 500 in slot 0.
<HUAWEI> system-view
[HUAWEI] cpu-overload-control packet-type dhcp bucket-weight 500 slot 0
Format
cpu-overload-control disable slot slot-id
undo cpu-overload-control disable slot slot-id
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value must be set according to the device
configuration.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
On a complex live network, the CPU may be overloaded if a large amount of
service traffic is sent to the CPU or the CPU is attacked by unauthorized services.
CPU overload will affect both the device's performance and its ability to process
services.
OLC monitors certain CPU-bound protocol packets and tasks. According to the
priorities of different services, OLC rate-limits the monitored protocol packets and
tasks if the CPU usage exceeds a certain threshold. In this way, OLC not only
reduces consumption of CPU resources but also prevents CPU overload from
affecting normal processing of other services.
When the service traffic of monitored protocols or tasks on the live network is
light and the CPU usage remains stably low, you can disable the OLC function.
Precautions
The OLC function configured for a protocol or task takes effect only after the OLC
function is enabled.
Example
# Enable the OLC function in slot 0.
<HUAWEI> system-view
[HUAWEI] undo cpu-overload-control disable slot 0
Format
cpu-overload-control packet-type packet-type &<1-20> disable slot slot-id
undo cpu-overload-control packet-type packet-type &<1-20> disable slot slot-id
Parameters
Parameter Description Value
whitelisted protocol
packets)
● cos-0: packet with
priority 0 (excluding
whitelisted protocol
packets)
NOTE
S1720GF, S1720GW-E,
S1720GFR-P, S1720GWR-E,
S2720-EI, S5720I-SI,
S5720-LI, S1730S-H,
S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L,
S5735S-L, S5735S-L1,
S5735S-L-M, S5720S-LI,
S5735-S, S500, S5735S-S,
S5735-S-I, S5735S-H, and
S5736-S do not support
arp-miss parameter.
One or more of the
preceding protocol types
can be selected.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, the OLC function is enabled for all monitored protocols to prevent CPU
overload caused by a large number of CPU-bound packets of a certain protocol or
attacks from unauthorized services. When the service traffic of a monitored
protocol on the live network is light, you can disable the OLC function for the
protocol.
Precautions
The OLC function configured for a protocol takes effect only after the OLC
function is enabled.
Example
# Enable the OLC function for the DHCP protocol in slot 0.
<HUAWEI> system-view
[HUAWEI] undo cpu-overload-control packet-type dhcp disable slot 0
Format
cpu-overload-control task task-name &<1-2> enable slot slot-id
undo cpu-overload-control task task-name &<1-2> enable slot slot-id
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
By default, the OLC function is enabled for the ACL and ARPA tasks to prevent
CPU overload caused by a large amount of CPU-bound service traffic or service
attacks. When the service traffic of the ACL or ARPA task is light, you can disable
the OLC function for the task.
Precautions
The OLC function configured for a task takes effect only after the OLC function is
enabled.
Example
# Enable the OLC function for the ACL task in slot 0.
<HUAWEI> system-view
[HUAWEI] cpu-overload-control task acl enable slot 0
Format
display cpu-overload-control configuration [ packet-type packet-type | task
task-name ] slot slot-id
Parameters
Parameter Description Value
whitelisted protocol
packets)
● cos-0: packet with
priority 0 (excluding
whitelisted protocol
packets)
NOTE
S1720GF, S1720GW-E,
S1720GFR-P, S1720GWR-E,
S2720-EI, S5720I-SI,
S5720-LI, S1730S-H,
S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L,
S5735S-L, S5735S-L1,
S5735S-L-M, S5720S-LI,
S5735-S, S500, S5735S-S,
S5735-S-I, S5735S-H, and
S5736-S do not support
arp-miss parameter.
If this parameter is not
specified, the OLC
configuration in the
specified slot is
displayed.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can use this command to view the OLC configuration of a specified protocol,
task, or slot, including the weight of the leaky bucket, OLC function status, CPU
usage thresholds, and adjustment factor of the leak rate.
Example
# Display the OLC configuration of the DHCP protocol in slot 0.
<HUAWEI> display cpu-overload-control configuration packet-type dhcp slot 0
----------------------------------
Protocol Weight Enable
----------------------------------
dhcp 290 Y
----------------------------------
Weight Weight of the leaky bucket for the protocol. For details,
see cpu-overload-control bucket-weight.
Weight Weight of the leaky bucket for the task. For details, see
cpu-overload-control bucket-weight.
Item Description
Item Description
Low Threshold Level-1 CPU usage threshold. For details, see cpu-
overload-control.
High Threshold Level-2 CPU usage threshold. For details, see cpu-
overload-control.
Ajustfactor Adjustment factor of the leak rate. For details, see cpu-
overload-control.
Weight Weight of the leaky bucket for the protocol or task. For
details, see cpu-overload-control bucket-weight.
Format
display cpu-overload-control statistics [ packet-type packet-type | task task-
name ] slot slot-id
Parameters
Parameter Description Value
whitelisted protocol
packets)
● cos-0: packet with
priority 0 (excluding
whitelisted protocol
packets)
NOTE
S1720GF, S1720GW-E,
S1720GFR-P, S1720GWR-E,
S2720-EI, S5720I-SI,
S5720-LI, S1730S-H,
S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L,
S5735S-L, S5735S-L1,
S5735S-L-M, S5720S-LI,
S5735-S, S500, S5735S-S,
S5735-S-I, S5735S-H, and
S5736-S do not support
arp-miss parameter.
If this parameter is not
specified, OLC statistics
in the specified slot are
displayed.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to view OLC statistics of a specified protocol, task, or
slot, including the number of protocol packets leaving or dropped by the leaky
bucket, total running time of a task, and delay in processing a task.
Example
# Display OLC statistics of the DHCP protocol in slot 0.
<HUAWEI> display cpu-overload-control statistics packet-type dhcp slot 0
--------------------------------------------------------------------------------
Protocol Total pass Total drop Average pass Average drop
(packet) (packet) (packet) (packet)
--------------------------------------------------------------------------------
dhcp 0 0 0 0
--------------------------------------------------------------------------------
Format
reset cpu-overload-control statistics [ packet-type packet-type | task task-
name ] slot slot-id
Parameters
Parameter Description Value
whitelisted protocol
packets)
● cos-0: packet with
priority 0 (excluding
whitelisted protocol
packets)
NOTE
S1720GF, S1720GW-E,
S1720GFR-P, S1720GWR-E,
S2720-EI, S5720I-SI,
S5720-LI, S1730S-H,
S2730S-S, S5735-L-I,
S5735-L1,S300, S5735-L,
S5735S-L, S5735S-L1,
S5735S-L-M, S5720S-LI,
S5735-S, S500, S5735S-S,
S5735-S-I, S5735S-H, and
S5736-S do not support
arp-miss parameter.
If this parameter is not
specified, OLC statistics
in the specified slot are
cleared.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Precautions
The deleted OLC statistics cannot be restored. Therefore, exercise caution when
running this command.
Example
# Clear OLC statistics of the DHCP protocol in slot 0.
<HUAWEI> reset cpu-overload-control statistics packet-type dhcp slot 0
Function
The defence engine enable command enables the IAE.
Format
defence engine enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
If ECA needs to be configured, you can run the defence engine enable command
to enable the IAE.
Example
# Enable the IAE.
<HUAWEI> system-view
[HUAWEI] defence engine enable
Format
decoding uri-cache enable
decoding uri-cache disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If no threat is detected from the corresponding session traffic after the URI cache
function is enabled, the system will not inspect the session traffic with the same
URI in a period of time. If all traffic must be inspected, disable the URI cache
function.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the URI cache function.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] decoding uri-cache enable
Format
display decoding statistics [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
You can run this command to view statistics about the decoding function,
including the event statistics, traffic statistics, and file statistics of each
application.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display IPS statistics.
<HUAWEI> display decoding statistics
Decoding statistic on slot 0 cpu 0 :
------------------------------------------------------------------------------
Decoding Statistic Table
------------------------------------------------------------------------------
Traffic statistic:
------------------------------------------------------------------------------
Total Traffic : 0
----------------------------------------------------------------------------
Application Traffic
----------------------------------------------------------------------------
HTTP 0
FTP 0
SMTP 0
POP3 0
NFS 0
SMB 0
IMAP 0
OTHER 0
------------------------------------------------------------------------------
File statistic:
------------------------------------------------------------------------------
Total File : 0
----------------------------------------------------------------------------
Application File
----------------------------------------------------------------------------
---- More ----
Format
display engine information
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
The display engine information command displays the status of IAE and the
version of the application identification signature database.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display the status of IAE and the version of the application identification
signature database.
<HUAWEI> display engine information
==============================================================================
Engine on CPU 0 in slot 0:
==============================================================================
Engine Status : Ready
Compile Status : Commit Succeeded
SA Signature Database Version : 2018041202
------------------------------------------------------------------------------
Item Description
Item Description
Format
display engine session statistics [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
The session statistics of the specified virtual system or all systems can be viewed
only in the root system. In a virtual system, you can view only the session statistics
of the virtual system.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Displays session statistics for the engine.
<HUAWEI> display engine session statistics
Engine Session Statistic Information of Session statistics for the engines used
All Threads by all threads
Total Current Buffered TCP Segments Total number of cached TCP segments
Total Current Free TCP Segments Total number of TCP segments that
can be cached
Engine Session Statistic Information of Session statistics for the engine used
Each Thread by each thread
Format
display engine session statistics app-type [ slot slot-id ]
display engine session statistics interface [ interface-type interface-number ]
app-type
Parameters
Parameter Description Value
slot slot-id Displays application statistics about the The value varies
ECA sessions in the specified slot. If the depending on the
slot ID is not specified, application device
statistics about ECA sessions in all slots configuration.
are displayed.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
To check application statistics about an ECA session and know about service traffic
distribution, you can run the display engine session statistics app-type
command.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
ECA session statistics may be inaccurate because collection of these statistics
depends on NetStream packet statistics, which have no impact on the ECA
function.
Example
# Display application statistics about the ECA sessions on GE0/0/1.
<HUAWEI> display engine session statistics interface gigabitethernet 0/0/1 app-type
GigabitEthernet0/0/1
------------------------------------------------------------------------------------
App-Name Connect-Packet Connect-Byte Percent
------------------------------------------------------------------------------------
Telnet 8933 750614 80.05%
HTTPS 547 182102 19.42%
HTTP 51 4923 0.52%
------------------------------------------------------------------------------------
Total:3
Item Description
Function
The display engine session statistics interface command displays ECA session
flow statistics on a specified interface.
Format
display engine session statistics interface interface-type interface-number flow
{ by-time | by-packet }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
To check ECA session flow statistics on a specified interface and know about traffic
distribution, run the display engine session statistics interface command.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display ECA session flow statistics on GE0/0/1 in descending order of packet
quantity.
<HUAWEI> display engine session statistics interface gigabitethernet 0/0/1 flow by-packet
------------------------------------------------------------------------------------------------------------------------------
--
Source-ip Destination-ip Sport Dport Connect-Packet Connect-Byte Percent App-name
------------------------------------------------------------------------------------------------------------------------------
--
192.168.240.32 192.168.40.2 4671 443 166 101803 21.58% HTTPS
192.168.240.32 192.168.40.2 4679 443 69 19140 4.05% HTTPS
192.168.240.32 192.168.40.2 4680 443 65 15281 3.24% HTTPS
192.168.240.32 192.168.40.2 4682 443 59 10532 2.23% HTTPS
192.168.240.32 192.168.40.2 4681 443 57 8774 1.86% HTTPS
192.168.240.32 192.168.40.2 4683 443 56 8710 1.84% HTTPS
192.168.240.32 192.168.40.2 4668 80 51 4923 1.04% HTTP
192.168.40.84 192.168.40.2 54657 23 50 4180 0.88% Telnet
192.168.40.84 192.168.40.2 54001 23 48 4052 0.85% Telnet
192.168.40.84 192.168.40.2 50167 23 48 4052 0.85% Telnet
192.168.40.84 192.168.40.2 52973 23 48 4052 0.85% Telnet
192.168.40.84 192.168.40.2 52507 23 48 4052 0.85% Telnet
192.168.40.2 192.168.240.188 23 39069 29 2379 0.50% Telnet
192.168.40.84 192.168.40.2 52795 23 26 2154 0.45% Telnet
192.168.40.84 192.168.40.2 51293 23 26 2154 0.45% Telnet
192.168.40.84 192.168.40.2 53587 23 26 2154 0.45% Telnet
192.168.40.84 192.168.40.2 49800 23 26 2154 0.45% Telnet
192.168.40.84 192.168.40.2 50838 23 26 2154 0.45% Telnet
192.168.40.2 192.168.40.84 23 52504 26 2154 0.45% Telnet
192.168.40.84 192.168.40.2 52156 23 26 2154 0.45% Telnet
192.168.40.84 192.168.40.2 54008 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 53553 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 49613 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 52435 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 52162 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 54290 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 53615 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 52442 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 50025 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 55381 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 51757 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 54892 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 55012 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 53311 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 52677 23 25 2090 0.44% Telnet
192.168.40.84 192.168.40.2 54313 23 25 2090 0.44% Telnet
------------------------------------------------------------------------------------------------------------------------------
--
Total:150
Item Description
Item Description
Format
display engine session table [ source-ip source-ip-address | source-port source-
port-number | destination-ip destination-ip-address | destination-port
destination-port-number | protocol { tcp | udp } | [ application application-
name ] ]* [ verbose ] [ slot slot-id cpu cpu-id [ thread thread-id ] ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
In a virtual system, you can view only the session statistics of the virtual system.
The session information of the specified virtual system or all systems can be
viewed only in the root system.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display details about the IPv4 session table of an engine.
<HUAWEI> display engine session table verbose
Engine session table on slot 0 cpu 0 :
------------------------------------------------------------------------------
VSys:0 Vpn:0 Thread:0 UDP 10.0.0.1:80-->10.0.0.2:132 ttl:20 left-time:132 app: (45,QQ)
------------------------------------------------------------------------------
Table 14-117 Description of the display engine session table verbose command
output
Item Description
Engine session table on slot 0 cpu 0 Engine session table on a specified slot
and CPU
Thread Thread ID
UDP UDP
TCP TCP
Format
display engine statistics [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display engine statistics.
<HUAWEI> display engine statistics
Engine statistic on slot 0 cpu 0 :
------------------------------------------------------------------------------
Engine Statistic Table
------------------------------------------------------------------------------
Event statistic:
------------------------------------------------------------------------------
Total Alert Events : 0
Total Block Events : 0
----------------------------------------------------------------------------
Application Alert Events Block Events
----------------------------------------------------------------------------
------------------------------------------------------------------------------
Traffic statistic:
------------------------------------------------------------------------------
Total Traffic : 0
----------------------------------------------------------------------------
Application Traffic
----------------------------------------------------------------------------
DECODING 0
------------------------------------------------------------------------------
File statistic:
------------------------------------------------------------------------------
Total File : 0
----------------------------------------------------------------------------
Application File
----------------------------------------------------------------------------
DECODING 0
------------------------------------------------------------------------------
Item Description
Item Description
Format
display flow-probe metadata-collect information
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display configuration information about the function of metadata collection
through the ECA flow probe.
Item Description
Metadata Cache Max(Current number) Max cache of the ECA flow probe
metadata(Current number)
Function
The display flow-probe metadata-collect statistics command displays statistics
about the function of metadata collection through the ECA flow probe.
Format
display flow-probe metadata-collect statistics [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display statistics about the function of metadata collection through the ECA
flow probe.
Item Description
Engine UDP Send To Fpath Success Number of times that UDP packets are
successfully sent.
Engine UDP Send To Fpath Fail Number of times that UDP packets fail
to be sent.
Function
The display fragment-reassemble configuration command displays the global
fragment reassembly configuration.
Format
display fragment-reassemble configuration [ slot slot-id cpu cpu-id ]
Parameters
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display the global fragment reassembly configuration.
<HUAWEI> display fragment-reassemble configuration
Fragment Reassembly statistics on slot 0 cpu 0 :
------------------------------------------------------------------------------
Fragment Reassembly Configuration:
------------------------------------------------------------
enable : on
overflow-mode : forward
overlap-mode : consistency
time-out(s) :5
packet-cache(packets) : 255
total-cache(packets) : 1000
defense-check : off
pass-through : off
------------------------------------------------------------
Item Description
Item Description
Format
display fragment-reassemble session table [ source-ip source-ip-address |
destination-ip destination-ip-address ] * [ slot slot-id cpu cpu-id ]
display fragment-reassemble ipv6 session table [ source-ip source-ipv6-address
| destination-ip destination-ipv6-address ] * [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display the IPv4 fragmented packet-specific session table.
<HUAWEI> display fragment-reassemble session table
Fragment Reassembly statistics on slot 0 cpu 0 :
----------------------------------------------------------------------------------------------------------------
VSys:0 Vpn:0 10.1.1.1-->1.1.1.1(363) ttl:5 left-time:4 frag-num:32 flags:(first 1,last 0,overflow 0,result 0)
VSys:0 Vpn:0 10.1.1.1-->1.1.1.1(363) ttl:5 left-time:3 frag-num:32 flags:(first 1,last 0,overflow 0,result 0)
----------------------------------------------------------------------------------------------------------------
Item Description
Function
The display fragment-reassemble statistics command displays statistics on the
fragment reassembly of IP packets.
Format
display fragment-reassemble [ ipv6 ] statistics [ slot slot-id cpu cpu-id ]
Parameters
slot slot-id Specifies a slot ID. The value range depends on the
device configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the
device configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display statistics on the fragment reassembly of IP packets.
<HUAWEI> display fragment-reassemble statistics
Fragment Reassembly statistics on slot 0 cpu 0 :
------------------------------------------------------------------------------
Fragment Reassembly Statistics:
------------------------------------------------------------
Total fragments :0
Total cached fragments :0
Total error packets :0
Total discarded fragments : 0
Complete overlap processing : 0
Partial overlap processing : 0
Total current sessions :0
Total free sessions : 1000
------------------------------------------------------------
Item Description
Format
display stream-reassemble configuration [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display the global TCP stream reassembly configuration.
<HUAWEI> display stream-reassemble configuration
Stream reassemble configuration on slot 0 cpu 0 :
------------------------------------------------------------------------------
Stream Reassembly Configuration:
------------------------------------------------------------
enable : on
overflow-mode : discard
overlap-mode : overwrite
session-cache(KB) : 16
total-cache(packets) : 1000
timestamp-check : true
tcp-option check : true
defense-check : on
session-timeout(s) : 60
enhanced-mode : on
------------------------------------------------------------
Item Description
Format
display update configuration
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display the update configuration of the application identification signature
database.
<HUAWEI> display update configuration
Update Configuration Information:
------------------------------------------------------------
Update Server : sec.huawei.com
Update Port : 443
Proxy State : Disable
Proxy Server :-
Proxy Port :-
Proxy User :-
Proxy Password :-
SA-SDB:
Application Confirmation : Disable
Schedule Update : Enable
Schedule Update Frequency : Daily
Schedule Update Time : 04:16
------------------------------------------------------------
Proxy State Whether the proxy server is enabled. The value can be:
● Enable: The proxy server is enabled.
● Disable: The proxy server is disable.
Format
display update host source
Parameters
None
Views
All views
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The update host source command configures the source interface and IP address,
and display update host source command displays the configurations.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display the interface and source address configurations used in online updating
the application identification signature database.
<HUAWEI> display update host source
----------------------------------------------------------------
Source IP Information:
IP address : 10.1.1.1
vpn-instance :-
Source Interface Information:
interface name : GigabitEthernet0/0/1
----------------------------------------------------------------
Table 14-126 Description of the display update host source command output
Item Description
Item Description
IP address IP address.
Function
The display update information all-sdb command displays the last record on
application identification signature database updates.
Format
display update information all-sdb
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Display the last record on application identification signature database updates.
<HUAWEI> display update information all-sdb
Current Update Status: Idle.
--------------------------------------------------------------------------------------------
SA-SDB latest update finish time : 04:16:13 2018/07/03
SA-SDB latest update result : Error: Failed to perform DNS resolution.
--------------------------------------------------------------------------------------------
Item Description
Function
The display update status command displays the update status of the application
identification signature database.
Format
display update status
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# View the current update status of the application identification signature
database.
<HUAWEI> display update status
Current Update Status: Idle.
Item Description
Format
display version sa-sdb
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# View the version of the application identification signature database.
<HUAWEI> display version sa-sdb
SA SDB Update Information List:
----------------------------------------------------------------
Current Version:
Signature Database Version : 2018041202
Signature Database Size(byte) : 871104
Update Time : 17:47:51 2018/06/30
Issue Time of the Update File : 17:03:54 2018/04/12
Backup Version:
Signature Database Version :
Signature Database Size(byte) : 0
Update Time : 00:00:00 0000/00/00
Issue Time of the Update File : 00:00:00 0000/00/00
----------------------------------------------------------------
Issue Time of the Date and time when the file for the upgrade package
Update File to this version was released
Format
ec-analytics enable [ inbound | outbound ]
undo ec-analytics enable [ inbound | outbound ]
Parameters
Parameter Description Value
Views
GE interface view, XGE interface view, MultiGE interface view, 25GE interface view,
VLANIF interface view, port group view
Default Level
2: Configuration level
Usage Guidelines
To analyze encrypted traffic on a network and identify malicious communications
in the encrypted traffic, you can run the ec-analytics enable command on an
interface to enable the ECA function.
Precautions
● If the traffic direction is not specified, ECA is performed for traffic in both
direction by default.
● If it is confirmed that firewalls have been deployed at the network egress, you
are advised to enable ECA only for traffic in the inbound direction.
● When ECA is enabled on both upstream and downstream interfaces, only
upstream interfaces take effect.
Example
# Enable the ECA function for traffic in the inbound direction of GE0/0/1.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] ec-analytics enable inbound
Function
The ec-analytics enhanced-mode disable command disables the ECA enhanced
mode.
Format
ec-analytics enhanced-mode disable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
In ECA enhanced mode, 50 packets are sent to the IAE for each ECA session flow,
improving accuracy of encrypted traffic identification. However, the processing
performance of the IAE deteriorates if it has to process enormous packets. When
the device performance is limited, you can disable the ECA enhanced mode. After
that, only 20 packets are sent to the IAE for each ECA session flow.
Precautions
You are advised to enable the ECA enhanced mode when the device performance
meets requirements.
Example
# Enable the ECA enhanced mode.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] undo ec-analytics enhanced-mode disable
Function
The ec-analytics whitelist command configures an ECA whitelist. ECA is not
performed for the whitelist traffic.
Format
ec-analytics whitelist acl acl-number
Parameters
Parameter Description Value
acl acl-number Adds the specified ACL number The value is an integer in the
to the ECA whitelist. range from 3000 to 3999.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can run the ec-analytics whitelist command to add trusted network traffic to
the whitelist so that ECA is not performed for such traffic.
Precautions
Advanced ACLs are applied in the ECA whitelist and only the 5-tuple information is
supported.
When the ECA whitelist is configured, a maximum of 32 ACL rules with small rule
numbers take effect.
Example
# Add ACL 3000 to the ECA whitelist to prevent ECA from being performed for
traffic with the source IP address 10.1.1.1.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] acl 3000
[HUAWEI-acl-adv-3000] rule permit ip source 10.1.1.1 0
[HUAWEI-acl-adv-3000] quit
[HUAWEI] ec-analytics whitelist acl 3000
Function
The engine configuration commit command commits the configuration of
security policies.
Format
engine configuration commit
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Newly configured security policies or the modified security policies do not take
effect until you run the engine configuration commit command to commit the
configuration. To save time, commit the configurations in batches after you have
completed all security policy configurations.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Commit the security policy configurations.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] engine configuration commit
Format
engine enhanced-detection
Parameters
Parameter Description Value
protocol rtsp Configures the engine to work By default, the engine works
in enhanced detection mode for in enhanced detection mode
RTSP. for RTSP.
protocol others Configures the engine to work By default, the engine works
in enhanced detection mode for in common detection mode
protocols excluding RTSP. for protocols excluding RTSP.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After you configure the engine to work in enhanced detection mode, the detection
capability of the device will be enhanced, and the detection speed will be
decreased.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Configure the engine to work in enhanced detection mode.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] engine enhanced-detection
Function
The engine pass-through enable command enables the pass-through mode of
the engine.
Format
engine pass-through enable [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After the pass-through mode of the engine is enabled, the system generates
events, such as debugging information or log during service processing, but does
not perform actual actions. Even a block action is configured for a service, the
system does not block traffic but records the service event state.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the pass-through mode of the engine.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] engine pass-through enable
Format
engine session timeout active time
Parameters
Parameter Description Value
time Specifies the active flow The value is an integer in the range
aging time of an ECA from 1 to 300, in seconds. The default
session. value is 60.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After ECA is configured on a device, the ECA session flow table ages out after a
certain period. The flow table that is aged out is encapsulated and then sent to
the HiSec Insight server as metadata. Active flow aging of ECA enables the device
to periodically output the statistics about the flows that persist for a long period.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the active flow aging time of an ECA session to 15 seconds.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] engine session timeout active 15
Format
engine session timeout inactive time
Parameters
Parameter Description Value
time Specifies the inactive flow The value is an integer in the range
aging time of an ECA from 1 to 300, in seconds. The default
session. value is 15.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After ECA is configured on a device, the ECA session flow table ages out after a
certain period. The flow table that is aged out is encapsulated and then sent to
the HiSec Insight server as metadata. Inactive flow aging of ECA requires the
device to export statistics about the flows that persist for a short period. Once
adding packets to a flow stops, the device exports flow statistics to conserve
memory space.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the inactive flow aging time of an ECA session to 10 seconds.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] engine session timeout active 10
Function
The flow-probe metadata-collect aging-time command configures the aging
time of ECA flow probe metadata entries.
By default, the aging time of ECA flow probe metadata entries is 300 seconds.
Format
flow-probe metadata-collect aging-time time
undo flow-probe metadata-collect aging-time
Parameters
Parameter Description Value
time Specifies the aging time of The value is an integer in the range
ECA flow probe metadata from 0 to 1200, in seconds. The
entries. default value is 300.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can configure the aging time of ECA flow probe metadata entries to adjust
the rate of sending packets to the HiSec Insight server.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the aging time of ECA flow probe metadata entries to 10 seconds.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] flow-probe metadata-collect aging-time 10
Format
flow-probe metadata-collect enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the function of metadata collection through the ECA flow probe.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] flow-probe metadata-collect enable
Function
The flow-probe metadata-collect server command configures the IP address and
port number of the HiSec Insight server.
By default, the IP address of the HiSec Insight server is not specified and the
default port number is 8514.
Format
flow-probe metadata-collect server ip ip-address [ port port-number ]
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The default port number of the peer HiSec Insight server connected to the flow
probe metadata collector is subject to the metadata collection and transmission
mode. Current switch only support UDP protocol for the metadata transmission,
the default port number is 8514.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the IP address and port number of the HiSec Insight server to 10.1.1.1 and
10 respectively.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] flow-probe metadata-collect server ip 10.1.1.1 port 10
Format
flow-probe metadata-collect source { ip ip-address port port-number | vpn-
instance vpn-instance-name } *
undo flow-probe metadata-collect source
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When configuring the source IP address of the packet sent from the ECA flow
probe metadata to the HiSec Insight server, ensure that the IP address is the
device interface IP address and that this interface IP address is reachable to the
HiSec Insight server.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the source IP address and source port number of the packet sent from the
ECA flow probe metadata to the HiSec Insight server to 10.1.1.1 and port 1
respectively.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] flow-probe metadata-collect source ip 10.1.1.1 port 1
Format
fragment-reassemble enable
undo fragment-reassemble enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If fragment reassembly is disabled, fragments will not be reassembled and will not
be inspected. Meanwhile, TCP stream reassembly may also fail.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable fragment reassembly.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] fragment-reassemble enable
Format
fragment-reassemble overflow-mode { discard | forward }
undo fragment-reassemble overflow-mode
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If the action is set to discard, the system discards the fragments that overflow the
cache, which may interrupt services.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Configure the action to take on fragments that overflow the cache to discard.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] fragment-reassemble overflow-mode discard
Format
fragment-reassemble user-configure { defense-check | pass-through }
undo fragment-reassemble user-configure { defense-check | pass-through }
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After the pass through mode is enabled (using the fragment-reassemble user-
configure pass-through command), in some special fragment traffic scenarios
(for example, the fragments completely overlap, and the overlapped part has the
same content), the system will regard the traffic as abnormal traffic and will not
reassemble the fragments. If the fragment attack defense function has been
enabled (using the fragment-reassemble user-configure defense-check
command), the abnormal fragments will be discarded. If the fragment attack
defense function has not been enabled, the system will forward the fragments.
After the pass through mode is disabled, the system assembles the fragments
based on the normal processing flow.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the fragment attack defense function.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] fragment-reassemble user-configure defense-check
Format
reset decoding statistics [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
User view
Default Level
3: Management level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Clear decoding statistics.
Function
The reset engine session statistics command clears the session statistics of the
engine.
Format
reset engine session statistics [ slot slot-id cpu cpu-id ]
Parameters
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Use caution before you decide to run this command. Once the session statistics of
the engine are cleared, they cannot be restored.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Clear the session statistics of the engine.
<HUAWEI> reset engine session statistics
Format
reset engine session statistics app-type [ slot slot-id ]
reset engine session statistics interface [ interface-type interface-number ] app-
type
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the reset engine session statistics app-type command to clear
application statistics about ECA sessions.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Clear application statistics about ECA sessions on slot 0.
Format
reset engine session statistics interface interface-type interface-number flow
{ by-time | by-packet }
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
You can run the reset engine session statistics interface command to clear ECA
session flow statistics on a specified interface.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Clear ECA session flow statistics displayed in descending order of packet
quantity on GE0/0/1.
<HUAWEI> reset engine session statistics interface gigabitethernet 0/0/1 flow by-packet
Function
The reset engine session table command clears the session information of the
engine.
Format
reset engine session table [ source source-ip-address | destination destination-
ip-address | destination-port destination-port-number | protocol { tcp | udp } ] *
[ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
Use caution before you decide to run this command. Clearing the session
information of the engine adversely affects the service operating.
Example
# Clear all session information of the engine.
<HUAWEI> reset engine session table
Warning: Reseting session table will affect the engine's normal service. Continue? [Y/N]: y
Function
The reset engine statistics command clears engine statistics.
Format
reset engine statistics [ slot slot-id cpu cpu-id ]
Parameters
slot slot-id Specifies a slot ID. The value range depends on the device
configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the device
configuration.
Views
User view
Default Level
3: Management level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Clear engine statistics.
<HUAWEI> reset engine statistics
Format
reset flow-probe metadata-collect statistics
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After you run the display flow-probe metadata-collect statistics command to
view statistics about the function of metadata collection through the ECA flow
probe, you can run the reset flow-probe metadata-collect statistics command
to reset the statistics and collect statistics again. Cleared statistics cannot be
restored. Exercise caution when you run this command.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Reset statistics about the function of metadata collection through the ECA flow
probe.
<HUAWEI> reset flow-probe metadata-collect statistics
Format
reset fragment-reassemble [ ipv6 ] statistics [ slot slot-id cpu cpu-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value range depends on the
device configuration.
cpu cpu-id Specifies a CPU ID. The value range depends on the
device configuration.
Views
User view
Default Level
3: Management level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Clear statistics on fragment reassembly.
<HUAWEI> reset fragment-reassemble statistics
Format
stream-reassemble enable
undo stream-reassemble enable
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If TCP stream reassembly is disabled, TCP packets will not be reassembled and will
not be inspected. Meanwhile, security inspections based on TCP streams may also
fail.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable TCP stream reassembly.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble enable
Format
stream-reassemble enhanced-mode
undo stream-reassemble enhanced-mode
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
The command is used to enable the enhanced traffic reassembly mode in the
bypass deployment scenario. After this mode is enabled, sequence number
reassembly is supported when TCP data packets and three-way handshake packets
are out of order.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the enhanced traffic reassembly mode.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble enhanced-mode
Function
The stream-reassemble overflow-mode command configures the action for
cache overflow during TCP stream reassembly.
By default, the action for cache overflow during TCP stream reassembly is
forward.
Format
stream-reassemble overflow-mode { discard | forward }
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the action for cache overflow during TCP stream reassembly to forward.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble overflow-mode forward
Function
The stream-reassemble overlap-mode command configures the action for
overlapping packets during TCP stream reassembly.
By default, the action for the overlapping packets during TCP stream reassembly is
preserve.
Format
stream-reassemble overlap-mode { preserve | overwrite }
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the action for the overlapping packets during TCP stream reassembly to
preserve.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble overlap-mode preserve
Function
The stream-reassemble session-cache command configures the maximum cache
for each session during TCP stream reassembly for out-of-order packets.
By default , the maximum cache for each session during TCP stream reassembly
for out-of-order packets is 128 KB.
Format
stream-reassemble session-cache session-cache-value
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When the session-cache-value is 0 or the size of a single session exceeds the
session-cache-value, the stream reassembly for out-of-order packets becomes
invalid.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the maximum cache for each session to 16 KB during stream reassembly.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble session-cache 16
Format
stream-reassemble session-timeout session-timeout-value
undo stream-reassemble session-timeout
Parameters
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the timeout time for out-of-sequence TCP packet inspection to 20 seconds.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble session-timeout 20
Function
The stream-reassemble tcp-option check command enables the TCP option
check function.
Format
stream-reassemble tcp-option check
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After this function is enabled, the engine directly discards packets with abnormal
TCP options.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the TCP option check function.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble tcp-option check
Function
The stream-reassemble timestamp check command enables timestamp check of
TCP flow reassembly.
Format
stream-reassemble timestamp check
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After you enable timestamp check of TCP flow reassembly, the device verifies the
timestamp option of TCP packets. If the option is incorrect, the device discards the
packets.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable timestamp check of TCP flow reassembly.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble timestamp check
Function
The stream-reassemble user-configure defense-check command enables the
TCP attack defense function.
Format
stream-reassemble user-configure defense-check
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After this function is enabled, the switch directly discards abnormal TCP packets.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the TCP attack defense function.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] stream-reassemble user-configure defense-check
Format
update abort
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
In online/immediate updates, the device needs to connect to the update center. If
the network rate is too low and impacts the services and device performance, you
can run the update abort command to abort the update and then retry updating
when appropriate. In update retires, you cannot perform other update operations.
If you need to use another update method, run the update abort command to
abort the update process first.
Prerequisites
The update abort command can only be used for online/immediate updates or
update retries.
Example
# Abort the immediate update process.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update online sa-sdb
[HUAWEI] update abort
Format
update apply sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If manual installation confirmation has been enabled by the update confirm sa-
sdb enable command, run the update apply sa-sdb command to install the
update files.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Install the application identification signature database update files.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update apply sa-sdb
Function
The update confirm sa-sdb enable command enables manual confirmation of
the application identification signature database installation.
Format
update confirm sa-sdb enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable manual confirmation for the application identification signature
database installation.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update confirm sa-sdb enable
Format
update download-server aging-time age-time
undo update download-server aging-time
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the download server is normal and has not been expired, you do not need to re-
obtain the IP address of the download server. You need to re-obtain the IP address
of the download server when the server has expired or is abnormal. You can use
this command to adjust the aging time of the download server.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
The aging time of the download server applies to only HTTPS upgrade and not to
HTTP upgrade.
Example
# Set the aging time of the download server to 10 days.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update download-server aging-time 10
Format
update force apply sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you run the update apply sa-sdb command to download update files, the
update fails in case of insufficient system memory. In this case, you can run the
update force apply sa-sdb command to forcibly install downloaded update files.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
Running the update force apply sa-sdb command causes the IAE not to take
effect in a short time and resets all IAE-related session tables. Therefore, exercise
cautions when using this command.
Example
# Forcibly install the application identification signature database update files.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update force apply sa-sdb
Function
The update force local sa-sdb command configures forcible manual update of
the local application identification signature database.
Format
update force local sa-sdb file filename
Parameters
Parameter Description Value
file filename Indicates the file used for the The absolute path of a file is
update. You must upload the a string of 1 to 64 characters
update files to the device memory without spaces.
before the update.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you run the update local sa-sdb command to update the application
identification signature database locally, the update fails in case of insufficient
system memory. In this case, you can run the update force local sa-sdb
command to forcibly update the local application identification signature
database.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
Running the update force local sa-sdb command causes the IAE not to take
effect in a short time and resets all IAE-related session tables. Therefore, exercise
cautions when using this command.
Example
# Forcibly update the local application identification signature database using file
hda1:/cnc_h10010000_2017111500.zip.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update force local sa-sdb file hda1:/cnc_h10010000_2017111500.zip
Format
update force online sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you run the update online sa-sdb command to immediately update the
application identification signature database, the update fails in case of
insufficient system memory. In this case, you can run the update force online sa-
sdb command to immediately update the application identification signature
database.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
Running the update force online sa-sdb command causes the IAE not to take
effect in a short time and resets all IAE-related session tables. Therefore, exercise
cautions when using this command.
Example
# Forcibly update the application identification signature database.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update force online sa-sdb
Format
update force restoresdb-default sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you run the update restore sdb-default sa-sdb command to restore the
application identification signature database to the default version, the restore
fails if the system memory is insufficient. In this case, you can attempt to run the
update force restore sdb-default sa-sdb command to forcibly restore the
application identification signature database to the default version.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
● After you run the update force restore sdb-default sa-sdb command, the
application identification signature database files corresponding to the
rollback version and download version of the application identification
signature database will be deleted.
● Running the update force restore sdb-default sa-sdb command causes the
IAE not to take effect within a short period, resets all IAE-related session
tables, and interrupts some services. Therefore, exercise caution when running
this command.
Example
# Forcibly restore the application identification signature database to the factory
default version.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update force restore sdb-default sa-sdb
Function
The update force rollback sa-sdb command forcibly rolls back the version of the
application identification signature database.
Format
update force rollback sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When you run the update rollback sa-sdb command to roll back the version of
the application identification signature database, the rollback fails in case of
insufficient system memory. In this case, you can run the update force rollback
sa-sdb command to forcibly roll back the version of the application identification
signature database.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
Running the update force rollback sa-sdb command causes the IAE not to take
effect in a short time and resets all IAE-related session tables. Therefore, exercise
cautions when using this command.
Example
# Forcibly roll back the version of the application identification signature
database.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update force rollback sa-sdb
Function
The update host source command specifies the source IP address of online
update request packets.
The undo update host source command deletes the specified source IP address of
online update request packets.
By default, the system searches a route based on the IP address of the update
center and uses the IP address of the outgoing interface as the source IP address
of update request packets.
Format
update host source { interface-type interface-number | ip ip-address [ vpn-
instance vpn-instance ] }
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
When the device connects to the Internet through a VPN instance, these
commands are mandatory. If the commands are not configured, the update will
fail.
● When update host source interface-type interface-number is configured, the
interface must be bound to the corresponding VPN instance name.
● When the update host source ip ip-address command is configured, vpn-
instance vpn-instance must be specified.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
After configuring this command, the device performs remote URL query within the VPN
that the interface belongs to.
Example
# Set the IP address of the interface used for online update to GE0/0/1.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet1/0/0] ip address 10.1.1.1 24
[HUAWEI-GigabitEthernet1/0/0] quit
[HUAWEI] update host source gigabitethernet 0/0/1
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update host source ip 10.1.1.1
Format
update local sa-sdb file filename
Parameters
Parameter Description Value
file filename Specifies the update file. You The absolute path of a file is a
must upload the update files to string of 1 to 64 characters
the device memory before the without spaces.
update.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If the device cannot connect to the network, download the update files from the
security center to a PC and upload the files to the device memory. Then run the
update local command to update the application identification signature
database.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Manually update the local the application identification signature database
using file hda1:/cnc_h10010000_2017111500.zip.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update local sa-sdb file hda1:/cnc_h10010000_2017111500.zip
Format
update online sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The online update modes of the application identification signature database
include scheduled update and immediate update. Generally, scheduled update is
used. In some case, the application identification signature database needs to be
updated to the latest version immediately. If the scheduled update period does not
expire, you can run the update online sa-sdb command to start immediate
update. Before the update, you need to check whether the domain name or IP
address of the update center (sec.huawei.com) is accessible.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Update the application identification signature database immediately.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update online sa-sdb
Format
update online-mode { http | https }
undo update online-mode
Parameters
Parameter Description Value
http Indicates the HTTP update mode, in which the device uses -
HTTP to send update requests and uses FTP to download the
application identification signature database.
https Indicates the HTTPS update mode, in which the device uses -
HTTPS to send update requests and download the
application identification signature database.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
This setting applies only to online update in direct update scenarios (including
scheduled update and immediate update) but not online update through a proxy
server.
NOTE
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the online application identification signature database update mode to
HTTP.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update online-mode http
Format
update proxy { domain domain-name | ip ip-address } [ port port-number ]
[ user user-name [ password password ] ]
undo update proxy
Parameters
Parameter Description Value
port port- Indicates the port The value is an integer in the range from
number number of the proxy 1 to 65535. The default value is 80.
server.
user user- Indicates the user The user name is a string and must have
name name for logging in been set on the proxy server.
to the proxy server.
If the user name does not contain spaces,
it ranges from 1 to 32 characters. If the
user name contains spaces, it ranges from
3 to 34 characters, and must be enclosed
with double quotation marks (""), for
example, "user for test".
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
After the password for logging in to the proxy server is configured, you need to
reconfigure the password if a version earlier than V200R021C10 is upgraded to
V200R021C10 or later, or V200R021C10 or later is downgraded to a version earlier
than V200R021C10.
Example
# Configure the proxy server.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update proxy ip 192.168.2.33 port 8080 user test password Hello!123
Function
The update proxy enable command enables the application identification
signature database proxy update function.
The undo update proxy enable command disables the application identification
signature database proxy update function.
Format
update proxy enable
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
The update proxy enable command used for updating the application
identification signature database through a proxy server.
After this function is enabled, you must run the update proxy command to set
the proxy server. Otherwise, the device cannot connect to the update server
through the proxy server.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Precautions
Example
# Enable the application identification signature proxy update function.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update proxy enable
Function
The update restore sdb-default sa-sdb command restores the application
identification signature database to the factory default version.
Format
update restore sdb-default sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
After you run the update restore sdb-default sa-sdb command, the application
identification signature database files corresponding to the rollback version and
download version of the application identification signature database will be
deleted. Therefore, exercise caution when running this command.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Restore the application identification signature database to the factory default
version.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update restore sdb-default sa-sdb
Function
The update rollback sa-sdb command rolls back the version of the application
identification signature database.
Format
update rollback sa-sdb
Parameters
None
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Run the update rollback sa-sdb command to roll back the current version of the
application identification signature database to an earlier version. Only one earlier
version is available for version rollback. If you run the update rollback sa-sdb
command a second time, the version of the application identification signature
database is rolled back to the current version again.
NOTE
The version rollback function is unavailable before the second update is complete.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Roll back the version of the application identification signature database.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update rollback sa-sdb
Function
The update schedule enable command enables scheduled update time for the
application identification signature database.
The undo update schedule enable command disables scheduled update time for
the application identification signature database.
Format
update schedule sa-sdb enable
Parameters
Views
System view
Default Level
3: Management level
Usage Guidelines
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Enable the scheduled update time function for the application identification
signature database.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update schedule sa-sdb enable
Function
The update schedule retry-download interval command sets the retry interval
for downloading the application identification signature database for scheduled
update.
Format
update schedule retry-download interval interval-value
Parameters
Parameter Description Value
interval-value Specifies the retry interval for The value is an integer ranging
downloading the application from 300 to 3600, in second.
identification signature database The default value is 3600.
for scheduled update.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
In case of scheduled update, if the update server is busy, the application
identification signature database may fail to be download, causing an update
failure. Then, the device will retry downloading the application identification
signature database. The update schedule retry-download interval command is
used to set the retry interval for downloading the application identification
signature database.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the retry interval for downloading the application identification signature
database for scheduled update to 1800s.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update schedule retry-download interval 1800
Format
update schedule retry-load interval interval-value
undo update schedule retry-load interval
Parameters
Parameter Description Value
interval-value Specifies the retry interval for The value is an integer ranging
loading the application from 300 to 3600, in second.
identification signature database The default value is 3600.
for scheduled update.
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
In case of scheduled update, if the memory of the device is insufficient, the device
may fail to load the downloaded application identification signature database.
Then, the device will retry loading the application identification signature
database. The update schedule retry-load interval command is used to set the
retry interval for loading the application identification signature database.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the retry interval for loading the application identification signature
database for scheduled update to 1800s.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update schedule retry-load interval 1800
Format
update schedule [ sa-sdb ] [ { daily | weekly { Mon | Tue | Wed | Thu | Fri | Sat |
Sun } } time ]
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
If time is not specified, the update schedule can update the application
identification signature database daily at any point during the time range 22:00 to
08:00.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Configure a scheduled update of the application identification signature
database at 02:00 every Wednesday.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update schedule weekly Wed 02:00
Format
update server { domain domain-name | ip ip-address } [ port port-number ]
undo update server
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
By default, the domain name of the update server is sec.huawei.com, the HTTP
port number is 80 and the HTTPS port number is 443.
Prerequisites
Before running this command, you must run the defence engine enable
command to enable the IAE.
Example
# Set the IP address of the update server to 10.1.1.1 and port number to 86.
<HUAWEI> system-view
[HUAWEI] defence engine enable
[HUAWEI] update server ip 10.1.1.1 port 86
14.22.2 deception
Function
The deception command creates and enters the deception view.
Format
deception
undo deception
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To configure the deception function, run this command to create and enter the
deception view first.
Precautions
The undo deception command will delete all deception configurations. Therefore,
confirm your operation before using this command.
Example
# Create and enter the deception view.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception]
Function
The deception aci enable command enables the Access Control Isolation (ACI)
deception function.
The undo deception aci enable command disables the ACI deception function.
The ACI deception function is disabled by default.
Format
deception aci detect-network { id id-number | all } enable
undo deception aci detect-network { id id-number | all } enable
Parameters
Parameter Description Value
id id-number Specifies the ID of a network segment The value is an integer
to be detected. ranging from 1 to 50.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
ACI is an isolation scheme for controlling intranet communication through DNS
access. After this function is enabled, the source or destination address in the
detected network segment must be accessed through the domain name. If the IP
address is directly accessed or the IP address that does not exist is accessed, traffic
is deceived to the Decoy.
The DecoySensor parses DNS reply packets and establishes mappings between the
source addresses of DNS request packets and the IP addresses corresponding to
the domain names in DNS reply packets (that is, the ACI table). Subsequent TCP
SYN packets and ICMP ping packets will match the ACI table. Traffic that fails to
match the table is deceived to the Decoy for in-depth interactive detection.
ACI also supports the configuration of an ACI suffix using the deception aci suffix
command. The default value is aci. An ACI suffix functions as an intranet access
key. For example, if the IP address of the server in the detected network segment
is 192.168.1.1, the server must be accessed through 192.168.1.1.aci if the default
ACI suffix is used. If the IP address of the server is directly accessed or the IP
address with an incorrect ACI suffix is accessed, traffic is deceived to the Decoy for
in-depth interactive detection.
The ACI deception function takes effect only after the deception function is
enabled using deception enable.
Example
# Enable the ACI deception function.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception aci detect-network all enable
Function
The deception aci lack decoy command sets the policy used in the case of a full
ACI table to deceive.
The undo deception aci lack decoy sets the policy used in the case of a full ACI
table to permit.
The policy used in the case of a full ACI table is permit by default.
Format
deception aci lack decoy
Parameters
None
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
The ACI table is space-limited. If there are a large number of intranet DNS
requests and the ACI table cannot store new mappings, traffic will be deceived or
permitted based on the configuration of this command.
To prevent a full ACI table, you can run the deception aci timeout command to
set a shorter aging time for ACI entries.
Example
# Set the policy used in the case of a full ACI table to deceive.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception aci lack decoy
Warning: If the configured ACI resources are insufficient, the default action is decoy which affects services.
Continue? [Y/N]:y
Function
The deception aci suffix command sets an ACI suffix.
The undo deception aci suffix command restores the default ACI suffix.
The ACI suffix is aci by default.
Format
deception aci suffix suffix-value
undo deception aci suffix
Parameters
Parameter Description Value
suffix-value Specifies the ACI The value is a string of at most eight
suffix. characters, including letters, digits, and
hyphens (-). It must start with a letter.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
An ACI suffix functions as an intranet access key. For example, if the IP address of
the server in the detected network segment is 192.168.1.1, the server must be
accessed only through 192.168.1.1.aci if the default ACI suffix is used. If the IP
address of the server is directly accessed or the IP address with an incorrect ACI
suffix is accessed, traffic is deceived to the Decoy or discarded.
After the ACI suffix is changed, you need to run the reset deception aci command
to update the ACI entries. Otherwise, the old ACI suffix becomes invalid only after
the ACI entries age. After the ACI entries are updated, the access initiated by a
terminal is deceived when the DNS record of the terminal does not age. Therefore,
change the ACI suffix when no service traffic exists.
Example
# Set the ACI suffix to testaci.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception aci suffix testaci
Function
The deception aci timeout command sets the aging time of ACI entries.
The undo deception aci timeout command restores the default aging time of ACI
entries.
By default, the aging time of ACI entries is 60s. When a new DNS reply packet
arrives, the corresponding ACI entry is updated.
Format
deception aci timeout timeout-value
undo deception aci timeout
Parameters
Parameter Description Value
timeout-value Specifies the aging time of The value is an integer ranging
ACI entries. from 10 to 300, in seconds.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
The DecoySensor replaces the TTL in the DNS reply packet with the aging time
configured in this command. The DNS TTL is the cache time of the DNS entries
recorded by the terminal. After the time expires, the terminal initiates a DNS
request again. After receiving the DNS reply packet, the DecoySensor updates the
aging time of the corresponding ACI entry to ensure that the DNS entry recorded
by the terminal and the ACI entry on the DecoySensor are aged or updated at the
same time.
The ACI table is space-limited. If there are a large number of intranet DNS
requests and the ACI table cannot store new mappings, traffic will be deceived or
permitted based on the configuration of the deception aci lack decoy command.
You can run the deception aci timeout command to set a shorter aging time for
ACI entries.
If the intranet access is stable and there is a small number of DNS requests, you
can set a longer aging time of ACI entries for better performance.
Example
# Set the aging time of ACI entries to 100s.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception aci timeout 100
Function
The deception arp-request rate command sets an IP address scanning threshold.
The undo deception arp-request rate command restores the IP address scanning
threshold to the default value.
Format
deception arp-request rate rate-number
Parameters
Parameter Description Value
rate-number Specifies an IP address The value is an integer in the range
scanning threshold. from 1 to 20000, in "times per 10
seconds".
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
If the frequency of scanning a destination IP address by a source IP address
reaches the specified threshold, the switch considers the event to be a suspected
attack. Once the switch detects that the scanned IP address is offline, it
immediately lures the traffic to the Decoy for further detection.
Example
# Set the IP address scanning threshold to 20 times per 10 seconds.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception arp-request rate 20
Format
deception decoy-network id id-number destination ip-address [ mask ]
[ destination-port port &<1-20> ] [ vpn-instance vpn-instance-name ]
Parameters
Parameter Description Value
id id-number Specifies the ID of a bait network The value is an integer
segment. in the range from 1 to
50.
vpn-instance vpn- Specifies the VPN instance for the The VPN instance
instance-name bait network segment. must be an existing
one on the device.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After a bait network segment is configured, the switch does not detect whether
the IP addresses on the bait network segment are online. If an IP address or TCP
port on the bait network segment is scanned, the switch lures the scanning traffic
to the Decoy for further attack detection. Therefore, you can add some idle IP
addresses to the bait network segment.
Precautions
Example
# Add 10.1.1.11 to the bait network segment.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception decoy-network id 1 destination 10.1.1.11
Format
deception detect-network id id-number ip-address mask [ vpn-instance vpn-
instance-name ]
undo deception detect-network { all | id id-number }
Parameters
Parameter Description Value
id id-number Specifies the ID of a detected The value is an integer in
network segment. the range from 1 to 50.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Precautions
If you have configured a bait network segment using the deception decoy-
network command, deception is triggered when the IP addresses on the bait
network segment are scanned, with no need to configure these IP addresses in the
detected network segment.
Example
# Configure the deception system to detect the network segment 10.1.1.0/24.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception detect-network id 1 10.1.1.0 255.255.255.0
Function
The deception dns enable command enables the unknown-domain-name
deception function.
Format
deception dns enable
Parameters
None
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
After the unknown-domain-name deception function is enabled, the DecoySensor
identifies DNS requests on the network. When DNS requests are quickly sent from
the same source IP address, it is suspected that domain name scanning is
performed for obtaining the real intranet IP address. When the rate of domain
name scans reaches the threshold and related information in the DNS reply packet
indicates that the domain name does not exist, the DecoySensor automatically
constructs and returns a DNS reply packet. The IP address in the DNS reply packet
is the IP address in the bait network segment and is in the same network segment
as the source address for sending the DNS request packet. The subsequent access
and attack to this IP address will be deceived to the Decoy for in-depth interactive
detection.
The deception operation is performed only after a bait network segment that is
the same as the detected network segment is configured using deception decoy-
network. If the bait network segment is not configured, the DecoySensor sends
only domain name scan threshold-crossing logs.
Example
# Enable the unknown-domain-name deception function.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception dns enable
Function
The deception dns-request rate command sets the domain name scan threshold.
The undo deception dns-request rate command restores the default domain
name scan threshold.
By default, the domain name scan threshold is 5 scans per second.
Format
deception dns-request rate rate-number
undo deception dns-request rate
Parameters
Parameter Description Value
rate-number Specifies the domain name The value is an integer ranging from
scan threshold. 1 to 20000, in scans per second.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
When the rate of domain name scans sent from the same source IP address
reaches the threshold and related information carried in the DNS reply packet
indicates that the domain name does not exist, the DecoySensor determines that
it is an attack. The DecoySensor automatically constructs and returns a DNS reply
packet. The IP address corresponding to the domain name in the constructed DNS
reply packet is the IP address in the bait network segment, and is in the same
network segment as the source address for sending the DNS request packet. The
subsequent access and attack to this IP address will be deceived to the Decoy.
Example
# Set the domain name scan threshold to 300 scans per second.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception dns-request rate 300
Format
deception enable
undo deception enable
Parameters
None
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
After deception is enabled, the DecoySensor identifies IP address and TCP port
scanning activities on the network and lures suspicious traffic to the Decoy. If the
configuration is incorrect, normal network traffic may be affected. Before enabling
deception, run the display this command in the deception view to confirm the
deception configuration.
Prerequisites
● The optimized ARP reply function has been disabled using the arp optimized-
reply disable command, and the VLANIF interface has been configured to
send ARP packets destined for other devices to the CPU using the undo arp
optimized-passby enable command.
● You have configured deception detect-network or deception decoy-
network, or both of them. Otherwise, the deception function does not take
effect.
Example
# Enable the deception function.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception enable
Format
deception decoy destination destination-ip [ source source-ip ] [ vpn-instance
vpn-instance-name ] [ backup destination destination-ip [ source source-ip ]
[ vpn-instance vpn-instance-name ] ]
Parameters
Parameter Description Value
vpn-instance vpn- Specifies the VPN instance of the The VPN instance
instance-name Decoy. must be an existing
one on the device.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When detecting suspected attack traffic, the switch lures the traffic to a Decoy for
further checks. Therefore, you must first run this command to configure the IP
address of the Decoy.
If communication between the switch and active Decoy is abnormal, the switch
sends the log and deceived traffic to the standby Decoy that can communicate
with the switch.
Precautions
A switch cannot use the virtual IP address of a VRRP group or the IP address of
the management network interface to connect to a Decoy.
Example
# Set the Decoy IP address to 10.1.1.1.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception decoy destination 10.1.1.1
Format
deception ip-state detect rate rate-number
undo deception ip-state detect rate
Parameters
Parameter Description Value
rate-number Specifies the frequency of The value is an integer in the range
scanning IP addresses by the from 1 to 4096, in "times per
switch. second".
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
The switch initiates IP address scanning on the network segment to be detected to
check whether IP addresses are online. If the scanning frequency is too high, the
network is affected. If the scanning frequency is too low, the switch takes a long
time to learn about the online status of IP addresses. You need to configure a
proper IP address scanning frequency based on the site requirements and live
network quality.
Example
# Set the frequency of scanning IP addresses by the switch to 40 times per second.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception ip-state detect rate 40
Function
The deception mac-address aging-time command configures the interval at
which the switch sends an ARP broadcast packet.
Format
deception mac-address aging-time aging-time
Parameters
Parameter Description Value
aging-time Specifies the interval at which The value is an integer in the
the switch sends an ARP range from 10 to 1000000, in
broadcast packet. seconds.
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
To perform spoofing on IP address scanning, the switch constructs a virtual MAC
address and sends it to the scanning source. The scanning source then incorrectly
considers that the IP address to be scanned is online, and the switch diverts
subsequent traffic from the scanning source to a Decoy for attack detection. The
Layer 2 switch records an ARP entry of the scanned IP address and virtual MAC
address. To prevent packets destined for the scanned IP address from being
broadcast on the network after the entry is aged out, the switch periodically sends
an ARP broadcast packet that contains the mapping between the scanned IP
address and the virtual MAC address to the Layer 2 switch. You can run the
deception mac-address aging-time command to adjust the interval at which the
switch sends an ARP broadcast packet.
Example
# Set the interval at which the switch sends an ARP broadcast packet to 300
seconds.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception mac-address aging-time 300
Function
The deception mode strict command enables the strict deception mode.
The undo deception mode command disables the strict deception mode.
Format
deception mode strict
Parameters
None
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
Fixed networking and stable servers are prerequisites for the strict deception
mode. After the strict deception mode is set, the switch immediately lures the
traffic destined for offline IP addresses or unopened TCP ports to the Decoy for
further detection.
In non-strict mode, deception is performed only when the following conditions are
met:
● The IP scanning or TCP port scanning frequency initiated by an IP address
reaches the specified threshold.
● An offline IP address or unopened TCP port is scanned.
Example
# Enable the strict deception mode.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception mode strict
Function
The deception syn-connect rate command sets a TCP port scanning threshold.
The undo deception syn-connect rate command restores the TCP port scanning
threshold to the default value.
By default, the TCP port scanning threshold is 100 times per second.
Format
deception syn-connect rate rate-number
Parameters
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
If the frequency of scanning a TCP port by a source IP address reaches the
specified threshold, the switch considers the event to be a suspected attack. Once
the switch detects that the scanned TCP port is unopened, it immediately lures the
traffic to the Decoy for further detection.
Example
# Set the TCP port scanning threshold to 200 times per second.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception syn-connect rate 200
Function
The deception whitelist command sets a deception whitelist.
Format
deception whitelist id id-number { destination | source } ip-address [ mask ]
[ vpn-instance vpn-instance-name ]
Parameters
Views
Deception view
Default Level
2: Configuration level
Usage Guidelines
You can configure destination IP address whitelists and source IP address
whitelists:
● Source IP address whitelist: If the source IP address of scanning packets is in
the source IP address whitelist, the device does not lure the scanning packets
sent from this IP address to the Decoy. The addresses of devices that
proactively detect the network (such as the NMS) can be whitelisted to
prevent deception.
● Destination IP address whitelist: If the destination IP address of scanning
packets is in the destination IP address whitelist, the device does not lure the
scanning packets sent to this IP address to the Decoy. The addresses of
devices that do not respond to ARP requests or port connection requests (such
as traditional printers) can be whitelisted to prevent deception.
Example
# Add 10.1.1.10 to destination IP address whitelist.
<HUAWEI> system-view
[HUAWEI] deception
[HUAWEI-deception] deception whitelist id 1 destination 10.1.1.10
Function
The display deception aci command displays the ACI table.
Format
display deception aci [ source ip-address ]
Parameters
Parameter Description Value
source ip-address Specifies the source IP address in The value is in dotted
an ACI entry. decimal notation.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The DecoySensor parses DNS reply packets and establishes mappings between the
source addresses of DNS request packets and the IP addresses corresponding to
the domain names in DNS reply packets (that is, the ACI table). Subsequent TCP
SYN packets and ICMP ping packets will match the ACI table. Traffic that fails to
match the table is deceived to the Decoy for in-depth interactive detection.
If the number of current entries approaches the upper limit, run the deception aci
timeout command to set a shorter aging time for ACI entries.
Example
# Display the ACI table.
<HUAWEI> display deception aci
-------------------------------------------------------------------------------------------------------
Current total number = 1
-------------------------------------------------------------------------------------------------------
source destnation time vpn-instance
-------------------------------------------------------------------------------------------------------
192.168.1.1 172.16.2.1 192 public
Format
display deception arp-proxy
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The switch cannot scan its interface IP address and the target IP addresses in the
proxy ARP requests sent to the switch. Therefore, the switch may lure the traffic
destined for these IP addresses to a Decoy. To solve this problem, after the switch
receives ARP requests destined for these IP addresses, the switch returns ARP reply
packets, and the management plane instructs the deception module to add the
target IP addresses in ARP requests to the online IP address table.
Example
# Display the interface IP address of the switch and the target IP addresses in the
proxy ARP requests sent to the switch in the online IP address table.
<HUAWEI> display deception arp-proxy
-------------------------------------------------------------------------------------------------------
Current total number = 1
-------------------------------------------------------------------------------------------------------
ip-address vlan vpn-instance
10.1.1.1 10 default
--------------------------------------------------------------------------------
Item Description
Function
The display deception arp-request command displays the IP address scanning
behavior detected by the switch.
Format
display deception arp-request [ source ip-address ]
Parameters
Parameter Description Value
source ip-address Specifies the source IP address The value is in dotted
that initiates IP address scanning. decimal notation.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to check the IP address scanning behavior detected by
the switch, so that you can configure a more accurate IP address canning
threshold using the deception arp-request rate command. If an IP address is
scanned at a lower frequency than the threshold specified by the deception arp-
request rate command but have been scanned for many times, the scanning
behavior may be an attack.
Example
# Display the IP address scanning behavior detected by the switch.
<HUAWEI> display deception arp-request
---------------------------------------------------------------------------------------------------
Current total number = 2
---------------------------------------------------------------------------------------------------
source rate(num/10s) number vlan vpn-instance
---------------------------------------------------------------------------------------------------
10.1.1.1 4 231 10 public
10.1.1.2 1 280 10 public
--------------------------------------------------------------------------------
Format
display deception config-flow [ slot slot-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value must be set according to the device
configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
When a detected network segment, bait network segment, or deception whitelist
is configured, a configuration flow table is generated. If the preceding
configuration is changed, the switch checks whether the deceived traffic meets the
conditions of configuration flow tables and determines whether to lure the traffic
to the Decoy.
Example
# Display the configuration flow table.
<HUAWEI> display deception config-flow
Slot: 0
-------------------------------------------------------------------------------------------------------
CFG Flow ID 1 information:
-------------------------------------------------------------------------------------------------------
Priority :0
Action :1
Causeid :16384
Vpn-instance :
Source IP :10.10.11.11/255.255.255.255
-------------------------------------------------------------------------------------------------------
CFG Flow ID 2 information:
-------------------------------------------------------------------------------------------------------
Priority :1
Action :4
Causeid :4096
Vpn-instance :
Destination IP :192.168.1.0/255.255.255.240
-------------------------------------------------------------------------------------------------------
CFG Flow ID 3 information:
-------------------------------------------------------------------------------------------------------
Priority :3
Action :8
Causeid :1
Vpn-instance :
Destination IP :10.10.10.0/255.255.255.0
-------------------------------------------------------------------------------------------------------
CFG Flow ID 4 information:
-------------------------------------------------------------------------------------------------------
Priority :3
Action :8
Causeid :1
Vpn-instance :
Source IP :10.10.10.0/255.255.255.0
-------------------------------------------------------------------------------------------------------
CFG Flow ID 5 information:
-------------------------------------------------------------------------------------------------------
Priority :3
Action :8
Causeid :1
Vpn-instance :
Destination IP :192.168.1.0/255.255.255.0
-------------------------------------------------------------------------------------------------------
CFG Flow ID 6 information:
-------------------------------------------------------------------------------------------------------
Priority :3
Action :8
Causeid :1
Vpn-instance :
Source IP :192.168.1.0/255.255.255.0
-------------------------------------------------------------------------------------------------------
CFG Flow ID 7 information:
-------------------------------------------------------------------------------------------------------
Priority :0
Action :1
Causeid :16384
Vpn-instance :
Destination IP :10.10.10.22/255.255.255.255
Item Description
Item Description
Function
The display deception decoy-network command displays a bait network
segment.
Format
display deception decoy-network [ id id-number ]
Parameters
Parameter Description Value
id id-number Specifies the ID of a bait The value is an integer in the
network segment. range from 1 to 50.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After configuring a bait network segment using the deception decoy-network
command, you can run the display deception decoy-network command to check
whether the bait network segment is correctly configured.
Example
# Display all bait network segments.
<HUAWEI> display deception decoy-network
-------------------------------------------------------------------------------------------------------
Current total number = 1
-------------------------------------------------------------------------------------------------------
Decoy-network ID 1 information:
-------------------------------------------------------------------------------------------------------
source/mask :any
destination/mask :192.168.1.0/255.255.255.240
destination-port :
vpn-instance :
Format
display deception detect-network [ id id-number ]
Parameters
Parameter Description Value
id id-number Specifies the ID of a detected The value is an integer in the
network segment. range from 1 to 50.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After configuring a detected network segment using the deception detect-
network command, you can run the display deception detect-network
command to check whether the detected network segment is correctly configured.
Example
# Display the network segments detected for deception.
<HUAWEI> display deception detect-network
---------------------------------------------------------------------------------------------------
Current total number = 1
---------------------------------------------------------------------------------------------------
id ip-address/mask(For both source and destination) vpn-
instance
---------------------------------------------------------------------------------------------------
1 192.168.10.0/255.255.255.0
Function
The display deception dns command displays the domain name scan status.
Format
display deception dns [ source ip-address ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
By observing the domain name scan status, network administrators can set a
more accurate domain name scan threshold using the deception dns-request
rate command.
If the rate of a source address is low and does not reach the threshold but the
number is large, a very patient hacker may be hidden behind this address.
Example
# Display domain name scan status.
<HUAWEI> display deception dns
--------------------------------------------------------------------------------
Current total number = 2
--------------------------------------------------------------------------------
source number rate(num/s) error-aci vpn-instance
--------------------------------------------------------------------------------
192.168.1.1 4 231 0 public
192.168.1.2 1 280 0 public
--------------------------------------------------------------------------------
recent request dns domain :
www.huawei.com
192.168.1.3.aci
Item Description
Item Description
recent request dns Domain name in the latest request. A maximum of five
domain domain names can be recorded
Format
display deception flow [ slot slot-id ]
Parameters
Parameter Description Value
slot slot-id Specifies a slot ID. The value must be set according to the device
configuration.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
In the deception flow table, you can view the traffic that meets certain conditions
and will be sent to the deception module. The deception module then determines
whether to lure the traffic to the Decoy based on the scanned IP address and TCP
port.
Precautions
When a detected network segment, bait network segment, or deception whitelist
is configured, a deception flow table is generated.
Example
# Display the deception flow table.
<HUAWEI> display deception flow
Slot: 0
--------------------------------------------------------------------------------
Flow ID 1 information:
--------------------------------------------------------------------------------
Status :Valid
Destination mac :0050-568c-1bbc
Vpn-instance :
--------------------------------------------------------------------------------
Flow ID 2 information:
--------------------------------------------------------------------------------
Status :Valid
Vpn-instance :
Eth_type :Arp
--------------------------------------------------------------------------------
Flow ID 4 information:
--------------------------------------------------------------------------------
Status :Valid
Vpn-instance :
Protocol :Tcp
Tcp_flag :Syn
--------------------------------------------------------------------------------
Flow ID 5 information:
--------------------------------------------------------------------------------
Status :Valid
Vpn-instance :
Protocol :Tcp
Tcp_flag :Syn | Ack
--------------------------------------------------------------------------------
Flow ID 6 information:
--------------------------------------------------------------------------------
Status :Valid
Vpn-instance :
Protocol :Tcp
Tcp_flag :Rst | Ack
Item Description
Format
display deception decoy status
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
A DecoySensor initiates registration to a Decoy. If the registration succeeds:
● The registration status changes from INIT to ALIVE.
● The Decoy informs the DecoySensor of a port list for which the deception
service is provided. Only the traffic whose destination ports in the list can be
lured to the Decoy for further detection.
● The DecoySensor and Decoy send heartbeat packets to each other every 5
seconds. If the DecoySensor does not receive heartbeat packets from the
Decoy within 60 seconds, its registration status changes to INIT. If the Decoy
does not receive heartbeat packets from the DecoySensor within 60 seconds,
it sends a deregistration packet to the DecoySensor. After the DecoySensor
receives the packet, its registration status changes to INIT.
Example
# Display the registration status of a DecoySensor on a Decoy.
<HUAWEI> display deception decoy status
Decoy register status information:
Register status : alive
Decoy select : master
Online time : 37062(s)
Send heartbeat timeout : 0(s)
Receive heartbeat timeout : 5(s)
Decoy register port information:
445 80 8080 443 22
3389 21 3306 6379
Send heartbeat Period after the DecoySensor sent the last heartbeat
timeout packet, in seconds.
Format
display deception instance
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
None
Example
# Check whether the deception process is normal.
<HUAWEI> display deception instance
------------------------------------------------------------------------------------------------------------
decpt * * normal
------------------------------------------------------------------------------------------------------------
Item Description
State Status:
● normal
● abnormal
Format
display deception interface
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
You can run this command to view information about all deception-enabled
interfaces, including the interface name, VLAN ID, and election status of interfaces
for detecting IP address scanning. If a detected network segment has been
configured using the deception detect-network command, the deception
function can be configured only on the interfaces whose IP addresses are on the
detected network segment.
Precautions
Interfaces whose IP addresses are not on the detected network segment cannot
detect IP address scanning or participate in the election.
Example
# Display information about all deception-enabled interfaces.
<HUAWEI> display deception interface
----------------------------------------------------------------------------------------------------------
Current total number = 0
----------------------------------------------------------------------------------------------------------
name ip-address vlan election-state master-ip vpn-instance
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
Item Description
Item Description
Function
The display deception ip-redirect command displays information about deceived
traffic due to the scanning of offline IP addresses.
Format
display deception ip-redirect [ source-ip ip-address ] [ destination-ip ip-
address ] [ destination-port port ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
None
Example
# Display information about deceived traffic due to the scanning of offline IP
addresses.
<HUAWEI> display deception ip-redirect
--------------------------------------------------------------------------------
Current total number = 1
--------------------------------------------------------------------------------
source destination port out-vlan vpn-instance left-time(s) packets
--------------------------------------------------------------------------------
10.1.1.1 10.1.1.2 * 10 public 432 0
--------------------------------------------------------------------------------
Format
display deception ip-state [ ip-address ] [ verbose ]
Parameters
Parameter Description Value
ip-address Displays the online status of a specified The value is in dotted
IP address. decimal notation.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
A switch checks the online status of IP addresses every 30 minutes. If traffic
destined for address A is deceived, the interval for checking the online status of
address A is shortened to 10 to 110 seconds to minimize the adverse impact on
network services. The interval depends on the number of the deceived source
addresses. More source addresses result in a longer interval.
The display deception ip-state command output does not contain the IP address
online status if the deception detect-network command is not used to set any
detected network segment.
Precautions
The IP addresses scanned by the DecoySensor must be on the detected network
segment, and the DecoySensor has an IP address belonging to this network
segment.
The reset deception ip-state command clears the IP address online status and
immediately initiates the check on the online status of IP addresses.
Example
# Display the online status of IP addresses scanned by the switch.
<HUAWEI> display deception ip-state
---------------------------------------------------------------------------------------------------
Current total number = 0
---------------------------------------------------------------------------------------------------
ip-address state vlan vpn-instance
---------------------------------------------------------------------------------------------------
10.1.1.1 information:
---------------------------------------------------------------------------------------
state :online
vlan :10
vpn-instance :
proxy_flag :1
on2off_flag :0
redirect_num :0
---------------------------------------------------------------------------------------
Total displayed = 1
Item Description
ip-address IP address.
Function
The display deception port-redirect command displays information about
deceived traffic due to the scanning of unopened TCP ports.
Format
display deception port-redirect [ source-ip ip-address ] [ destination-ip ip-
address ] [ destination-port port ]
Parameters
Parameter Description Value
source-ip ip-address Specifies the source IP The value is in dotted
address of the deceived decimal notation.
traffic.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
If it is found that deceived traffic is normal service traffic, run the reset deception
port-redirect command to delete the corresponding entry from the deception
flow table to release the traffic.
Example
# Display information about deceived traffic due to the scanning of unopened TCP
ports.
<HUAWEI> display deception port-redirect
---------------------------------------------------------------------------------------------------
Current total number = 0
---------------------------------------------------------------------------------------------------
source destination port out-vlan vpn-instance packets left-
time(s)
---------------------------------------------------------------------------------------------------
Item Description
Item Description
Format
display deception port-state [ ip-address ]
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
When a service host is busy, it responds with the RST-ACK packet even to normal
TCP access. As a result, the DecoySensor incorrectly considers that the host port is
not opened and deceives normal traffic. The DecoySensor records the port
openness status based on the SYN-ACK packet returned by the service host and
saves the record for 24 hours, until the record ages naturally or updated when a
new SYN-ACK packet is generated. During this period, even if the DecoySensor
receives the RST-ACK packet from the corresponding port, it does not deceive the
traffic.
The DecoySensor records only the port openness status for TCP access requests
whose destination IP addresses are in the detected network segment. The
prerequisite for the DecoySensor to record the port openness status is that the in-
depth interaction services must be supported by the Decoy.
The reset deception port-state command clears the current port openness status.
Examples
# Display the port openness status of a service host.
<HUAWEI> display deception port-state
--------------------------------------------------------------------------------
Current total number = 2
--------------------------------------------------------------------------------
ip-address :192.168.1.1
vpn-instance :public port state time_out(h)
80 open 24
8080 open 24
445 open 24
ip-address :192.168.1.2
vpn-instance :public
port state time_out(h)
80 open 24
8080 open 24
445 open 2
Item Description
port Port
Function
The display deception statistics command displays deception statistics.
Format
display deception statistics
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To clear deception statistics, run the reset deception statistics command. Then,
run the display deception statistics command to view deception statistics in this
period.
Example
# Display deception statistics.
<HUAWEI> display deception statistics
Dataplane normal statistics information:
Receive local ip pkts : 9466
Receive arp request pkts : 143087
Receive arp reply pkts : 8671
Receive don't need check pkts : 9471
Receive from decoy pkts : 18605
Receive from decoy reg acks : 14884
Receive from decoy heartbeats : 3721
Constructor arp request pkts : 8216
Constructor arp reply pkts : 3860
Send to decoy pkts : 14884
Send to decoy regs : 14884
Send channel success pkts : 12076
Dataplane discard statistics information:
Send to decoy failed logs : 226
VPN header illegal packets discarded : 14884
Dataplane error statistics information:
Item Description
Rpc msg send success Number of RPC messages that have been successfully
sent.
Rpc msg recv success Number of RPC messages that have been successfully
received.
Item Description
Rpc msg send instance Number of RPC messages that fail to be sent because
not exist the instance does not exist.
Rpc msg recv poll Statistics about message query failures on the receiver.
failed
Send RPC msg success Number of RPC messages that have been successfully
sent.
Receive tcp decoy Number of received packets that match the bait
network pkts network segment
Item Description
Receive from decoy Number of received registration reply packets from the
reg acks Decoy
Receive from decoy Number of packets received from the Decoy for
update decoy ports updating the honeypot service port
Receive aci syn pkts Number of received SYN packets matching ACI entries
Constructor arp
request pkts Number of constructed ARP requests
Send to decoy
heartbeats Number of heartbeat packets sent to the Decoy
Item Description
Dns answer query pkts Number of DNS request packets responded using the
for aci ACI function
Dns answer respond Number of DNS reply packets modified using the ACI
pkts function
Aci forward syn pkts Number of SYN packets forwarded using the ACI
function
Aci decoy syn pkts Number of SYN packets discarded or deceived using
the ACI function
Send RPC msg failed Number of RPC messages that fail to be sent
Arp malloc node failed Number of packets discarded due to ARP table node
pkts application failures
Item Description
Ip port table malloc Number of packets discarded due to port table node
node failed pkts application failures
Send to decoy failed Number of heartbeat packets that fail to be sent to the
heartbeats Decoy
Send to decoy failed Number of log packets that fail to be sent to the
logs Decoy
Send to decoy failed Number of IP status packets that fail to be sent to the
iplist Decoy
IP header illegal
packets discarded Number of packets discarded due to invalid IP headers
IP frag packets
discarded Number of discarded IP fragments
Item Description
Arp extend type illegal Statistics of packets discarded due to invalid ARP
packets discarded extended types
Log cache num limit Number of logs that are not merged when the number
not merge of cached logs reaches the upper limit
Log cache num limit Number of logs that are not sent when the number of
not send cached logs reaches the upper limit
Aci source ip limit add Number of ACI entry creation failures due to the limit
fail on the number of source addresses that can be cached
Smbuf pool head null Number of Smbuf resource application failures due to
an empty Smbuf resource head
Smbuf pool bad free Number of Smbuf resource application failures due to
flag an incorrect release verification value of the Smbuf
resource
Function
The display deception syn-connect command displays the TCP port scanning
behavior detected by the switch.
Format
display deception syn-connect [ source-ip ip-address ]
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to check the TCP port scanning behavior detected by
the switch, so that you can configure a more accurate TCP port scanning threshold
using the deception syn-connect rate command. If a TCP port is scanned at a
lower frequency than the threshold specified by the deception syn-connect rate
command but have been scanned for many times, the scanning behavior may be
an attack.
Example
# Display the TCP port scanning behavior detected by the switch.
<HUAWEI> display deception syn-connect
---------------------------------------------------------------------------------------------------
Current total number = 0
---------------------------------------------------------------------------------------------------
source rate(num/s)number vlan vpn-instance
---------------------------------------------------------------------------------------------------
Item Description
Function
The display deception version command displays the DecoySensor version.
Format
display deception version
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
The DecoySensor and Decoy need to be used together, and they can communicate
with each only when their versions are the same.
Example
# Display the DecoySensor version.
<HUAWEI> display deception version
Version 1.1.0
Item Description
Function
The display deception whitelist command displays the deception whitelist.
Format
display deception whitelist [ id id-number ]
Parameters
Parameter Description Value
id id-number Specifies a whitelist ID. The value is an integer in the range from
1 to 50.
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After configuring a deception whitelist using the deception whitelist command,
you can run the display deception whitelist command to check whether the
deception whitelist is correctly configured.
Example
# Display deception whitelists.
<HUAWEI> display deception whitelist
---------------------------------------------------------------------------------------------------
Current total number = 1
---------------------------------------------------------------------------------------------------
Whitelist ID 1 information:
---------------------------------------------------------------------------------------------------
source/mask :192.168.10.10/255.255.255.255
destination/mask :any
vpn-instance :
Item Description
Function
The reset deception aci command updates ACI entries.
Format
reset deception aci
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
After the ACI suffix is changed, you need to update the ACI entries. Otherwise, the
old ACI suffix becomes invalid only after the ACI entries age.
After the ACI entries are updated, the access initiated by a terminal is deceived
when the DNS record of the terminal does not age. Therefore, change the ACI
suffix when no service traffic exists.
Example
# Update ACI entries.
<HUAWEI> reset deception aci
Warning:Reseting aci table will affect the normal service. Continue? [Y/N]:y
Format
reset deception arp-proxy
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
None
Example
# Clear the interface IP address of the switch and the target IP addresses in the
proxy ARP requests sent to the switch in the online IP address table.
<HUAWEI> reset deception arp-proxy
Format
reset deception ip-state
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
The reset deception ip-state command clears the IP address online status and
immediately initiates the check on the online status of IP addresses. There are two
exceptions:
● If traffic destined for address A is deceived, the online status of address A is
not cleared.
● The online status of IP addresses learned through proxy ARP is not cleared.
Example
# Update the online status of IP addresses on the network where the switch is
located.
<HUAWEI> reset deception ip-state
Function
The reset deception port-redirect command clears information about deceived
traffic that scanned unopened TCP ports and stops port deception.
Format
reset deception port-redirect [ source-ip ip-address ] [ destination-ip ip-
address ] [ destination-port port ]
Parameters
Parameter Description Value
source-ip ip-address Specifies the source IP The value is in dotted
address of the deceived decimal notation.
traffic.
Views
User view
Default Level
3: Management level
Usage Guidelines
If it is found that deceived traffic is normal service traffic based on the display
deception port-redirect command, run the reset deception port-redirect
command to delete the corresponding entry from the deception flow table to
release the traffic.
Example
# Clear information about deceived traffic that scanned unopened TCP ports and
stop port deception.
<HUAWEI> reset deception port-redirect
Format
reset deception port-state
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
The DecoySensor records the port openness status based on the SYN-ACK packet
returned by the service host and saves the record for 24 hours, until the record
ages naturally or updated when a new SYN-ACK packet is generated. During this
period, even if the DecoySensor receives the RST-ACK packet from the
corresponding port, it does not deceive the traffic.
If the service openness status of the service host is updated, update the record in a
timely manner.
Examples
# Update the port openness status of a service host.
<HUAWEI> reset deception port-state
Format
reset deception statistics
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
To clear deception statistics, run the reset deception statistics command. Then,
run the display deception statistics command to view deception statistics in this
period.
Example
# Clear deception statistics.
<HUAWEI> reset deception statistics
Format
display terminal configuration
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After running the terminal command to manually enter terminal information, you
can run the display terminal configuration command to check the manually
entered terminal information.
Example
# Display the manually entered terminal information.
<HUAWEI> display terminal configuration
---------------------------------------------------------------------------------------
MAC Address IP Address Mask Interface Category
---------------------------------------------------------------------------------------
00e0-fc11-1111 10.10.1.1 - - printer
00e0-fc11-1112 10.10.1.2 255.255.255.0 - printer
---------------------------------------------------------------------------------------
Total items displayed = 2
Item Description
Function
The display terminal information command displays terminal entries.
Format
display terminal information { all | mac-address mac-address }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
You can run this command to view terminal entries, including the MAC address,
type, access interface, anomaly detection result, isolation status, and aging time of
the terminal.
The device generates an entry for a terminal only when the terminal information
manually entered using the terminal command matches the ARP packets sent by
the terminal. Then you can run this command to view the terminal entry.
Example
# Display entries of all terminals.
<HUAWEI> display terminal information all
Status: N - Normal, F - Flow abnormal U - Unknown
IP - Ip abnormal, INT - Interface abnormal
INTIP - Interface and ip abnormal
------------------------------------------------------------------------------------------------------------
MAC Address Category Ip Address Interface Status Isolation Inspect Expire(minute)
------------------------------------------------------------------------------------------------------------
00e0-fc11-1111 Printer 10.1.10.1 GigabitEthernet0/0/1 N No Enable 30
00e0-fc22-2222 Ip-camera 10.1.20.1 GigabitEthernet0/0/2 N No Enable 24
------------------------------------------------------------------------------------------------------------
Total: 1, printed: 1
Item Description
Item Description
Function
The display terminal-inspect abnormal-reason command displays the terminal
anomaly cause.
Format
display terminal-inspect abnormal-reason { all | mac-address mac-address }
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
You can run this command to check the anomaly cause of a terminal.
Prerequisites
The terminal-inspect flow enable command has been run in the system view to
enable terminal anomaly detection globally.
Example
# Display the anomaly causes of all terminals.
<HUAWEI> display terminal-inspect abnormal-reason all
---------------------------------
MAC AbnormalReason
---------------------------------
00e0-fc11-1111 stream-model
00e0-fc11-1112 stream-model
---------------------------------
Total: 2, printed: 2
Item Description
Item Description
Function
The display terminal-inspect cache-data command displays terminal traffic data
cached on the device.
Format
display terminal-inspect cache-data [ mac-address mac-address ]
Parameters
Parameter Description Value
mac-address Specifies the MAC The value must be the MAC address of
mac-address address of a an existing terminal.
terminal.
The value is in H-H-H format. An H is a
4-digit hexadecimal number.
Views
All view
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
After the terminal-inspect cache-data command is run to enable the traffic data
caching function for a terminal, you can run the display terminal-inspect cache-
data command to view the traffic data of the terminal.
Prerequisites
1. The terminal-inspect flow enable command has been run in the system
view to enable terminal anomaly detection globally.
2. The terminal-inspect cache-data command has been run in the system view
to enable the traffic data caching function for a terminal.
Precautions
A maximum of 128 terminal traffic data records can be displayed on the device,
and the latest 128 records are saved in time sequence.
Example
# Display terminal traffic data cached on the device.
<HUAWEI> display terminal-inspect cache-data
MAC: 00e0-fc11-1111
-------------------------------------------------------------------------------------
TimeStamp SrcMac DstMac SrcPort DstPort Protocol Byte Packet
-------------------------------------------------------------------------------------
8743 00e0-fc11-1111 00e0-fc22-2222 0 1000 17 34688 271
-------------------------------------------------------------------------------------
Total: 1, printed: 1
Item Description
Function
The display terminal-inspect category command displays the types of terminals
for which terminal anomaly detection is enabled.
Format
display terminal-inspect category
Parameters
None
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
After the terminal anomaly detection function is enabled, you can run this
command to view the terminal types.
Prerequisites
The terminal-inspect flow enable command has been run in the system view to
enable terminal anomaly detection globally.
Example
# Display the types of terminals for which terminal anomaly detection is enabled.
<HUAWEI> display terminal-inspect category
--------------------
Id Category
--------------------
1 ip-camera
2 voip-phone
--------------------
Total: 2
Item Description
Id Terminal ID.
Format
display terminal-inspect result { all | mac-address mac-address }
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
You can run this command to view the comprehensive anomaly detection result of
the traffic behavior model of a terminal, including the update time of the
detection result, MAC address of the terminal, and detection result.
Example
# Display the anomaly detection results of all terminals.
<HUAWEI> display terminal-inspect result all
---------------------------------------------
Mac-address Time Result
---------------------------------------------
00e0-fc11-1111 2021-04-29 13:10:07 abnormal
00e0-fc22-2222 2021-04-29 13:10:07 abnormal
---------------------------------------------
Total: 2, printed: 2
Item Description
Function
The display terminal-inspect supervised abnormal-reason command displays
the anomaly degree of terminal detection indicators.
Format
display terminal-inspect supervised abnormal-reason { all | mac-address mac-
address }
Parameters
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
To locate terminal anomaly problems, you can run this command to check the
anomaly degree of terminal detection indicators for further analysis. Exercise
caution when running the display terminal-inspect supervised abnormal-reason
all command. Excessive information output affects system performance.
Example
# Display the anomaly degree of detection indicators for the terminal whose MAC
address is 00e0-fc11-1111.
<HUAWEI> system-view
[HUAWEI] diagnose
[HUAWEI-diagnose] display terminal-inspect supervised abnormal-reason mac-address 00e0-fc11-1111
UpstreamTrafficRate: upstream traffic rate of a terminal
DownstreamTrafficRate: downstream traffic rate of a terminal
TotalTrafficRate: total traffic rate of a terminal
DestinationPort: destination port number in packets sent by a terminal
Ratio: ratio of the upstream traffic rate to the downstream traffic rate of a terminal
----------------------------------------------------------------------------------------------------------------------------
MAC UpstreamTrafficRate DownstreamTrafficRate TotalTrafficRate DestinationPort
Ratio
00e0-fc11-1111 82% 1% 4% 4% 9%
----------------------------------------------------------------------------------------------------------------------------
Total: 1, printed: 1
Function
The display terminal-inspect terminal-list command displays the list of
terminals under anomaly detection.
Format
display terminal-inspect [ category category-name ] terminal-list
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
Usage Scenario
This command displays only the terminals that are enabled with anomaly
detection and are not isolated.
Prerequisites
The terminal-inspect flow enable command has been run in the system view to
enable terminal anomaly detection globally.
Example
# Display the list of all terminals under anomaly detection.
<HUAWEI> display terminal-inspect terminal-list
------------------------------
MAC Category
------------------------------
00e0-fc11-1111 ip-camera
00e0-fc22-2222 voip-phone
------------------------------
Total: 2, printed: 2
Item Description
Format
display terminal-isolate { apply | exclude } configuration
Parameters
Parameter Description Value
Views
All views
Default Level
1: Monitoring level
Usage Guidelines
After a terminal isolation policy is configured, you can run this command to view
the configuration of the terminal isolation policy.
Example
# Display the terminal isolation policy applied to the device.
<HUAWEI> display terminal-isolate apply configuration
-------------------------------------------------------------------------------------------
Category MAC Address Block Period(minutes) Template Name
-------------------------------------------------------------------------------------------
printer 00e0-fc11-1111 YES 35 test1
printer 00e0-fc22-2222 NO 20 test2
-------------------------------------------------------------------------------------------
Total items = 2
Item Description
Function
The reset terminal-inspect cache-data command clears the terminal traffic data
cached on the device.
Format
reset terminal-inspect cache-data
Parameters
None
Views
User view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To view the latest terminal traffic data, run the reset terminal-inspect cache-
data command to clear the cached terminal traffic data. After a period of time,
run the display terminal-inspect cache-data command to view the cached
terminal traffic data.
Prerequisites
1. The terminal-inspect flow enable command has been run in the system
view to enable terminal anomaly detection globally.
2. The terminal-inspect cache-data command has been run in the system view
to enable the traffic data caching function for a terminal.
Example
# Clear the terminal traffic data cached on the device.
<HUAWEI> reset terminal-inspect cache-data
14.23.12 terminal
Function
The terminal command allows you to manually enter terminal information.
The undo terminal command deletes the manually entered terminal information.
By default, no terminal information is manually entered on the device.
Format
terminal { mac-address mac-address [ ip-address ip-address | interface
interface-type interface-number ] | ip-address ip-address { mask | mask-length } |
interface { interface-type interface-number &<1-8> | interface-type interface-
number1 to interface-number2 } } category { printer | voip-phone | ip-camera }
undo terminal { mac-address mac-address | ip-address ip-address { mask | mask-
length } | interface { interface-type interface-number &<1-8> | interface-type
interface-number to interface-number } }
undo terminal { mac-address | ip-address | interface } all
Parameters
Parameter Description Value
interface-type Specifies the type and The interface type cannot be set
interface- number of an interface. to Eth-Trunk.
number
interface-type Specifies the type and The interface type cannot be set
interface- number of an interface. to Eth-Trunk.
number1 to interface-number1 and
interface- interface-number2 specify In a stack, interface-number1 and
number2 an interface range. interface-number2 cannot reside
on different devices. That is, the
interface-number1 specifies slot IDs of the interfaces
the number of the first corresponding to interface-
interface, and interface- number1 and interface-number2
number2 specifies the must be the same.
number of the last
interface.
The value of interface-
number2 must be larger
than that of interface-
number1.
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can run this command to manually enter the MAC address, IP address, type,
and access interface of a terminal.
Precautions
If different terminals have the same MAC address, their information cannot be
recorded.
The device generates an entry for a terminal only when the terminal information
manually entered using the terminal command matches the ARP packets sent by
the terminal and terminal anomaly detection has been enabled globally using the
terminal-inspect flow enable command. Then you can run the display terminal
information command to view the terminal entry information.
You can run this command to manually enter the access interface information of a
terminal only when the device is directly connected to the terminal. Otherwise, the
terminal may be incorrectly identified.
Example
# Manually enter the following terminal information: The terminal MAC address is
00e0-fc11-1111, the IP address is 10.1.1.1, and the terminal type is printer.
<HUAWEI> system-view
[HUAWEI] terminal mac-address 00e0-fc11-1111 ip-address 10.1.1.1 category printer
Format
terminal-inspect cache-data mac-address mac-address [ max-num max-num ]
undo terminal-inspect cache-data mac-address mac-address [ max-num max-
num ]
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
If the algorithm used for terminal anomaly detection is incorrect, engineers need
to analyze the original traffic data to locate the problem. To view the traffic data
of a terminal, run the terminal-inspect cache-data command to enable the
traffic data caching function for the terminal. If you want to delete the cached
traffic data of a terminal and disable the device from caching the traffic data of
the terminal, run the undo terminal-inspect cache-data command to disable the
traffic data caching function for the terminal.
Prerequisites
The terminal-inspect flow enable command has been run in the system view to
enable terminal anomaly detection globally.
Follow-up Procedure
Precautions
If you run this command multiple times, only the latest configuration takes effect.
Example
# Enable the traffic data caching function for the terminal whose MAC address is
00e0-fc12-3456.
<HUAWEI> system-view
[HUAWEI] terminal-inspect cache-data mac-address 00e0-fc12-3456
Function
The terminal-inspect category command enables terminal anomaly detection for
a specified type of terminal.
Format
terminal-inspect category { printer | voip-phone | ip-camera } [ [ exclude ]
mac-address mac-address ]
undo terminal-inspect category { printer | voip-phone | ip-camera }
[ [ exclude ] mac-address mac-address ]
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can run the terminal-inspect category command to enable terminal
anomaly detection for a specified type of terminal. After this command is
configured, the device compares the traffic behavior model with the actual traffic
behavior of the terminal to determine whether the traffic behavior of the terminal
is abnormal.
The following uses printers as an example to describe how to use the terminal-
inspect category command:
Example
# Enable terminal anomaly detection for all printers.
<HUAWEI> system-view
[HUAWEI] terminal-inspect category printer
Format
terminal-inspect flow enable
undo terminal-inspect flow
Parameters
None
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
You can run the terminal-inspect flow enable command to enable terminal
anomaly detection globally.
After terminal anomaly detection is enabled globally, the device sends the ARP
packet received from a terminal to the CPU, and checks whether the IP address
and access interface of the terminal are abnormal based on the terminal entry.
The device generates an entry for a terminal only when the terminal information
manually entered by the administrator matches the ARP packet sent by the
terminal and the device sends the ARP packet to the CPU.
Precautions
● The terminal-inspect flow enable command is mutually exclusive with the
following commands:
– s-ipfpm measure flow (enables packet loss and delay measurement)
– s-ipfpm measure auto-detect (enables automatic in-band flow
measurement)
– ip netstream (enables IPv4 traffic statistics collection on the inbound
and outbound interfaces)
– ipv6 netstream (enables IPv6 traffic statistics collection on the inbound
and outbound interfaces)
Example
# Enable terminal anomaly detection globally.
<HUAWEI> system-view
[HUAWEI] terminal-inspect flow enable
Format
terminal-isolate category { printer | voip-phone | ip-camera } { [ mac-address
mac-address ] apply template template-name | exclude mac-address mac-
address }
undo terminal-isolate category { printer | voip-phone | ip-camera } { [ mac-
address mac-address ] apply template template-name | exclude mac-address
mac-address }
undo terminal-isolate { apply | exclude } all
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
To implement the terminal isolation action configured in a terminal isolation
template for abnormal terminals of a specified type, run the terminal-isolate
category { printer | voip-phone | ip-camera } [ mac-address mac-address ]
apply template template-name command to apply the configured isolation
template to all terminals of this type. Then if a terminal of this type does not need
to be isolated, you can run the terminal-isolate category { printer | voip-phone |
ip-camera } exclude mac-address mac-address command to add the terminal to
the isolation whitelist.
Precautions
Before running the terminal-isolate category { printer | voip-phone | ip-
camera } [ mac-address mac-address ] apply template template-name
command, run the terminal-isolate template command to create a terminal
isolation template. To make the terminal isolation template take effect, you must
run the terminal-isolate action command in the terminal isolation template to
configure a terminal isolation action.
Example
# Apply the isolation template named test to all printers. In the isolation
template, set the terminal isolation action to block.
<HUAWEI> system-view
[HUAWEI] terminal-isolate template test
[HUAWEI-terminal-isolate-test] terminal-isolate action block
[HUAWEI-terminal-isolate-test] quit
[HUAWEI] terminal-isolate category printer apply template test
Format
terminal-isolate template template-name
undo terminal-isolate template template-name
Parameters
Parameter Description Value
Views
System view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Follow-up Procedure
Example
# Create a terminal isolation template named test.
<HUAWEI> system-view
[HUAWEI] terminal-isolate template test
Function
The terminal-isolate action command configures a terminal isolation action.
Format
terminal-isolate action block
Parameters
Parameter Description Value
Views
Terminal isolation template view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When configuring a terminal isolation policy, you need to run the terminal-
isolate template command to create a terminal isolation template, configure a
terminal isolation action in the terminal isolation template view, and run the
terminal-isolate category command to bind the terminal isolation template to a
specified type of terminal.
When the terminal isolation action is set to block, the device discards packets
from spoofed terminals identified by the device.
Follow-up Procedure
Example
# In the isolation template named test, set the terminal isolation action to block.
<HUAWEI> system-view
[HUAWEI] terminal-isolate template test
[HUAWEI-terminal-isolate-test] terminal-isolate action block
Function
The terminal-isolate period command sets the aging time of a terminal isolation
action.
By default, the aging time is not configured for a terminal isolation action,
meaning that a terminal isolation action does not age.
Format
terminal-isolate period period-time
Parameters
Views
Terminal isolation template view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
When configuring a terminal isolation policy, you need to run the terminal-
isolate template command to create a terminal isolation template, configure a
terminal isolation action and the aging time of the action in the terminal isolation
template view, and run the terminal-isolate category command to bind the
terminal isolation template to a specified type of terminal.
By default, the aging time is not configured for a terminal isolation action,
meaning that the device always implements the configured terminal isolation
action for the identified spoofed terminals. To prevent abnormal terminals from
being isolated after recovery, you can run the terminal-isolate period command
to set the aging time of the terminal isolation action. When the aging time
arrives, the device re-identifies whether the terminal is a spoofed terminal and
determines whether to implement the configured terminal isolation action.
Prerequisites
The terminal-isolate action command has been run in the terminal isolation
template view to configure a terminal isolation action.
Follow-up Procedure
Example
# Configure an isolation template named test, set the terminal isolation action to
block, and set the aging time of the terminal isolation action to 60 minutes. Apply
the isolation template named test to all printers.
<HUAWEI> system-view
[HUAWEI] terminal-isolate template test
[HUAWEI-terminal-isolate-test] terminal-isolate action block
[HUAWEI-terminal-isolate-test] terminal-isolate period 60
[HUAWEI-terminal-isolate-test] quit
[HUAWEI] terminal-isolate category printer apply template test
14.24.1 ah authentication-algorithm
Function
The ah authentication-algorithm command specifies the authentication
algorithm for AH protocol.
NOTE
All models support this command, except S200, S1730S-S and S1730S-S1.
Format
ah authentication-algorithm md5
Parameters
Parameter Description Value
Views
IPSec proposal view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
IPSec can use AH protocol to authenticate packets, preventing packets from being
intercepted or modified, you can run the ah authentication-algorithm command
to configure the authentication algorithm for AH protocol.
Prerequisite
The protocol of this IPSec proposal has been configured to AH using the
transform command.
Precautions
Example
# Configure the IPSec proposal prop1 to use the AH protocol, and specify MD5 as
the authentication algorithm.
<HUAWEI> system-view
[HUAWEI] ipsec proposal prop1
[HUAWEI-ipsec-proposal-prop1] transform ah
[HUAWEI-ipsec-proposal-prop1] ah authentication-algorithm md5
14.24.2 dh
Function
The dh command specifies a DH group used for IKE negotiation.
NOTE
All models support this command, except S200, S1730S-S and S1730S-S1.
Format
dh { group1 | group2 | group5 }
Parameters
Parameter Description Value
Views
Efficient VPN policy view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
Example
# Specify the 1024-bit DH group in IKE negotiation phase 1.
<HUAWEI> system-view
[HUAWEI] ipsec efficient-vpn evpn mode client
[HUAWEI-ipsec-efficient-vpn-evpn] dh group2
NOTE
All models support this command, except S200, S1730S-S and S1730S-S1.
Format
esp authentication-algorithm md5
Parameters
Parameter Description Value
Views
IPSec proposal view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
IPSec can use ESP protocol to authenticate and encrypt packets, preventing
packets from being intercepted or modified, you can run the esp authentication-
algorithm command to configure the authentication algorithm for ESP protocol.
Prerequisite
The protocol of this IPSec proposal has been configured to ESP using the
transform command.
Precautions
The authentication algorithms on both IPSec peers must be identical.
The authentication algorithm and encryption algorithm for ESP protocol cannot be
both set to NULL.
Example
# Configure the IPSec proposal prop1 to use the ESP protocol, and specify MD5 as
the authentication algorithm.
<HUAWEI> system-view
[HUAWEI] ipsec proposal prop1
[HUAWEI-ipsec-proposal-prop1] transform esp
[HUAWEI-ipsec-proposal-prop1] esp authentication-algorithm md5
NOTE
All models support this command, except S200, S1730S-S and S1730S-S1.
Format
esp encryption-algorithm des
Parameters
Parameter Description Value
Views
IPSec proposal view
Default Level
2: Configuration level
Usage Guidelines
Usage Scenario
IPSec can use ESP protocol to authenticate and encrypt packets, preventing
packets from being intercepted or modified, you can run the esp encryption-
algorithm command to configure the encryption algorithm for ESP protocol.
Prerequisite
The protocol of this IPSec proposal has been configured to ESP using the
transform command.
Precautions
The encryption algorithms on both IPSec peers must be identical.
The authentication algorithm and encryption algorithm for ESP protocol cannot be
both set to NULL.
Example
# Configure the IPSec proposal prop1 to use the AH protocol, and specify DES as
the encryption algorithm.
<HUAWEI> system-view
[HUAWEI] ipsec proposal prop1
[HUAWEI-ipsec-proposal-prop1] transform esp
[HUAWEI-ipsec-proposal-prop1] esp encryption-algorithm des
Format
load-module weakea
Parameters
None
Views
User view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before installing the WEAKEA plug-in, run the load-module weakea command in
the user view to load the WEAKEA plug-in (for example, xxxWEAKEA.mod) from
the system software to the plug-in installation directory $_install_mod.
Follow-up Procedure
Precautions
Example
# Load the WEAKEA plug-in from the system software.
<HUAWEI> load-module weakea
14.24.6 pfs
Function
The pfs command enables PFS when the local end initiates IPSec tunnel
negotiation.
NOTE
All models support this command, except S200, S1730S-S and S1730S-S1.
Format
pfs { dh-group1 | dh-group2 | dh-group5 }
Parameters
Views
Efficient VPN policy view
Default Level
2: Configuration level
Usage Guidelines
When the local end initiates negotiation, there is an additional DH exchange in
IKEv1 phase 2 or IKEv2 CREATE_CHILD_SA exchange. The additional DH exchange
ensures security of the IPSec SA key and improves communication security.
Example
# Enable PFS (using the 1024-bit DH group) when the local end initiates IPSec
tunnel negotiation.
<HUAWEI> system-view
[HUAWEI] ipsec efficient-vpn evpn mode client
[HUAWEI-ipsec-efficient-vpn-evpn] pfs dh-group2
Format
pki export rsa-key-pair key-name [ and-certificate certificate-name ] { pem file-
name [ 3des | des ] | pkcs12 file-name } password password
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
Before transferring or backing up an RSA key pair, run this command to enable the
device to generate the PEM or PKCS12 file carrying this RSA key pair (which may
include the certificate) in its flash memory.
Before using this command, run the display pki rsa local-key-pair command to
view RSA key pair information on the device.
Prerequisites
The RSA key pair has been created and configured to be exportable using the pki
rsa local-key-pair create command, or it has been imported to the device
memory and configured to be exportable using the pki import rsa-key-pair
command.
Precautions
The RSA key pair is sensitive information. Delete and destroy the exported RSA key
pair on the device or storage device immediately after you do not need it.
Example
# Export the RSA key pair key1 to the file aaa.pem and set the encryption mode
to DES.
<HUAWEI> system-view
[HUAWEI] pki rsa local-key-pair create key1 exportable
Info: The name of the new key-pair will be: key1
The size of the public key ranges from 512 to 4096.
Input the bits in the modules:2048
Generating key-pairs...
......+++
....................+++
[HUAWEI] pki export rsa-key-pair key1 pem aaa.pem DES password Admin@1234
Warning: Exporting the key pair impose security risks, are you sure you want to
export it? [y/n]:y
Info: Succeeded in exporting the RSA key pair in PEM format.
Format
set cipher-suite { tls12_ck_rsa_aes_256_cbc_sha256 |
tls1_ck_dhe_dss_with_aes_128_sha | tls1_ck_dhe_dss_with_aes_256_sha |
tls1_ck_dhe_rsa_with_aes_128_sha | tls1_ck_dhe_rsa_with_aes_256_sha |
tls1_ck_rsa_with_aes_128_sha | tls1_ck_rsa_with_aes_256_sha }
Parameters
Parameter Description Value
Views
Customized SSL cipher suite policy view
Default Level
3: Management level
Usage Guidelines
Usage Scenario
To configure cipher suites for a customized SSL cipher suite policy, run the set
cipher-suite command.
Precautions
If a customized SSL cipher suite policy is being referenced by an SSL policy, the
cipher suites in the customized cipher suite policy can be added, modified, or
partially deleted. Deleting all of the cipher suites is not allowed.
Example
# Configure the tls12_ck_rsa_aes_256_cbc_sha256 cipher suite for the customized
SSL cipher suite policy named cipher1.
<HUAWEI> system-view
[HUAWEI] ssl cipher-suite-list cipher1
[HUAWEI-ssl-cipher-suite-cipher1] set cipher-suite tls12_ck_rsa_aes_256_cbc_sha256
Format
ssh client cipher { des_cbc | 3des_cbc | aes128_cbc | aes256_cbc } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
An SSH server and a client need to negotiate an encryption algorithm for the
packets exchanged between them. You can run the ssh client cipher command to
configure an encryption algorithm list for the SSH client. After the SSH server
receives a packet from the client, the server matches the encryption algorithm list
of the client against its local list and selects the first matched encryption
algorithm. If no encryption algorithm matches, the negotiation fails.
Example
# Configure CBC encryption algorithms for an SSH client.
<HUAWEI> system-view
[HUAWEI] ssh client cipher aes128_cbc aes256_cbc
Function
The ssh client hmac command configures an HMAC algorithm list for an SSH
client.
The undo ssh client hmac command restores the default HMAC algorithm list of
an SSH client.
Format
ssh client hmac { md5 | md5_96 | sha1 | sha1_96 | sha2_256_96 } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
An SSH server and a client need to negotiate an HMAC algorithm for the packets
exchanged between them. You can run the ssh client hmac command to
configure an HMAC algorithm list for the SSH client. After the SSH server receives
a packet from the client, the server matches the list of the client against its local
list and selects the first matched HMAC algorithm. If no matched HMAC
algorithms, the negotiation fails.
Example
# Configure the HMAC sha2_256_96 algorithm for an SSH client.
<HUAWEI> system-view
[HUAWEI] ssh client hmac sha2_256_96
Format
ssh client key-exchange { dh_group14_sha1 | dh_group1_sha1 |
dh_group_exchange_sha1 }*
undo ssh client key-exchange
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
The client and server negotiate the key exchange algorithm used for packet
transmission. You can run the ssh client key-exchange command to configure a
key exchange algorithm list for the SSH client. The SSH server compares the
configured key exchange algorithm list with the counterpart sent by the client and
then selects the first matched key exchange algorithm for packet transmission. If
the key exchange algorithm list sent by the client does not match any algorithm in
the key exchange algorithm list configured on the server, the negotiation fails.
Example
# Configure key exchange algorithm lists dh_group1_sha1 on the SSH client.
<HUAWEI> system-view
[HUAWEI] ssh client key-exchange dh_group1_sha1
Function
The ssh server cipher command configures an encryption algorithm list for an
SSH server.
The undo ssh server cipher command restores the default encryption algorithm
list of an SSH server.
Format
ssh server cipher { des_cbc | 3des_cbc | aes128_cbc | aes256_cbc } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
An SSH server and a client need to negotiate an encryption algorithm for the
packets exchanged between them. You can run the ssh server cipher command to
configure an encryption algorithm list for the SSH server. After the SSH server
receives a packet from the client, the server matches the encryption algorithm list
of the client against its local list and selects the first matched encryption
algorithm. If no matched encryption algorithms, the negotiation fails.
Example
# Configure CBC encryption algorithms for an SSH server.
<HUAWEI> system-view
[HUAWEI] ssh server cipher aes256_cbc aes128_cbc
The undo sshd server command deletes the algorithms that can be used by a
switch to establish a NETCONF session with a third-party controller.
The algorithms that can be configured by this command have low security. By
default, the switch does not support these algorithms when establishing a
NETCONF session with a third-party controller.
NOTE
All models support this command, except S1720GW, S1720GW-E, S1720GWR, S1720GWR-E,
S1730S-S1, S200, and S1730S-S.
Format
sshd server cipher { aes128-cbc | aes192-cbc | aes256-cbc | aes128-
gcm@openssh.com | aes256-gcm@opensscom } *
Parameters
Parameter Description Value
Views
NETCONF view
Default Level
3: Management level
Usage Guidelines
The algorithms that can be configured by this command have low security. By
default, the switch does not support these algorithms when establishing a
NETCONF session with a third-party controller. You are advised not to use these
algorithms.
Example
# Configure the aes128-cbc encryption algorithm that can be used by the switch
to establish a NETCONF session with a third-party controller.
<HUAWEI> system-view
[HUAWEI] netconf
[HUAWEI-netconf] sshd server cipher aes128-cbc
Warning: Insecure encryption algorithms will be enabling and the SSH connection may be teared down.
Continue? [Y/N]:y
Format
ssh server hmac { md5 | md5_96 | sha1 | sha1_96 | sha2_256_96 } *
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
An SSH server and a client need to negotiate an HMAC algorithm for the packets
exchanged between them. You can run the ssh server hmac command to
configure an HMAC algorithm list for the SSH server. After the server receives a
packet from the client, the server matches the list of the client against its local list
and selects the first matched HMAC algorithm. If no matched HMAC algorithms,
the negotiation fails.
Example
# Configure the HMAC sha2_256_96 algorithm for an SSH server.
<HUAWEI> system-view
[HUAWEI] ssh server hmac sha2_256_96
Format
ssh server key-exchange { dh_group14_sha1 | dh_group1_sha1 |
dh_group_exchange_sha1 }*
undo ssh server key-exchange
Parameters
Parameter Description Value
Views
System view
Default Level
3: Management level
Usage Guidelines
An SSH server and a client need to negotiate a key exchange algorithm for the
packets exchanged between them. You can run the ssh server key-exchange
command to configure a key exchange algorithm list for the SSH server. After the
server receives a packet from the client, the server matches the key exchange
algorithm list of the client against its local list and selects the first matched key
exchange algorithm. If no matched key exchange algorithms, the negotiation fails.
Example
# Configure key exchange algorithm lists dh_group1_sha1 on the SSH server.
<HUAWEI> system-view
[HUAWEI] ssh server key-exchange dh_group1_sha1
Format
ssl minimum version tls1.0
Parameters
Parameter Description Value
tls1.0 Sets the minimum SSL version to TLS1.0 for an SSL policy. -
Views
SSL policy view
Default Level
3: Management level
Usage Guidelines
To configure a minimum SSL version for an SSL policy, run the ssl minimum
version command so that service modules can flexibly adopt the SSL policy.
Example
# Configure the minimum SSL version for the SSL policy ftp_server to be TLS1.0.
<HUAWEI> system-view
[HUAWEI] ssl policy ftp_server
[HUAWEI-ssl-policy-ftp_server] ssl minimum version tls1.0