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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 452EA60A8B for ; Mon, 19 Oct 2020 11:24:44 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 399DD2AEAF for ; Mon, 19 Oct 2020 11:24:44 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 407332AE2D for ; Mon, 19 Oct 2020 11:24:40 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 00D6A444A5 for ; Mon, 19 Oct 2020 11:24:40 +0200 (CEST) To: pve-devel@lists.proxmox.com References: <20201016132417.5175-1-m.limbeck@proxmox.com> <20201016132417.5175-3-m.limbeck@proxmox.com> From: Mira Limbeck Message-ID: Date: Mon, 19 Oct 2020 11:24:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-SPAM-LEVEL: Spam detection results: 0 AWL 0.066 Adjusted score from AWL reputation of From: address KAM_ASCII_DIVIDERS 0.8 Spam that uses ascii formatting tricks KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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 09:24:44 -0000 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 STDOUT. 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=0 > > 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_protection_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 example) > > > Le ven. 16 oct. 2020 à 15:24, Mira Limbeck a écrit : >> Requires the pve-conntrack-tool. On migration the conntrack information >> 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