I’m playing with load balancing using pcc firewall rules in mangle
and I’ve noticed that when I do a ping, tool fetch, or any other traffic
from the console, it doesn’t get matched to any of my mangle rules.
I just tried and I can’t get of the chains in mangle to trap router initiated traffic,
including dns lookups.
I use google’s dns servers and my wan connections are equal so I’d like to
prevent things like dns traffic from going out the same port every time.
Probably you are marking/PPC forwarded traffic in mangle/prerouting chain; if you want to mark/PCC router originated traffic you must work on mangle/output chain also.
Not yet, I have the same problem. I have tried output chain and mark-routing but it is not working.
If there is no default route, the packets originated from the router itself do not get catched in any of the mangle rules and they do not show up in the connection tab.
Any suggestion? I have tried many different chain combinations unsuccessfully.
This picture says it all. Routing comes first, only then the packet passes through the output chain in various tables (conntrack, mangle, filter), and finally the routing is eventually “adjusted” (see the exploded Output chain).
I’ve seen this before. When there’s no route to given destination in main routing table, RouterOS just says “no route to host” and doesn’t give you a chance to mark routing and use another routing table where such route exists. The workaround should be simple, just add fake route, e.g.:
Thank you Sob, that was very fine coding!
It worked like a charm. With the fake bridge, any connection from the router itself now shows up in the firewall connection tab, and once you have it there, it is catched by the mangle rules and it is easy to route it through the WAN that you want.
Awesome suggestion!!