It's crazy how every new thing created a boatload of new stuff that doesn't work: By just using VRFs, RouterOS effectively forces me to migrate everything to VRF (*). But now VRFs destroy properly designed firewall rules:
Started from version 7.14 when interfaces are added in VRF - virtual VRF interface is created automatically. If it is needed to match traffic which belongs to VRF interface, VRF virtual interface should be used in firewall filters, [...] If there are several interfaces in one VRF but it is needed to match only one of these interfaces - marks should be used.
WHY? Why this terrible change?? I could cry.
This leaves me effectively with just two very sub-optimal options:
- Avoid filtering by interface completely
- Using connection or packet marks
Good practice is not to use addresses but interfaces in filter rules. This is clean, avoids spoofing and such. Which rules out #1.
There can only be one conn/packet mark per packet which means if marking is used for any other purpose it interferes with firewall rules (which really should be filter rules, not mangle rules) and rules out #2
#2 has an additional issue: Good practice is to write firewall rules as "block everything and selectively allow" to avoid rules unintentionally passing traffic. But with marks in mangle it's extremely hard to follow the logic since these can be overwritten unintentionally. It's very easy to unintentionally rip holes into the firewall because a mark was overwritten later. It actually happened to me already.
And one more reason why this is terrible: When using interface lists, it can generate overlapping rules.
Hence I really don't understand how on earth anyone at Mikrotik could think this was a good idea.
I'm really stuck with my migration and going back and forth what I should do.
My current firewall is designed to simulate zones based on interface lists and jumping to various sub chains. Overall, it starts with rules that allow traffic from one "zone" to the other. Then more specific "traffic_rules" for the rest. I started to just create marks for each interface and interface list but quickly ran into conflicts based on what I wrote above.
Any words of wisdom?
PS: I use marking already for certain hacks and bug fixes (e.g. setting BFD source addresses, policy routing) incl queues/traffic shaping ... which also require marks for everything but super basic setups.
(*) because proper dynamic route leaking does not work with main VRF.



