23
By default, an IPv4 advanced ACL does not contain any rule.
Within an ACL, the permit or deny statement of each rule must be unique. If the ACL rule you are creating
or editing has the same deny or permit statement as another rule in the ACL, your creation or editing
attempt will fail.
To view rules in an ACL and their rule IDs, use the
display acl all
command.
Related commands:
acl
,
display acl
, and
step
.
NOTE:
If an IPv4 advanced ACL is for packet filtering, the operator cannot be
neq
.
If an IPv4 advanced ACL is for QoS traffic classification:
•
Do not specify the
vpn-instance
keyword or specify
neq
for the
operator argument. The keywords can
cause ACL application failure.
•
The
logging
and
counting
keywords (even if specified) do not take effect for QoS.
Examples
# Create an IPv4 advanced ACL rule to permit TCP packets with the destination port of 80 from
129.9.0.0/16 to 202.38.160.0/24.
<Sysname> system-view
[Sysname] acl number 3000
[Sysname-acl-adv-3000] rule permit tcp source 129.9.0.0 0.0.255.255 destination
202.38.160.0 0.0.0.255 destination-port eq 80
rule (IPv4 basic ACL view)
Syntax
rule
[
rule-id
] {
deny
|
permit
} [
counting
|
fragment
|
logging
|
source
{
sour-addr sour-wildcard
|
any
}
|
time-range
time-range-name
|
vpn-instance
vpn-instance-name
] *
undo
rule
rule-id
[
counting
|
fragment
|
logging
|
source
|
time-range
|
vpn-instance
] *
View
IPv4 basic ACL view
Default level
2: System level
Parameters
rule-id
: Specifies a rule ID, which ranges from 0 to 65534. If no rule ID is provided when you create an
ACL rule, the system automatically assigns it a rule ID. This rule ID takes the nearest higher multiple of the
numbering step to the current highest rule ID, starting from 0. For example, if the rule numbering step is
5 and the current highest rule ID is 28, the rule is numbered 30.
deny
: Denies matching packets.
permit
: Allows matching packets to pass.
counting
: Counts the number of times the IPv4 ACL rule has been matched in hardware.
fragment
: Applies the rule only to non-first fragments. A rule without this keyword applies to both
fragments and non-fragments.
logging
: Logs matching packets.