Skip to content
Ask AI

Forwarding Policy Configuration

Forwarding strategy is the most commonly used function in traffic diversion scenarios. Its core function is to forward the specified traffic after ACL filtering from the input port or LAG to the output port. It can be output to the LAG group or copy multiple copies of traffic for different scenarios, and can be used in combination with tunnel stripping, timestamping , etc.

Configuration order (from top to bottom)Configuration ContentConfiguration
Creating a LAG (Optional)If the output is to LAG, you need to create LAG and add ports first.
Creating a Mirror Session (Optional)If the output is to mirror session, you need to create mirror session first.
Configure EM/EMV6 templateBefore creating EM/EMv6 policies, you need to configure the global template
Creating an ACL Rule GroupCreate an ACL rule group based on the type of filtering to be performed
Adding rulesAdd a rule to the rule group and specify the egress port or LAG (optionally configure rule-based actions)
Binding rule groups to input portsAttach the rule group to the input port or LAG to complete the configuration.

Add multiple ports to LAG, and traffic will be load balanced when it is output from LAG.

Table 1 Create LAG

OperationCommandDescription
Enter system configuration viewconfigure
Create lag and enter lag viewinterface link-aggregation LAG-IDCreate a lag group
Select lag modemode { static|flex|weight|standby }static: When a lag member is down, all traffic is reloaded to other UP members.
flex: When a member of the lag is down, only the down port is reloaded to other members that are up.
Weight: The weight ratio of each port can be set on an elastic basis. The sum of the weight ratios of each port is not greater than 64.
standby: you can additionally configure the master and standby ports and some LACP functions on top of the weight.
Submit selected modecommitSubmit after selecting the mode to take effect

Table 2 Add members to a LAG group

OperationCommandDescription
Enter system configuration viewconfigure
Enter interface viewinterface Ethernet IDEnter the port where you want to add LAG members.
Add LAG common memberslink-aggregation-group LAG-ID
Add LAG weight memberlink-aggregation-group LAG-ID weight WEIGHTDistribute traffic based on weights. The sum of the weight ratios of each port is not greater than 64.

Table 3 Creating a standby LAG

OperationCommandDescription
Enter system configuration viewconfigure
Create lag and enter lag viewinterface link-aggregation LAG-IDCreate a lag group
Select lag modemode standbystandby: you can additionally configure the master and standby ports and some LACP functions on top of the weight.
Setting the maximum and minimum members in a standby lagstandby {min-links|max-links } NUMmin-links:the minimum number of UP members in the lag, if it is smaller than this value, the LAG will be down as a whole.
max-links:Maximum number of UPs in the LAG, if it is greater than this value, other low priority ports will be used as standby ports.
Enable LACP preemptionpreempt eableAfter port preemption is turned on, the primary port switches to the standby port and then cuts back to the primary port when the primary port is re-UP
preempt delaypreempt delay TIMETIME: Delay for the standby port to switch back to the master port, in seconds, 0-300
Switching Port Priority Methodstandby select {priority|speed }priority: Sets the alternate ports with the same weight to be selected in order of port priority; alternate ports without the same weight are not switched.
speed: the device selects spare ports with the same weight according to the rate and priority first, if there is no same rate, the spare ports are selected according to the priority. Spare ports without the same weight are not switched.
Submit selected modecommitCommit to take effect after selecting the mode, standby mode needs to commit to take effect after adding ports, other modes do not need to commit to add ports.

Table 4 Adding members to a standby LAG group

OperationCommandDescription
Enter system configuration viewconfigure
Enter interface viewinterface Ethernet IDEnter the port where you want to add LAG members.
Adding a port to a lag grouplink-aggregation-group LAG-ID
Add port member priority and weightlink-aggregation-group LAG-ID port-priority PRIORITY weight WEIGHTPRIORITY: set the priority for the members of the added standy lag, the greater the priority the higher the priority, the smaller the port id the higher the priority when the priority is the same.
Distribute traffic based on weights. The sum of the weight ratios of each port is not greater than 64.

Port mirroring means to copy an additional traffic based on the port without affecting the original service .

SPAN Mirroring

OperationCommandDescription
Enter system configuration viewconfigure
Configure span mirroringmirror session ID span direction {rx|tx|both} [src -ethernet SRC-ETHERNET ] dst -ethernet DST-ETHERNET [slice enable]

Span mirroring description

ID: used to maintain mirror groups, supporting up to 7 groups. direction: The direction of the mirrored port traffic. You can select input direction, output direction, or both input and output directions. SRC-ETHERNET : Select the inbound port for the mirrored traffic. This command can be entered multiple times to add multiple inbound ports, also can be skipped if mirror session is used for acl mirror-action. DST-ETHERNET: Select the outbound port for the mirrored traffic. This command can be used to add multiple outbound ports. slice enable: Enables message truncation, with a fixed truncation limit of 128 bytes

RSPAN Mirroring

OperationCommandDescription
Enter system configuration viewconfigure
Create a vlan for rspan usevlan VLANIDCreate a vlan for rspan
Configure rspan mirroringmirror session ID rspan direction {rx|tx|both} [src-ethernet SRC-ETHERNET ] dst-ethernet DST-ETHERNET remote-vlan VLANID [slice enable]

