/interface/ethernet/switch/acl
acl
访问控制列表由入站政策和出站政策引擎组成,允许配置最多 128 条政策规则(受 RouterOS 限制)。它是一种高级工具,可基于二层、三层和四层协议头字段条件进行线速数据包过滤、转发、整形和修改。
interface/ethernet/switch/acl
Syscap: musicswitch Type: Directory
访问控制列表由入站政策和出站政策引擎组成,允许配置最多 128 条政策规则(受 RouterOS 限制)。它是一种高级工具,可基于二层、三层和四层协议头字段条件进行线速数据包过滤、转发、整形和修改。
说明
由于硬件限制,无法在特定端口上匹配广播/多播流量。应使用端口隔离、在入站端口上丢弃流量,或使用 VLAN 过滤来防止某些广播/多播流量被转发。 | 标志 | 名称 | 描述 | | --- | --- | --- | |
X| disabled | | |I| invalid | |
| 参数 | 类型 | 描述 |
|---|---|---|
table | enum (ingress | egress) { ingress:0, egress:1 } | 选择用于入站或出站数据包的政策表。 |
invert-match | bool | 反转整个 ACL 规则匹配。 |
src-ports | multi { array-id } | 匹配物理源端口或 trunk。 |
dst-ports | multi { array-id } | 匹配物理目标端口或 trunk。由于硬件限制,无法在出站端口上匹配广播/多播流量。 |
service-vid | super { ! , service-vid: range [ .. 4095] } | 匹配服务 VLAN ID。 |
service-pcp | num | 匹配服务 PCP。 |
service-dei | num | 匹配服务 DEI。 |
customer-vid | super { ! , customer-vid: range [ .. 4095] } | 匹配客户 VLAN ID。 |
customer-pcp | num | 匹配客户 PCP。 |
customer-dei | num | 匹配客户 DEI。 |
src-l3-port | super { ! , src-l3-port: range [ .. 65535] } | 匹配三层源端口。 |
dst-l3-port | super { ! , dst-l3-port: range [ .. 65535] } | 匹配三层目标端口。 |
custom-fields | object { 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]] } } } | |
priority | num | 匹配内部优先级。仅在出站表中有效。 |
drop-precedence | enum (green | yellow | red | drop) | 匹配内部丢弃优先级。仅在出站表中有效。 |
dst-addr-registered | bool | 定义是否匹配具有已注册状态的数据包 - 目标 MAC 地址位于 UFDB/MFDB/RFDB 中的数据包。仅在出站表中有效。 |
service-tag | enum (untagged | priority-tagged | tagged | tagged-or-priority-tagged) { untagged:0, priority-tagged:1, tagged:2, tagged-or-priority-tagged:3 } | 服务标签格式。 |
customer-tag | enum (untagged | priority-tagged | tagged | tagged-or-priority-tagged) { untagged:0, priority-tagged:1, tagged:2, tagged-or-priority-tagged:3 } | 客户标签格式。 |
mac-src-address | super { address: macAddr , [mask] [ /macAddr] } | 源 MAC 地址和掩码。 |
mac-dst-address | super { address: macAddr , [mask] [ /macAddr] } | 目标 MAC 地址和掩码。 |
mac-protocol | alt { 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-vid | num | 查找中使用的 VLAN ID。它可以在到达出站表之前被更改。 |
ip-protocol | enum (tcp | udp | udp-lite | other) { tcp:0, udp:1, udp-lite:2, other:3 } | IP 协议类型。 |
fragmented | bool | 是否匹配分片数据包。 |
first-fragment | bool | YES 匹配未分片和第一个分片,NO 匹配其他分片。 |
ttl | enum (0 | 1 | max | other) { 0:0, 1:1, max:2, other:3 } | 匹配数据包的 TTL 字段。 |
ip-dst | composite { address: ipAddr , netmask: [ num [ .. 32]] } | 匹配目标 IPv4 地址。 |
ip-src | composite { address: ipAddr , netmask: [ num [ .. 32]] } | 匹配源 IPv4 地址。 |
dscp | num | 匹配数据包的 DSCP 字段。 |
ecn | num | 匹配数据包的 ECN 字段。 |
ipv6-dst | ip6Prefix | 匹配目标 IPv6 地址。 |
ipv6-src | ip6Prefix | 匹配源 IPv6 地址。 |
mac-isolation-profile | enum (promiscuous | isolated | community1 | community2) { promiscuous:0, isolated:1, community1:2, community2:3 } | 基于 UFDB 匹配隔离配置文件。仅在出站政策表中有效。 |
src-mac-addr-state | enum (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-id | num | |
action | enum (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-ports | multi { array-id } | 如果操作为 send-to-new-dst-ports,则此属性设置哪些端口/trunk 是新的目标。 |
new-flow-id | num | |
attack-filter-bypass | bool | |
ingress-vlan-filter-bypass | bool | 允许匹配数据包绕过 VLAN 表中的入站 VLAN 过滤。仅适用于入站政策表。 |
egress-vlan-filter-bypass | bool | 允许匹配数据包绕过 VLAN 表中的出站 VLAN 过滤。仅适用于入站政策表。 |
isolation-filter-bypass | bool | 允许匹配数据包绕过隔离表。仅适用于入站政策表。 |
new-registered-state | bool | 是否修改数据包状态。YES 将数据包状态设置为已注册,NO - 未注册。仅在入站政策表中有效。 |
src-mac-learn | bool | 是否学习匹配 ACL 数据包的源 MAC。仅在入站政策表中有效。 |
mirror-to | enum (mirror0 | mirror1) { mirror0:0, mirror1:1 } | ACL 数据包的镜像目标。 |
new-service-vid | num | ACL 数据包的新服务 VLAN ID。 |
new-customer-vid | num | ACL 数据包的新客户 VLAN ID。如果设置为 4095,则流量被丢弃。 |
egress-vlan-translate-bypass | bool | 允许匹配数据包绕过出站 VLAN 转换表。 |
new-service-pcp | num | ACL 数据包的新服务 PCP。 |
new-service-dei | num | ACL 数据包的新服务 DEI。 |
new-customer-pcp | num | ACL 数据包的新客户 PCP。 |
new-customer-dei | num | ACL 数据包的新客户 DEI。 |
new-dscp | num | ACL 数据包的新 DSCP。 |
new-priority | num | ACL 数据包的新内部优先级。 |
new-drop-precedence | enum (green | yellow | red | drop) | ACL 数据包的新内部丢弃优先级。 |
policer | enum | 应用于 ACL 数据包的 ACL Policer。 |