Ok, I finally almost solved it completely in ACL! Without even using the CPU.
Only remaining problem is when I add the final “drop all other” rule: then it blocks somehow too much. Will analyze the final missing part later with tcpdump…
[admin2@MikroTik] /interface/ethernet/switch/rule> print
Flags: X - disabled, I - invalid; D - dynamic
0 switch=switch1 ports=ether1,ether2,ether3,ether4,ether5,ether6,ether7,ether8,ether9,ether10,ether11,ether12,ether13,ether14,ether15,ether16,ether17,ether18,ether19,ether20,
ether21,ether22,ether23,ether24,sfp-sfpplus1,sfp-sfpplus2,switch1-cpu
mac-protocol=ip protocol=tcp dst-port=80 copy-to-cpu=no redirect-to-cpu=no mirror=no
…
It’s not fully tested yet.
Update:
I now asked the Technical Support with the following support ticket describing the problem:
ACL firewall blocks too much. Need advice.
Hello Technical Support of MikroTik,
my device is a CRS326 with RouterOS 7.0beta5.
I need to use the ACL firewall (ie. the firewall on the switch chip) of this device. Below are my firewall rules.
This switch is in a small LAN environment. There is no other switch device in this LAN, but there is an uplink-router (Ubiquiti).
The ACL is described here > https://wiki.mikrotik.com/wiki/Manual:CRS3xx_series_switches#Switch_Rules_.28ACL.29 > .
This shall make up a central firewall for all clients attached to this switch.
I have the following firewall rules imported, but the last rule does block too much.
As can be seen, besides select TCP, UDP, ICMP packets I’m already accepting all ARP, RARP, and 802.2 packets.
But there must be some other essential protocol(s) missing in my list below as it blocks too much.
Can you please tell me which other mandatory/essential (broadcast?) protocol/s is/are missing in this rules list?
Thanks.
Regards,
xxx
My ACL_firewall.rsc file for import:
###########
/interface ethernet switch rule
:global myPorts “ether1,ether2,ether3,ether4,ether5,ether6,ether7,ether8,ether9,ether10,
ether11,ether12,ether13,ether14,ether15,ether16,ether17,ether18,ether19,ether20,
ether21,ether22,ether23,ether24,sfp-sfpplus1,sfp-sfpplus2,switch1-cpu”
add all allowed ports and their protocols:
add mac-protocol=ip protocol=tcp dst-port=80 switch=switch1 ports=$myPorts
add mac-protocol=ip protocol=tcp dst-port=443 switch=switch1 ports=$myPorts
add mac-protocol=ip protocol=tcp dst-port=22 switch=switch1 ports=$myPorts
add mac-protocol=ip protocol=udp dst-port=53 switch=switch1 ports=$myPorts
add mac-protocol=ip protocol=tcp dst-port=53 switch=switch1 ports=$myPorts
add mac-protocol=ip protocol=udp dst-port=123 switch=switch1 ports=$myPorts
add mac-protocol=ip protocol=tcp dst-port=123 switch=switch1 ports=$myPorts
add mac-protocol=ip protocol=icmp comment=“accept all icmp types” switch=switch1 ports=$myPorts
add mac-protocol=arp comment=“essential” switch=switch1 ports=$myPorts
add mac-protocol=rarp comment=“essential” switch=switch1 ports=$myPorts
add mac-protocol=802.2 comment=“essential” switch=switch1 ports=$myPorts
#…
add new-dst-ports=“” comment=“drop/deny all other” switch=switch1 ports=$myPorts disabled=no
###########