/interface/ethernet/switch/rule

当前显示英文原文,切换到「中文」可查看译文。

rule

RouterOS directory reference for /interface/ethernet/switch/rule.


interface/ethernet/switch/rule

Syscap: rbswitch Type: Directory

FlagNameDescription
Xdisabled
Iinvalid
Ddynamic
ArgumentTypeDescription
switch *enumMatching the switch group on which the rule will apply.
portsmulti { array-id, port: enum }Matching switch interfaces where the rule will apply to incoming traffic. Multiple ports and hardware-offloaded bonding interfaces can be selected. Note that the switch1-cpu port cannot be selected. If ports property is left empty, the rule will apply to all switch interfaces.
src-mac-addresssuper { address: macAddr , [mask] /macAddr }Matching source MAC address and mask.
dst-mac-addresssuper { address: macAddr , [mask] /macAddr }Matching destination MAC address and mask.
mac-protocolalt { protocol-name: enum () , protocol-number: num [ .. 65535] }Matching a particular MAC protocol specified by protocol name or number (skips VLAN tags if any).
vlan-headerenum (not-present | present)Matching VLAN header, whether the VLAN header is present or not. Requires vlan-filtering=yes.
vlan-idnumMatching VLAN ID. Requires vlan-filtering=yes.
vlan-prioritynumMatching VLAN priority (priority code point).
src-addresssuper { address: ipAddr , [mask] /alt { bitmask: ipAddr , netmask: num [ .. 32] } }Matching source IPv4 address and mask. If mac-protocol=arp is specified, matches the source IP in ARP packets. Without mac-protocol, matches only IPv4 packets.
dst-addresssuper { address: ipAddr , [mask] /alt { bitmask: ipAddr , netmask: num [ .. 32] } }Matching destination IPv4 address and mask. If mac-protocol=arp is specified, matches the destination IP in ARP packets. Without mac-protocol, matches only IPv4 packets.
protocolalt { protocol-name: enum () , protocol-number: num [ .. 255] }Matching a particular IP protocol specified by protocol name or number. Only applies to IPv4 packets if mac-protocol is not specified. To match certain IPv6 protocols, use the mac-protocol=ipv6 setting.
src-portrangeMatching source protocol port number (applies to IPv4 and IPv6 packets if mac-protocol is not specified).
dst-portrangeMatching destination protocol port number or range (applies to IPv4 and IPv6 packets if mac-protocol is not specified).
dscpnumMatching the DSCP field of the packet (only applies to IPv4 packets).
src-address6super { address: ip6Addr , [mask] /alt { bitmask: ip6Addr , netmask: num } }Matching source IPv6 address and mask.
dst-address6super { address: ip6Addr , [mask] /alt { bitmask: ip6Addr , netmask: num } }Matching destination IPv6 address and mask.
traffic-classnumMatching IPv6 traffic class.
flow-labelnumMatching IPv6 flow label.
copy-to-cpuboolClones the matching packet and sends it to the CPU.
redirect-to-cpuboolChanges the destination port of a matching packet to the switch CPU.
mirrorboolClones the matching packet and sends it to the mirror-target port.
new-dst-portsmulti { array-id, port: alt { port: enum , bond: iface_enum } }Changes the destination port as specified, multiple ports allowed, including a switch CPU port. - If the setting is left empty (e.g. new-dst-ports=""), the packet will be dropped; - If a port or hardware-offloaded bonding interface is specified, the packet will be redirected to that port. Only a single port or bond interface is supported; - if you use the all argument, packet will be allowed to pass through to the egress processing without being dropped; - If this parameter is not used, the packet will be accepted as is.
mirror-portsmulti { array-id, port: enum }Selects multiple mirroring target ports, only available on the 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports.
new-qos-profileenumThe name of the QoS profile to assign to the matched packets.
keep-qos-fieldsboolShould the original values of QoS fields (PCP, DSCP) be kept (yes), or replaced with the ones from the assigned QoS profile (no)? Relevant only if new-qos-profile is set.
new-vlan-idnumChanges the VLAN ID to the specified value. Requires vlan-filtering=yes.
new-vlan-prioritynumChanges the VLAN priority (priority code point). Requires vlan-filtering=yes.
new-vrfenumAssigns ingress traffic to a specified VRF. Requires hardware-offloaded VRF support on the switch chip. On VRF-unaware switches (98DX3xxx and 98DX2xxx series), setting new-vrf to anything other than main will be treated as redirect-to-cpu=yes.
ratenumSets ingress traffic limitation (bits per second) for matched traffic.
Read-only ArgumentTypeDescription
packetsnum
bytesnum
internal-prioritynum