From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2F3DB60B2D for ; Mon, 19 Oct 2020 12:56:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 244362B9EF for ; Mon, 19 Oct 2020 12:56:34 +0200 (CEST) Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 35F652B9E4 for ; Mon, 19 Oct 2020 12:56:33 +0200 (CEST) Received: by mail-lj1-x243.google.com with SMTP id x16so11408587ljh.2 for ; Mon, 19 Oct 2020 03:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=odiso-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=SeB9xXUOEv3ocbpNBZyqdbBKFEHZ91XzliynmVFA7Cc=; b=u+S1XwIRqQTUzh79D5WYtun55jfE26dj2VMROlbPq8JJvKoFm6IxOuIOkJBGgqpAA4 uEjZayhcsBE1trBnETTcjzR8j94JYc3BUlWSr9GjwOquP1bNYORTqNpDXqYHt4H1TfJ/ 0csAP90fVItug+KS6vlK97GHC30ym1iCAuxo5havTR3AUWzl/3aSZh1DOP+zTvuPD/Nu /Ts+IP4+tKgShcHvXD1zjkkqLtmeK76ekajpgzQgpTvPhAp6ie4KJtH8JzibXczrtYOy xJ/UPi8kOI4YS6z24f+rbS4fThp1mKXCKKr+bZvaC2EOqf9y6U2fi/Oql1YM+j/+EYKN lw0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=SeB9xXUOEv3ocbpNBZyqdbBKFEHZ91XzliynmVFA7Cc=; b=gijnqlyxSirvH3bK9ULGGTQp8wTtmK3AU4jo6iAmwIrmvYw4UuuNquSQjbWCjyc/54 fjVeVs35O9o0oceXXiAiIQlFJsiqwy/yHR4BgjoPGmCD/hiVnaYx7Ehs1hES1ILIusLv DpkX84juQGEGYVKs2PT/RoQohFZj46Tf+mCirGJfIXkaLlsl9bjSCqfGj/aQNGgswkX+ 69NhPdH1ERiENu3gil41vssOzOT8pHonOrVpqt3Fv0eGTpfvQz/wo+ODSuZw1ue1Avqm Rme97wPKg+PbxIROGxG69Kj3a1vizXx2OmsP9KatNjKbiYbtD/+gDO9xJ7+kK6QHMtc3 KKew== X-Gm-Message-State: AOAM530blC0Ncxi7zUeUZ7lzFS/RLZPYGriQNl7uMrH/LNKz/WvKtK// TCasvIxPcuThnB1yg+gQpqZF+smRedFFMrbBSbv9cge42PBNqKP8 X-Google-Smtp-Source: ABdhPJygyZl/qeVHHo4SFiXXqDgq09FnY8FIAvgxbjSk8WvZm0gRh+G82H69lhm5qmstVig0inQbvBXmhKNXQb9dcnc= X-Received: by 2002:a2e:b610:: with SMTP id r16mr5959739ljn.145.1603104986418; Mon, 19 Oct 2020 03:56:26 -0700 (PDT) MIME-Version: 1.0 References: <20201016132417.5175-1-m.limbeck@proxmox.com> <20201016132417.5175-3-m.limbeck@proxmox.com> In-Reply-To: From: Alexandre Derumier Date: Mon, 19 Oct 2020 12:56:15 +0200 Message-ID: To: Proxmox VE development discussion Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.400 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature KAM_ASCII_DIVIDERS 0.8 Spam that uses ascii formatting tricks RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu-server] copy conntrack information on migration X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 10:56:34 -0000 >>There are no filters implemented yet, and there does not seem to be a >>way to filter by interface. So if we want to limit the conntracks to >>certain VMs, we could use zones and add a filter for them. >>We would have to map them somehow though as the zone parameter is only >>16 bits and VMIDs might be bigger. oh yes, I remember that. Also, zone by vm add a lot of rules in prerouting if you have a lot of vms, so I don't known the impact on performance. Maybe with nftables, as we have the conntrack at bridge level, it's possible to have more informations like mac to find the vm. (not sure about this). also with nftables, if possible to use a vmap on interface, for fast lookup of vm rules/or add the zone in prerouting. Le lun. 19 oct. 2020 =C3=A0 11:24, Mira Limbeck a = =C3=A9crit : > > I haven't done any performance tests yet. But currently we query all > conntracks (same as conntrack -L), print them one by one as JSON to STDOU= T. > When importing we do it line-by-line, which means one conntrack at a > time. But if necessary we could batch them, as mentioned in the > bugtracker, by using the mnl batch interface. > > There are no filters implemented yet, and there does not seem to be a > way to filter by interface. So if we want to limit the conntracks to > certain VMs, we could use zones and add a filter for them. > We would have to map them somehow though as the zone parameter is only > 16 bits and VMIDs might be bigger. > > > On 10/17/20 5:42 PM, Alexandre Derumier wrote: > > Hi, > > thanks for this patch ! > > > > It could be interesting to see if it's working fine with > > sysctl -w net/netfilter/nf_conntrack_tcp_loose=3D0 > > > > This is to avoid ack flood ddos (where random ack packets can add a > > lot of conntrack entries) > > https://2014.rmll.info/slides/356/day_1-1400-Jesper_Brouer-DDoS_protect= ion_using_Netfilter_iptables.pdf > > > > Currently we can't enable it because when we migrate vms, the already > > opened connected can't readd conntrack without a new syn. > > > > > > Also, is it fast when a lof of entries ? (like 100000 entries for examp= le) > > > > > > Le ven. 16 oct. 2020 =C3=A0 15:24, Mira Limbeck = a =C3=A9crit : > >> Requires the pve-conntrack-tool. On migration the conntrack informatio= n > >> from the source node is dumped and sent to the target node where it is > >> then inserted. > >> This helps with open connections during migration when the firewall is= active. > >> > >> Signed-off-by: Mira Limbeck > >> --- > >> PVE/QemuMigrate.pm | 3 +++ > >> 1 file changed, 3 insertions(+) > >> > >> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm > >> index 11fec4b..a4e24f7 100644 > >> --- a/PVE/QemuMigrate.pm > >> +++ b/PVE/QemuMigrate.pm > >> @@ -1065,6 +1065,9 @@ sub phase2 { > >> die "unable to parse migration status '$stat->{status}' -= aborting\n"; > >> } > >> } > >> + > >> + $self->log('info', 'copy conntrack information'); > >> + PVE::Tools::run_command([['/usr/bin/pve-conntrack-tool', 'dump'],= [@{$self->{rem_ssh}}, '/usr/bin/pve-conntrack-tool', 'insert']]); > >> } > >> > >> sub phase2_cleanup { > >> -- > >> 2.20.1 > >> > >> > >> > >> _______________________________________________ > >> pve-devel mailing list > >> pve-devel@lists.proxmox.com > >> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > >> > > _______________________________________________ > > pve-devel mailing list > > pve-devel@lists.proxmox.com > > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel