/interface/ethernet/switch/acl

acl

访问控制列表由入站政策和出站政策引擎组成,允许配置最多 128 条政策规则(受 RouterOS 限制)。它是一种高级工具,可基于二层、三层和四层协议头字段条件进行线速数据包过滤、转发、整形和修改。


interface/ethernet/switch/acl

Syscap: musicswitch Type: Directory

访问控制列表由入站政策和出站政策引擎组成,允许配置最多 128 条政策规则(受 RouterOS 限制)。它是一种高级工具,可基于二层、三层和四层协议头字段条件进行线速数据包过滤、转发、整形和修改。

说明

由于硬件限制,无法在特定端口上匹配广播/多播流量。应使用端口隔离、在入站端口上丢弃流量,或使用 VLAN 过滤来防止某些广播/多播流量被转发。 | 标志 | 名称 | 描述 | | --- | --- | --- | | X | disabled | | | I | invalid | |

参数类型描述
tableenum (ingress | egress) { ingress:0, egress:1 }选择用于入站或出站数据包的政策表。
invert-matchbool反转整个 ACL 规则匹配。
src-portsmulti { array-id }匹配物理源端口或 trunk。
dst-portsmulti { array-id }匹配物理目标端口或 trunk。由于硬件限制,无法在出站端口上匹配广播/多播流量。
service-vidsuper { ! , service-vid: range [ .. 4095] }匹配服务 VLAN ID。
service-pcpnum匹配服务 PCP。
service-deinum匹配服务 DEI。
customer-vidsuper { ! , customer-vid: range [ .. 4095] }匹配客户 VLAN ID。
customer-pcpnum匹配客户 PCP。
customer-deinum匹配客户 DEI。
src-l3-portsuper { ! , src-l3-port: range [ .. 65535] }匹配三层源端口。
dst-l3-portsuper { ! , dst-l3-port: range [ .. 65535] }匹配三层目标端口。
custom-fieldsobject { custom-field: super { ! , custom-field: super { base: enum (start-of-frame | end-of-l2-header | end-of-l3-header) { start-of-frame:0, end-of-l2-header:1, end-of-l3-header:2 } , [offset] :num [ .. 127] , [range] :range [ .. 65535] , [mask] [ /num [ .. 65535]] } } }
prioritynum匹配内部优先级。仅在出站表中有效。
drop-precedenceenum (green | yellow | red | drop)匹配内部丢弃优先级。仅在出站表中有效。
dst-addr-registeredbool定义是否匹配具有已注册状态的数据包 - 目标 MAC 地址位于 UFDB/MFDB/RFDB 中的数据包。仅在出站表中有效。
service-tagenum (untagged | priority-tagged | tagged | tagged-or-priority-tagged) { untagged:0, priority-tagged:1, tagged:2, tagged-or-priority-tagged:3 }服务标签格式。
customer-tagenum (untagged | priority-tagged | tagged | tagged-or-priority-tagged) { untagged:0, priority-tagged:1, tagged:2, tagged-or-priority-tagged:3 }客户标签格式。
mac-src-addresssuper { address: macAddr , [mask] [ /macAddr] }源 MAC 地址和掩码。
mac-dst-addresssuper { address: macAddr , [mask] [ /macAddr] }目标 MAC 地址和掩码。
mac-protocolalt { protocol-name: enum (ip-or-ipv6 | non-ip) { ip-or-ipv6:0x10000, non-ip:0x10001 } , protocol-number: num [ .. 65535] }以太网载荷类型(MAC 级协议)。 - 802.2 - 802.2 帧(0x0004) - arp - 地址解析协议(0x0806) - capsman - CAPsMAN 到 CAP 的 MAC 层连接(0x88BB) - dot1x - EAPoL IEEE 802.1X 认证(0x888E) - homeplug-av - HomePlug AV MME 消息(0x88E1) - ip - 互联网协议版本 4(0x0800) - ip-or-ipv6 - IPv4 或 IPv6(0x0800 或 0x86DD) - ipv6 - 互联网协议版本 6(0x86DD) - ipx - 网际数据包交换(0x8137) - lacp - 链路聚合控制协议(0x8809) - lldp - 链路层发现协议(0x88CC) - loop-protect - 环路保护协议(0x9003) - macsec - MAC 安全 IEEE 802.1AE(0x88E5) - mpls-multicast - MPLS 多播(0x8848) - mpls-unicast - MPLS 单播(0x8847) - mvrp - 多 VLAN 注册协议(0x88F5) - non-ip - 非互联网协议版本 4(非 0x0800) - packing-compr - 带压缩 IP packing 的封装数据包(0x9001) - packing-simple - 带简单 IP packing 的封装数据包(0x9000) - pppoe - PPPoE 会话阶段(0x8864) - pppoe-discovery - PPPoE 发现阶段(0x8863) - rarp - 反向地址解析协议(0x8035) - romon - 路由器管理覆盖网络 RoMON(0x88BF) - service-vlan - 提供商桥接 IEEE 802.1ad 和最短路径桥接 IEEE 802.1aq(0x88A8) - vlan - IEEE 802.1Q 的 VLAN 标记帧以及具有 NNI 兼容性的最短路径桥接 IEEE 802.1aq(0x8100)
lookup-vidnum查找中使用的 VLAN ID。它可以在到达出站表之前被更改。
ip-protocolenum (tcp | udp | udp-lite | other) { tcp:0, udp:1, udp-lite:2, other:3 }IP 协议类型。
fragmentedbool是否匹配分片数据包。
first-fragmentboolYES 匹配未分片和第一个分片,NO 匹配其他分片。
ttlenum (0 | 1 | max | other) { 0:0, 1:1, max:2, other:3 }匹配数据包的 TTL 字段。
ip-dstcomposite { address: ipAddr , netmask: [ num [ .. 32]] }匹配目标 IPv4 地址。
ip-srccomposite { address: ipAddr , netmask: [ num [ .. 32]] }匹配源 IPv4 地址。
dscpnum匹配数据包的 DSCP 字段。
ecnnum匹配数据包的 ECN 字段。
ipv6-dstip6Prefix匹配目标 IPv6 地址。
ipv6-srcip6Prefix匹配源 IPv6 地址。
mac-isolation-profileenum (promiscuous | isolated | community1 | community2) { promiscuous:0, isolated:1, community1:2, community2:3 }基于 UFDB 匹配隔离配置文件。仅在出站政策表中有效。
src-mac-addr-stateenum (sa-found | sa-not-found | dynamic-station-move | static-station-move) { sa-found:0, sa-not-found:1, dynamic-station-move:2, static-station-move:3 }定义是否匹配具有已注册状态的数据包 - 目标 MAC 地址位于 UFDB/MFDB/RFDB 中的数据包。仅在出站政策表中有效。
flow-idnum
actionenum (forward | redirect-to-cpu | copy-to-cpu | send-to-new-dst-ports | drop) { forward:0, redirect-to-cpu:1, copy-to-cpu:2, send-to-new-dst-ports:3, drop:7 }对匹配 ACL 数据包执行的操作。 - copy-to-cpu - 数据包被复制到 CPU。 - drop - 数据包被丢弃。 - forward - 数据包被转发。 - redirect-to-cpu - 数据包被重定向到 CPU。 - send-to-new-dst-ports - 数据包被发送到新的目标端口。
new-dst-portsmulti { array-id }如果操作为 send-to-new-dst-ports,则此属性设置哪些端口/trunk 是新的目标。
new-flow-idnum
attack-filter-bypassbool
ingress-vlan-filter-bypassbool允许匹配数据包绕过 VLAN 表中的入站 VLAN 过滤。仅适用于入站政策表。
egress-vlan-filter-bypassbool允许匹配数据包绕过 VLAN 表中的出站 VLAN 过滤。仅适用于入站政策表。
isolation-filter-bypassbool允许匹配数据包绕过隔离表。仅适用于入站政策表。
new-registered-statebool是否修改数据包状态。YES 将数据包状态设置为已注册,NO - 未注册。仅在入站政策表中有效。
src-mac-learnbool是否学习匹配 ACL 数据包的源 MAC。仅在入站政策表中有效。
mirror-toenum (mirror0 | mirror1) { mirror0:0, mirror1:1 }ACL 数据包的镜像目标。
new-service-vidnumACL 数据包的新服务 VLAN ID。
new-customer-vidnumACL 数据包的新客户 VLAN ID。如果设置为 4095,则流量被丢弃。
egress-vlan-translate-bypassbool允许匹配数据包绕过出站 VLAN 转换表。
new-service-pcpnumACL 数据包的新服务 PCP。
new-service-deinumACL 数据包的新服务 DEI。
new-customer-pcpnumACL 数据包的新客户 PCP。
new-customer-deinumACL 数据包的新客户 DEI。
new-dscpnumACL 数据包的新 DSCP。
new-prioritynumACL 数据包的新内部优先级。
new-drop-precedenceenum (green | yellow | red | drop)ACL 数据包的新内部丢弃优先级。
policerenum应用于 ACL 数据包的 ACL Policer。