Rspan mirroring description

ID: used to maintain mirror groups, supporting up to 7 groups. direction: The direction of the mirrored port traffic. You can select input direction, output direction, or both input and output directions. SRC-ETHERNET : Select the inbound port for the mirrored traffic. This command can be entered multiple times to add multiple inbound ports, also can be skipped if mirror session is used for acl mirror-action. DST-ETHERNET: Select the outbound port for the mirrored traffic. only sopprt one outbound port. slice enable: Enables message truncation, with a fixed truncation limit of 128 bytes

OperationCommandDescription
Enter system configuration viewconfigure
Configure EM/EMV6 templateexactrulemask {src-ip | dst ip | src-port |dst-port | ip protocol | ipv6-src-ip | ipv6 src-port| ipv6-dst-port | ipv6-ip-protocol} *Before creating EM/EMv6 policies, you must configure the global template. If the rule match items do not align with the template, the policy cannot be applied. If EM/EMv6 policies are already applied, the template cannot be modified; you must disable the policies first before making changes to the template.

ACL table is port specific. Binding ports means that the ACL table is valid for traffic on those ports. A single ACL table can bind multiple ports, and multiple ACL tables can exist on a single port, i.e. a “many-to-many” relationship.

ACL table naming rule

The ACL tables’ name is supposed to be different.

ACL table direction

The ACL table stage indicates the direction, optionally ingress and egress, which corresponds to whether the ACL table is applied to the rx and tx direction respectively.

ACL table type

ACL table type affects the match fields of the ACL, in other words, determines which characteristics are used to match traffic. ACL table type is available as L2, L3, L3v6, EX. The egress direction only supports L3/L3V6 type.

ACL rule action

  • Ingress

Table 5 ACL rule ingress action

ActionKey wordsDescription
packet-action{permit|deny}permit means forward; deny means the packet is not forwarded but can be normally trapped
mirror-actionmirror-session IDused to maintain mirror groups
redirect-action{ethernet PORT | ethernets ** [PORT1,PORT2..] | link-aggregation LAGID | link-aggregations ** [LAGID,LAGID …]}*support redirecting to an interface or multi-interfaces or a lag or lags. Ports and lags can be added together.
add-vlanVLAN IDAdd new vlan, range 1-4094. Not support for multi-redirections.
modify-vlanVLAN IDModify outer-vlan, range 1-4094. Not support for multi-redirections
pop-vlan-Pop outer-vlan
add-timestamp-Add timestamp, ptp needs to open manually, see Timestamp Function Description
set-dmacDMACModify dst-mac: nn:nn:nn:nn:nn:nn
  • Egress

Table 6 ACL rule egress action

ActionKey wordsDescription
packet-action{permit|deny}permit means forward; deny means the packet is not forwarded but can be normally trapped

ACL rule match fields

The supported match fields for different types of ACL tables vary, and the specific match fields for each type of ACL table are described below.

  • L2 ACL

Table 7 L2 match fields

Key wordsDescription of parametersNotes
src-macSpecify source mac address: nn:nn:nn:nn:nn:nnSupported only in the ingress direction.
dst-macSpecify destination mac address: nn:nn:nn:nn:nn:nnSupported only in the ingress direction.
ethernet-typeSpecify ethernet protocol type, range: 0-FFFFSupported only in the ingress direction.
outer-vlanSpecify outer VLAN id, range: 1-4094Supported only in the ingress direction.
  • L3 ACL

Table 8 L3 match fields

Key wordsDescription of parametersNotes
src-macSpecify source mac address: nn:nn:nn:nn:nn:nnSupported only in the ingress direction.
outer-vlanSpecify outer VLAN id, range 1-4094
vlan-priSpecify outer VLAN priority, range 0-7
ip-protocolSpecify IP protocol, range0-255
src-ipSpecify source IP address: A.B.C.D(/mask)
dst-ipSpecify destination IP address: A.B.C.D(/mask)
icmp-typeSpecify type of ICMP, range 0-16Supported only in the ingress direction.
icmp-codeSpecify code of ICMP, range 0-5Supported only in the ingress direction.
src-portSpecify L4 source port, range 0-65535
dst-portSpecify L4 destination port, range 0-65535
ip-fragmentSpecify IP Fragment: ANY, All ip-fragment packetsSupported only in the ingress direction.
src-port-rangeSpecify Src port range, eg:1024-65535Supported only in the ingress direction.
dst-port-rangeSpecify Dst port range, eg:1024-65535Supported only in the ingress direction.
src-port-excludeSpecify L4 source port, range: 0-65535Supported only in the ingress direction.
dst-port-excludeSpecify L4 destination port, range: 0-65535Supported only in the ingress direction.
dscpSpecify DSCP of IP header, range: 0-63Supported only in the ingress direction.
  • L3V6 ACL:

Table 9 L3V6 match fields

