<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - nftables - dynamic update for verdict map from the packet path"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1736#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - nftables - dynamic update for verdict map from the packet path"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1736">bug 1736</a>
from <span class="vcard"><a class="email" href="mailto:pablo@netfilter.org" title="Pablo Neira Ayuso <pablo@netfilter.org>"> <span class="fn">Pablo Neira Ayuso</span></a>
</span></b>
<pre>(In reply to dinhtrason from <a href="show_bug.cgi?id=1736#c7">comment #7</a>)
<span class="quote">> > Can you use the conntrack mark (instead of the packet mark)?
> >
> > Looking at your ruleset, that makes sense to me, because this also allows to
> > debug via `conntrack -L' what endpoint has being selected for a given flow,
> > also for netfilter logging as well as `conntrack -E' for event reporting.
> >
> > You do use conntrack, because I can see 'dnat to' is used in your ruleset
> > after the endpoint is selected based on the affinity, note that the stateful
> > NAT engine requires conntrack.
> >
>
> That makes sense. </span >
BTW, you probably want to reserve ct mark == 0 for flow which is not yet pinned
to an endpoint, which is the initial value for the conntrack mark anyway when
the flow is created. Then, you have to adjust maps.
Note that numgen random allows for offset, you could even try to make the ct
mark unique, that is, ensure that each service has its own ct mark space. This
goes with the idea of allowing you to use the existing conntrack userspace tool
and as well netfilter logging to debug issues (eg. a flow going somewhere it
should not).
<span class="quote">> > I have attached a sketch ruleset I build from your link, I mangled it to use
> > ct mark.
>
> Thanks for your quick reply. I'll give it a try.
>
>
> > vm-001 ~ # nft --file /tmp/test.txt
> > /tmp/test.txt:17:70-73: Error: syntax error, unexpected vmap
> > add rule ip loadbalancer service-ABC ip saddr map @affinity-mappings vmap @epToChain
>
> BTW, I had a commit to support the case. Could you please let me know how I
> can send the patch? I refer to the guide
> <a href="https://wiki.nftables.org/wiki-nftables/index.php/Portal:DeveloperDocs/">https://wiki.nftables.org/wiki-nftables/index.php/Portal:DeveloperDocs/</a>
> Patch_submission_guidelines, but could not see the email address that I can
> send the patch to.</span >
You mean you would like to support for map lookup then use the result as input
for another verdict map lookup?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>