I was trying to drop most of my inbound traffic except for remote admin connections and came across a method that worked, but I wondered if it was inefficient or prone to flaws:
Mangle:
;;;SSH From Admin MAC Address
chain=prerouting protocol=tcp dst-port=22 src-mac-address=xx:xx:xx:xx:xx:xx action=mark-connection new-connection-mark=ADMIN_MAC passthrough=yes
I planned on adding one filter rule to check for my connection mark and then adding subsequent mangles as needed for admin MAC addresses. Is there a better way to do this?
I am new to Mikrotik products and networking in general so please feel free to criticize any mistakes in my thinking.
General Methodology is to only allow certain specific protocols/ports from certain specified IP ranges “allowed” in the INPUT chain of the router. Everything else is dropped via a final “drop everything” FW rule.
In my case the the (comand & control) C&C list is a short list of IP subnets and IP addresses from which access to the router is allowed… this makes it easier to add/change/delete IP’s and subnets from the access list.