Key wordsDescription of parametersNotes
src-macSpecify source mac address: nn:nn:nn:nn:nn:nnSupported only in the ingress direction.
outer-vlanSpecify outer VLAN id, range 1-4094
vlan-priSpecify outer VLAN priority, range 0-7
ip-protocolSpecify IP protocol, range0-255
src-ipv6Specify source IP address: A::B(/mask)
dst-ipv6Specify destination IP address: A::B(/mask)
icmpv6-typeSpecify type of ICMP, range 0-16Supported only in the ingress direction.
icmpv6-codeSpecify code of ICMP, range 0-5Supported only in the ingress direction.
src-portSpecify L4 source port, range 0-65535
dst-portSpecify L4 destination port, range 0-65535
src-port-rangeSpecify Src port range, eg:1024-65535Supported only in the ingress direction.
dst-port-rangeSpecify Dst port range, eg:1024-65535Supported only in the ingress direction.
src-port-excludeSpecify L4 source port, range: 0-65535Supported only in the ingress direction.
dst-port-excludeSpecify L4 destination port, range: 0-65535Supported only in the ingress direction.
dscpSpecify DSCP of IP header, range: 0-63Supported only in the ingress direction.
  • EX ACL

Table 10 EX match fields

Key wordsDescription of parametersNotes
src-macSpecify source mac address: nn:nn:nn:nn:nn:nnSupported only in the ingress direction.
dst-macSpecify destination mac address: nn:nn:nn:nn:nn:nnSupported only in the ingress direction.
ethernet-typeSpecify ethernet protocol type, range: 0-FFFFSupported only in the ingress direction.
outer-vlanSpecify outer VLAN id, range: 1-4094Supported only in the ingress direction.
src-ipSpecify source IP address: A.B.C.D(/mask)Supported only in the ingress direction.
inner-src-ipSpecify inner source IP address : A.B.C.D(/mask)Supported only in the ingress direction.
inner-dst-ipSpecify inner destination IP address : A.B.C.D(/mask)Supported only in the ingress direction.
inner-src-ipv6Specify inner source IP : A::B(/mask)Supported only in the ingress direction.
inner-dst-ipv6Specify inner destination IP : A::B(/mask)Supported only in the ingress direction.
inner-ip-protocolSpecify inner IP protocol, range 0-255Supported only in the ingress direction.
inner-src-portSpecify inner source port, range 0-65535Supported only in the ingress direction.
inner-dst-portSpecify inner destination port, range 0-65535Supported only in the ingress direction.
tcp-flagsSpecify TCP flags, range: 0-FF(flags)/0-FF(masks)Supported only in the ingress direction.
vniSpecify VNI, range: 1-16777215Supported only in the ingress
direction.
  • EM ACL
Key wordsDescription of parametersNotes
src-ipSpecify source IP address: A.B.C.D(/mask)
dst-ipSpecify destination IP address: A.B.C.D(/mask)
ip-protocolSpecify IP protocol, range0-255
src-portSpecify L4 source port, range 0-65535
dst-portSpecify L4 destination port, range 0-65535
  • EMV6 ACL
Key wordsDescription of parametersNotes
src-ipv6Specify source IP address: A::B(/mask)
ip-protocolSpecify IP protocol, range0-255
src-portSpecify L4 source port, range 0-65535
dst-portSpecify L4 destination port, range 0-65535

Table 11 Create an ACL group and add rules

OperationCommandDescription
Enter system configuration viewconfigure
Create an ACL group and enter ACL group viewaccess-list {L2|EX|L3|L3V6 } ACL_NAME { ingress|egress} [des_crip] DES_CRIP [priority] PRIORITYACL_NAME: The name of the ACL group. DES_CRIP: Optionally add a description for the ACL group. The description can be modified, but acl name cannot be modified.
PRIORITY: ACL group can add a priority. The larger the PRORITY, the higher the priority. The priority is only valid for the same type. Among different types, the priority of EX/L2 is higher than that of L3/L3V6
Add rulesrule ID action_options [rule_options]ID also indicates the priority level, in the range 0-500.
rule_options: see [ACL rule match fields] for details.
action_options: see [ACL rule action] for details.
Enter the interface view{interface Ethernet ID | interface link-aggregation LAG-ID }
Apply the ACL table to the interface.acl ACL_NAMEBind acl to an interface or a link-aggregation group

Before using the timestamp, you need to turn on the global switch of PTP first, and then enable PTP on the port for the traffic input port, so that the traffic entering from the port can obtain the ability to obtain the timestamp. This function is generally used together with the timestamp function. Both port PTP and global PTP must be configured. When used with the timestamp , the current effective time and time zone shall prevail. If the time/ time zone is modified, the device needs to be restarted to take effect.

Table 12 Enable the global PTP function

OperationCommandDescription
Enter system configuration viewconfigure-
Configure the ptp profileptp profile 1588v2-
Enable the global PTP functionptp enableEnable PTP globally

Table 13 Enable the PTP function on ingress port

OperationCommandDescription
Enter system configuration viewconfigure-
Enter interface viewinterface Ethernet IDEnter the traffic input port where timestamp is to be added
Enable the PTP function on the portptp enableEnable port PTP

OperationCommandDescription
View ACL hitcountsshow counters acl-
Clear ACL hitcountsclear counters acl-
View lag groupshow link-aggregation summary-