The rule command creates or modifies an ACL6 rule in the advanced ACL6 view.
The undo rule command deletes an ACL6 rule in the advanced ACL6 view.
By default, no advanced ACL6 rule is created.
rule [ rule-id ] [ name rule-name ] { permit | deny } { icmpv6 | 58 } [ { destination { destination-ipv6-address prefix-length | dest-ipv6-addr-prefix | any } | destination-pool destination-pool-name } | fragment | icmp6-type { icmp6-type-name | icmp6-type [ to icmp6-type-end ] [ icmp6-code ] } | { source { source-ipv6-address prefix-length | src-ipv6-addr-prefix | any } | source-pool source-pool-name } | time-range time-name | [ dscp dscp | [ precedence { precedence | critical | flash | flash-override | immediate | internet | network | priority | routine } | tos { tos | max-reliability | max-throughput | min-delay | min-monetary-cost | normal } ] * ] | [ vpn-instance vpn-instance-name | vpn-instance-any ] ] *
undo rule [ name rule-name ] { permit | deny } { icmpv6 | 58 } [ { destination { destination-ipv6-address prefix-length | dest-ipv6-addr-prefix | any } | destination-pool destination-pool-name } | fragment | icmp6-type { icmp6-type-name | icmp6-type [ to icmp6-type-end ] [ icmp6-code ] } | { source { source-ipv6-address prefix-length | src-ipv6-addr-prefix | any } | source-pool source-pool-name } | time-range time-name | [ dscp dscp | [ precedence { precedence | critical | flash | flash-override | immediate | internet | network | priority | routine } | tos { tos | max-reliability | max-throughput | min-delay | min-monetary-cost | normal } ] * ] | [ vpn-instance vpn-instance-name | vpn-instance-any ] ] *
Parameter | Description | Value |
---|---|---|
rule-id |
Specifies the number of an advanced ACL6 rule. |
The value is an integer that ranges from 0 to 4294967294. |
name rule-name |
Specifies the name of an ACL rule. |
The value is a string of 1 to 32 case-sensitive characters without spaces and cannot start with an underscore (_). |
permit |
Permits the packets that match a rule. |
- |
deny |
Denies the packets that match a rule. |
- |
icmpv6 |
Internet Error Message Protocol 6 (58). |
- |
58 |
Indicates the protocol number. |
- |
destination |
Matches packets based on the destination IPv6 address. If no destination IPv6 address is specified, an ACL takes effect for packets with any destination IPv6 address. |
- |
destination-ipv6-address |
Specifies the destination IPv6 address. |
The value is a 32-digit hexadecimal number, in the format X:X:X:X:X:X:X:X. |
prefix-length |
Specifies the mask length of an IPv6 address. |
The value is an integer that ranges from 1 to 128. |
dest-ipv6-addr-prefix |
Specifies the destination IPv6 address with a prefix. |
The value is a string of case-sensitive characters, spaces not supported. |
any |
Matches packets with any IPv6 address. |
- |
destination-pool destination-pool-name |
Specifies the name of a destination IPv6 address pool used by an advanced ACL. An ACL IPv6 address pool is created using the acl ipv6-pool command. |
The value is a string of 1 to 32 case-sensitive characters, spaces not supported. |
fragment |
Checks fragmented packets. |
- |
icmp6-type |
Specifies the type of ICMPv6 messages. |
The value is an integer that ranges from 0 to 255. |
icmp6-type |
Specifies the type of ICMPv6 messages. |
The value is an integer that ranges from 0 to 255. |
icmp6-type-name |
Specifies the name of an ICMPv6 message. |
Enumerated type. You can enter a question mark (?) and select a value from the displayed value range. |
icmp6-code |
Specifies an ICMPv6 message code. |
The value is an integer that ranges from 0 to 255. |
source |
Matches packets based on the source IPv6 address. If no source IPv6 address is configured, packets with any source IPv6 address are matched. |
- |
source-ipv6-address |
Specifies a source IPv6 address. |
The value is a 32-digit hexadecimal number, in the format X:X:X:X:X:X:X:X. |
src-ipv6-addr-prefix |
Specifies the mask length of the destination IPv6 address. |
The value is an integer that ranges from 1 to 128. |
source-pool source-pool-name |
Specifies the name of a source IPv6 address pool used by an advanced ACL. An ACL IPv6 address pool is created using the acl ipv6-pool pool-name command. |
The value is a string of 1 to 32 characters. |
time-range time-name |
Specifies the time range during which the rule takes effect. If this parameter is not specified, the rule takes effect immediately after being configured. The time range is configured using the time-range command. |
The value is a string of 1 to 32 case-sensitive characters, spaces not supported. |
dscp dscp |
Matches IPv6 packets based on the leftmost six bits of the TC field. |
The value is an integer that ranges from 0 to 63. |
precedence precedence |
Matches IPv6 packets based on the leftmost three bits of the TC field. |
The value is an integer that ranges from 0 to 7. |
critical |
Indicates the critical priority (5). |
- |
flash |
Flash priority (3). |
- |
flash-override |
Flash-override priority (4). |
- |
immediate |
Immediate priority (2). |
- |
internet |
Internetwork control priority (6). |
- |
network |
Network control priority (7). |
- |
priority |
priority (1). |
- |
routine |
Routine priority (0). |
- |
tos tos |
Matches IPv6 packets based on the leftmost four to seven bits of the Traffic Class (TC) field. |
The value is an integer that ranges from 0 to 15. |
max-reliability |
Highest-reliability service (2). |
- |
max-throughput |
Maximum throughput service (4). |
- |
min-delay |
Minimum delay service (8). |
- |
min-monetary-cost |
Cheapest service (1). |
- |
normal |
Common service (0). |
- |
vpn-instance |
Specifies a VPN instance. |
- |
vpn-instance vpn-instance-name |
Matches packets based on an IPv6 VPN instance name. If the IPv6 packet is an L3VPN service address, this parameter needs to be added to the ACL. If this parameter is not specified, the packets are public IPv6 packets. |
The value is a string of 1 to 31 case-sensitive characters. |
vpn-instance-name |
Matches packets based on the IPv6 VPN instance name. If the IPv6 packet is an L3VPN service address, this parameter needs to be added to the ACL. If this parameter is not specified, the packets are public IPv6 packets. |
The value is a string of 1 to 31 case-sensitive characters. |
vpn-instance-any |
Specifies any VPN instance. |
- |
rule |
Specifies an ACL6 rule. |
- |
to icmp6-type-end |
Specifies the end value of ICMPv6 messages. |
The value is an integer that ranges from 0 to 255. |
Usage Scenario
After an advanced ACL6 is created, run the rule command to add rules to the ACL6.
Prerequisites
An advanced ACL6 has been created using the acl ipv6 command in the system view.
A time range has been configured using the time-range command in the system view if you want to specify a validity period when creating an advanced ACL6 rule.Configuration Impact
When specifying an ACL6 rule ID, note the following:
Precautions
If auto is configured when you run the acl ipv6 command to create an ACL6, you cannot specify a rule ID when creating a rule. The system automatically uses the ACL6 step as the start rule ID, and the subsequent rules are numbered by a step in ascending order.
If the auto mode based on the depth-first principle is specified as the matching order for an advanced ACL6 rule group, you cannot specify a rule ID when creating a rule. If rule-id is not specified when you run the rule command to create an ACL6, the system automatically assigns an ID to the ACL6 rule. You can run the display acl ipv6 command to check the rule ID automatically assigned to an ACL6. If name rule-name is not specified when you run the rule command to create an ACL6, the system automatically generates a name for the ACL6 in the format of "rule"+"_"+rule ID. Rule ID is the ID of an ACL6 rule that can be specified using the rule-id parameter or automatically assigned by the system. You can check the automatically generated name of an ACL6 rule through the NMS. You must specify the rule ID when deleting a rule. To check rule IDs, run the display acl ipv6 command. Before deleting an ACL6 rule, run the display acl ipv6 command to check whether the ACL6 rule has been applied to other services. Delete the rule only when it is not applied to other services. If the ID of an advanced ACL6 rule to be deleted is not specified, you must specify all parameters in the rule before deleting it.