From: sbezverk <sbezverk@gmail.com>
To: Florian Westphal <fw@strlen.de>
Cc: Phil Sutter <phil@nwl.cc>,
"netfilter-devel@vger.kernel.org"
<netfilter-devel@vger.kernel.org>
Subject: Re: load balancing between two chains
Date: Mon, 20 Jan 2020 12:42:11 -0500 [thread overview]
Message-ID: <A774A3A8-64EB-4897-8574-076CC326F020@gmail.com> (raw)
In-Reply-To: <20200120170656.GE795@breakpoint.cc>
Hello,
Changed kernel to 5.4.10, and switch to use "inc" instead of "random". Now first curl works and second fails. Whenever second chain is selected to be used, curl connection gets stuck.
chain k8s-nfproxy-svc-M53CN2XYVUHRQ7UB {
numgen inc mod 2 vmap { 0 : goto k8s-nfproxy-sep-TMVEFT7EX55F4T62, 1 : goto k8s-nfproxy-sep-GTJ7BFLUOQRCGMD5 }
counter packets 1 bytes 60 comment ""
}
chain k8s-nfproxy-sep-TMVEFT7EX55F4T62 {
counter packets 1 bytes 60 comment ""
ip saddr 57.112.0.41 meta mark set 0x00004000 comment ""
dnat to 57.112.0.41:8080 fully-random
}
chain k8s-nfproxy-sep-GTJ7BFLUOQRCGMD5 {
counter packets 0 bytes 0 comment ""
ip saddr 57.112.0.52 meta mark set 0x00004000 comment ""
dnat to 57.112.0.52:8989 fully-random
}
Any debug I could enable to see where the packet goes?
Thank you
Serguei
On 2020-01-20, 12:06 PM, "Florian Westphal" <fw@strlen.de> wrote:
sbezverk <sbezverk@gmail.com> wrote:
> HI Phil,
>
> There is no loadblancer, curl is executed from the actual node with both pods, so all traffic is local to the node.
>
> As per your suggestion I modified nfproxy rules:
>
> chain k8s-nfproxy-svc-M53CN2XYVUHRQ7UB {
> numgen random mod 2 vmap { 0 : goto k8s-nfproxy-sep-I7XZOUOVPIQW4IXA, 1 : goto k8s-nfproxy-sep-ZNSGEJWUBCC5QYMQ }
> counter packets 3 bytes 180 comment ""
> }
>
> chain k8s-nfproxy-sep-ZNSGEJWUBCC5QYMQ {
> counter packets 0 bytes 0 comment ""
> ip saddr 57.112.0.38 meta mark set 0x00004000 comment ""
> dnat to 57.112.0.38:8080 fully-random
> }
>
> chain k8s-nfproxy-sep-I7XZOUOVPIQW4IXA {
> counter packets 1 bytes 60 comment ""
> ip saddr 57.112.0.36 meta mark set 0x00004000 comment ""
> dnat to 57.112.0.36:8989 fully-random
> }
Weird, it looks like it generates 0 and something else, not 1.
Works for me on x86_64 with 5.4.10 kernel:
table ip test {
chain output {
type filter hook output priority filter; policy accept;
jump k8s-nfproxy-svc-M53CN2XYVUHRQ7UB
}
chain k8s-nfproxy-svc-M53CN2XYVUHRQ7UB {
numgen random mod 2 vmap { 0 : goto k8s-nfproxy-sep-I7XZOUOVPIQW4IXA, 1 : goto k8s-nfproxy-sep-ZNSGEJWUBCC5QYMQ }
counter packets 0 bytes 0
}
chain k8s-nfproxy-sep-ZNSGEJWUBCC5QYMQ {
counter packets 68602 bytes 5763399
ip saddr 57.112.0.38 meta mark set 0x00004000 comment ""
}
chain k8s-nfproxy-sep-I7XZOUOVPIQW4IXA {
counter packets 69159 bytes 5809685
ip saddr 57.112.0.36 meta mark set 0x00004000 comment ""
}
}
(I removed nat rules and then ran ping -f 127.0.0.1).
Does it work when you use "numgen inc" instead of "numgen rand" ?
next prev parent reply other threads:[~2020-01-20 17:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 2:46 load balancing between two chains sbezverk
2020-01-20 11:23 ` Phil Sutter
2020-01-20 16:31 ` sbezverk
2020-01-20 17:06 ` Florian Westphal
2020-01-20 17:42 ` sbezverk [this message]
2020-01-20 21:39 ` Florian Westphal
2020-01-20 21:54 ` sbezverk
2020-01-20 22:00 ` Florian Westphal
2020-01-20 22:07 ` sbezverk
2020-01-20 22:12 ` Florian Westphal
2020-01-20 22:50 ` sbezverk
2020-01-21 4:18 ` sbezverk
2020-01-21 5:24 ` Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A774A3A8-64EB-4897-8574-076CC326F020@gmail.com \
--to=sbezverk@gmail.com \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).