The port add-tag acl command adds an outer tag to the packet that matches an ACL rule on an interface.
The undo port add-tag acl command cancels the configuration.
Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.
port add-tag acl { acl-number | name acl-name } [ rule rule-id ] vlan vlan-id { priority-inherit | remark-8021p 8021p-value }
undo port add-tag acl { acl-number | name acl-name } [ rule rule-id ]
If both Layer 2 ACLs and Layer 3 ACLs are configured, use the following command:
port add-tag acl l2-acl [ rule rule-id ] [ acl { basic-acl | advance-acl | name acl-name } [ rule rule-id ] ] vlan vlan-id { priority-inherit | remark-8021p 8021p-value }
port add-tag acl { basic-acl | advance-acl } [ rule rule-id ] [ acl { l2-acl | name acl-name } [ rule rule-id ] ] vlan vlan-id { remark-8021p 8021p-value | priority-inherit }
port add-tag acl name acl-name [ rule rule-id ] [ acl { basic-acl | advance-acl | l2-acl | name acl-name } [ rule rule-id ] ] vlan vlan-id { remark-8021p 8021p-value | priority-inherit }
undo port add-tag acl l2-acl [ rule rule-id ] [ acl { basic-acl | advance-acl | name acl-name } [ rule rule-id ] ]
undo port add-tag acl { basic-acl | advance-acl } [ rule rule-id ] [ acl { l2-acl | name acl-name } [ rule rule-id ] ]
undo port add-tag acl name acl-name [ rule rule-id ] [ acl { basic-acl | advance-acl | l2-acl | name acl-name } [ rule rule-id ] ]
Parameter |
Description |
Value |
---|---|---|
acl-number |
Specifies the number of an ACL. |
The value is an integer that ranges from 2000 to 4999. The value ranges of different types of ACLs are as follows:
|
rule-id |
Specifies the ID of an ACL rule. |
The value of an IPv4 ACL ranges from 0 to 4294967294.
NOTE:
The number of ACL rules assigned automatically by the device starts from the step. The default step is 5. With this step, the device creates ACL rules with the numbers of 5, 10, 15, and so on. |
name acl-name |
Specifies a named ACL. |
The value must the name of an existing ACL. |
vlan vlan-id |
Specifies a VLAN ID. |
The value is an integer that ranges from 1 to 4094. |
l2-acl |
Specifies the number of a Layer 2 ACL. |
The value is an integer that ranges from 4000 to 4999. |
basic-acl |
Specifies the number of a basic ACL. |
The value is an integer that ranges from 2000 to 2999. |
advance-acl |
Specifies the number of an advance ACL. |
The value is an integer that ranges from 3000 to 3999. |
priority-inherit |
Indicates that the outer VLAN tag inherits the priority in the inner VLAN tag. |
- |
remark-8021p 8021p-value |
Specifies the re-marked priority of the added outer VLAN tag. 8021p-value specifies the 802.1p priority. |
The value is an integer that ranges from 0 to 7. A larger value indicates a higher priority. |
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, MultiGEinterface view
Usage Scenario
A device interface adds the specified outer tag to a packet based on the VLAN tag, MAC address, IP protocol, source address, destination address, priority, or port number of an application of a user.
Precautions
After you run the port add-tag acl command, the following situations may occur:
A Layer 2 ACL and a Layer 3 ACL can be set in the port add-tag acl command simultaneously. The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number ranges from 2000 to 2999 and 3000 to 3999.
# Add the outer tag of VLAN 1001 to the packet that matches the source IP address of 192.168.0.0/16 on GE0/0/1.
<HUAWEI> system-view [HUAWEI] acl name test 2000 [HUAWEI-acl-basic-test] rule 1 permit source 192.168.0.0 0.0.255.255 [HUAWEI-acl-basic-test] quit [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type trunk [HUAWEI-GigabitEthernet0/0/1] port trunk allow-pass vlan all [HUAWEI-GigabitEthernet0/0/1] port add-tag acl 2000 rule 1 vlan 1001 priority-inherit