Community discussions

MikroTik App
 
asandres
just joined
Topic Author
Posts: 5
Joined: Wed Nov 02, 2022 6:25 pm

Connection mark misconfiguration?

Wed Nov 02, 2022 6:44 pm

Hello all,

I'm facing a weird behavior using IPv6 connection mark on RouterOS v7.6 Stable. I'm setting a new connection mark to ICMP (protocol ICMPv6) and DNS (UDP port 53) connections, then I mark packets to QoS simple queue.

I have noticed some connection UDP 443, but there is no rule in mangle that match this protocol/port to me marked as "ICMP+DNS_conn". As shown below, I have only 2 rules to mark this connections.

There are a 3 attachments to illustrate this.

Connection marks in mangle:
Connections marks.png
Connections marked correctly:
Mark OK.png
Connection that should not be marked:
Mark not OK.png
Can someone please point me a direction?
You do not have the required permissions to view the files attached to this post.
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: Connection mark misconfiguration?

Thu Nov 03, 2022 10:02 am

In the IPv4 connection tracking, the connection mark values are inherited from the basic connection also to the "related" ones (e.g. if a TCP packet that has the DF flag set and exceeds the MTU of the outgoing interface, the ICMP "fragmentation needed" packet reporting this to the sender gets the same connection mark like that TCP packet).

So I would assume that here it works also in the reverse direction, and at some point, an ICMPv6 packet has arrived that was related to the UDP connection to port 443 and got marked with your connection mark, and the basic connection has inherited the connection mark.
 
asandres
just joined
Topic Author
Posts: 5
Joined: Wed Nov 02, 2022 6:25 pm

Re: Connection mark misconfiguration?

Mon Nov 07, 2022 8:21 pm

Thanks for reply! I agree that is a possible couse!

What you suggest to solve this? Mark only connections with connection state equal new? Mark connection with connection state not equal related?

I'm testing the first option, mark only if connection state equal new.
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: Connection mark misconfiguration?

Mon Nov 07, 2022 9:04 pm

Mark only connections with connection state equal new?
Yes.

Mark connection with connection state not equal related?
That would selectively address the suspected cause, but the above way is clearer.
 
asandres
just joined
Topic Author
Posts: 5
Joined: Wed Nov 02, 2022 6:25 pm

Re: Connection mark misconfiguration?

Wed Nov 09, 2022 3:26 pm

Mark only connections with connection state equal new?
Yes.

Mark connection with connection state not equal related?
That would selectively address the suspected cause, but the above way is clearer.
Sindy, the first alternative, to mark only connection state equal new, did the job.

Many thanks!
 
prawira
Trainer
Trainer
Posts: 359
Joined: Fri Feb 10, 2006 5:11 am

Re: Connection mark misconfiguration?

Fri Apr 14, 2023 6:34 am

Hello all,

I am facing the same problem during last few months and the solution is to put connection-state=new,established.
the connection-state=established for the return traffic.
so far i am not see the packets with protocol tcp and udp anymore.

P

Who is online

Users browsing this forum: astons2, nz_monkey and 132 guests