Community discussions

MikroTik App
 
mtkvvv
just joined
Topic Author
Posts: 24
Joined: Sun Jun 23, 2019 7:42 am

Routing/firewalling exceptions

Mon Apr 22, 2024 5:50 pm

Hi,

I have certain port opened in router, that is nat-ed to one lan ip:port. But its amount of traffic with all my dumb firewall rules just dont seem to match my routers cpu power... I would like to excempt that traffic from firewalling altogether, in both directions. Or somehow route this traffic to my other router, which could then deal with firewalling only that specific traffic? Possibly without removing ways to bandwidth-limit that traffic if need arises.

I know I can fasttrack certain traffic, but I hear it also removes any chance to rate-limit that traffic. I could probably notrack that traffic? Could I possibly avoid nat-router firewall already at routing stage and shovel it out to port x on lan side?

Probably I am describing some very common technique for networking people. What is the possibly good ways to accomplish that - giving one router a break from conntracking and firewalling etc of specific lan ip?
 
User avatar
BrateloSlava
Member Candidate
Member Candidate
Posts: 170
Joined: Mon Aug 09, 2021 10:33 am
Location: Ukraine, Kharkiv

Re: Routing/firewalling exceptions

Mon Apr 22, 2024 6:15 pm

I don't understand - why don't you do some experiments? And check the change in load on your router? For example, after a command like this:
/ip firewall raw add action=notrack chain=prerouting comment="No track MO-TP" dst-address=172.22.0.10
 
mtkvvv
just joined
Topic Author
Posts: 24
Joined: Sun Jun 23, 2019 7:42 am

Re: Routing/firewalling exceptions

Mon Apr 22, 2024 6:22 pm

Asking here as to not experiment too much in the woods :)
Just dont know what is the common approaches to accomplish it. Will give notrack a try, thank you.

PS. In fw raw/prerouting, using my dstnated lan box ip, this matches no packets. At preroute chain its my wan ip being dst... Guessing nat isnt done yet, so target lan ip is not known yet.

Will read some more about these things.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11709
Joined: Thu Mar 03, 2016 10:23 pm

Re: Routing/firewalling exceptions

Mon Apr 22, 2024 7:27 pm

Sometimes it's easier not to mess with raw (and notrack) because raw rules are very rigid compared to filter rules (and, AFAIK, connection tracking is crucial for NAT). Instead it's possible to add another accept rule which matches traffic which should not be fasttracked and place it above the fasttrack rule. Which means that traffic can be then subject to queues or mangling or any other CPU-bound functions.
 
mtkvvv
just joined
Topic Author
Posts: 24
Joined: Sun Jun 23, 2019 7:42 am

Re: Routing/firewalling exceptions

Mon Apr 22, 2024 7:36 pm

Been doing that so far - accepting sooner etc. Still something, either need to pass firewall or conntracking keeps my cpu at 100% and bit too often also needs power-cycle to get over it... I was thinking the way I described in first post, just need to find a way to do it.

Unless I specify no ip and just tcp port in raw, it seems to match (trying with passthru and log action) incoming traffic by that port number. Just not sure what happens to return packets if notrack would be added as action.

I probably need to go experiment with some other dstnat rule and other lan ip first.

Who is online

Users browsing this forum: No registered users and 8 guests