From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SIbTOn+DJGQJEgEASxT56A (envelope-from ) for ; Wed, 29 Mar 2023 20:29:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YEK0On+DJGQ7BgAA9RJhRA (envelope-from ) for ; Wed, 29 Mar 2023 20:29:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BCCC41438A for ; Wed, 29 Mar 2023 20:29:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phaXP-0003mk-3Y; Wed, 29 Mar 2023 14:28:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phaXN-0003mG-5o for help-guix@gnu.org; Wed, 29 Mar 2023 14:28:45 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phaXK-00051i-Vp for help-guix@gnu.org; Wed, 29 Mar 2023 14:28:44 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 97c847ce; Wed, 29 Mar 2023 18:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=kXd3T/btzjtw ekhLhGzL/pV0e7bu17b15qeo788nkNc=; b=HKQ3larEECKW/WwgZxrUx6oru6OJ h35G5nMYYn2skqU+t3efd88PFnTs1w2k4+w0iDTdizi1sEKPLMJ5EqmL1Az6NlYk Ep5k+wJneQCbxk40szJGsxhyKdh9L7Tw8fsPOfcKBAnXI54afNFIyk0Js+WAsrBL 9R1fM/Nv+JDgrcOBBdqbeZy6Vf3YcxE7mMvbmpAgEHbQR347WI9DeOOMhNz+G2tG 62hdH8MBbsXP+8wz3toK5Au6Z8+uOzRPB9HQvD/mN+0SCZpCbUeA49Yuo2Y6thXr gJa2kjJSTBxOVQOXN+TQCNsIHd5XekS2YNj3Ar0Dwpf40GWgqPMOXqd/ZQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 698da3eb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 29 Mar 2023 18:27:33 +0000 (UTC) Date: Wed, 29 Mar 2023 20:27:22 +0200 From: Julien Lepiller To: Denis 'GNUtoo' Carikli Cc: help-guix@gnu.org Subject: Re: static-networking-service-type: Using a static network bridge Message-ID: <20230329202717.506cae04@sybil.lepiller.eu> In-Reply-To: <20230327193753.7c4a04c1@primary_laptop> References: <20230322013248.7299a393@primary_laptop> <66E59A8E-82D0-4CE0-B37B-EA4C91A5FA2A@lepiller.eu> <20230324000850.27e89cc1@primary_laptop> <20230327193753.7c4a04c1@primary_laptop> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lepiller.eu header.s=dkim header.b=HKQ3larE; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=lepiller.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680114559; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qcqQs7iIpWF3b9RiwW/BGJBSP+LCFkm36o8P+1A4rPE=; b=kZIqvkmbR/3t+Mv9QuucYN73sOhc8Xs+d/SUJgfjRpjObbtej17SuGpYLXTwPkzY0Qx1Hy lNPg9AbdhwAMBB4sjMHnbWd2YsKVkEgwFxl6wJ0jzKzrHOLKLUZf8r8BQD8Fp6OTHivIvu Co6oMx1liphcFtPOCwH87h1ZJaFkS97WP5hdhHGZcoiWNoaZUCA81SO8sgNoKL3g1FoHNG 3lp5/BIMYuDiGtGo8uhkO3TOVIHkX7w3O4h9mBZ6cQ9RTtH7iMIQ2ZGbr8xtxOaBu5hQLL 7EstXc7Fl1zEss4Qf2HBuKpNZs7JvphawbB8ozwJqHPhLjQ+8q481LaIwRSXJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680114559; a=rsa-sha256; cv=none; b=IeLG4QNOPVo6kAdWlqEiVJ+X8hg6WvBmmVhxJXHl+jtq+zCuNEqDTh8DStZOBHuQtoFDxN 0c3d7gS+fW7kBFQmIIfxnhxj1vrnut35U5k9hVy5riUphkJQiLgHGMF102hJRPogFguggN +JuC3PaP3oKemQjrZ+y8dDR4LvZZQs1rqhlTamZBZ5AdTwK3yLA+RDwFeEkgIXqd3TSIUg OyItmPG7duCB3W4VL7f5itGYw9NCFXRv/nbMzL3LoY1HrQGKtENMGAE1v9ZkmchmzFhtVQ YvMOSUpDIK/rO5WH2+2I/FDDrcG/2UaOeyErbyEG7TddjhxYURl1wXb4cueGOg== X-Migadu-Spam-Score: -4.95 X-Migadu-Scanner: scn1.migadu.com X-Migadu-Queue-Id: BCCC41438A Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lepiller.eu header.s=dkim header.b=HKQ3larE; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=lepiller.eu X-Spam-Score: -4.95 X-TUID: dhvVMbMIAa/y Le Mon, 27 Mar 2023 19:37:53 +0200, Denis 'GNUtoo' Carikli a =C3=A9crit : > On Fri, 24 Mar 2023 18:14:48 +0100 > Julien Lepiller wrote: >=20 > > The type should be a string, so "bridge" would be correct. However, > > it's not supported by guile-netlink yet, sorry. Do you think you > > could send me a scenario with iproute2 commands so I ean test an > > implementation? =20 > What is a scenario here? >=20 > If it's about reproducing a setup with bridges something like that is > probably the easiest for the creation of the bridge: >=20 > +-->[eth0]<---->Local > network<-->Router<-->Internet | > +----------+ v +----------+ > | VM1 [eth0]<--> [br0] <-->[eth0] VM2 | > +----------+ +----------+ >=20 > The bridge would be created with: > > sudo ip link add br0 type bridge > > ip link set dev br0 up =20 >=20 > Then the host eth0 can joint it like that: > > sudo ip link set dev eth0 master br0 > > sudo ip link set dev eth0 up =20 OK, I figured it out. So, bridges are actually supported in guile-netlink, and here is how you would do that with guile-netlink: > (link-add "br0" "bridge") > (link-set "br0" #:master "eth0") So, you should be able to add the bridge with > (network-link (name "br0") > (type "bridge")) However, I don't see link-set being used except for setting interfaces UP in the networking-service in Guix, so I think this is not yet supported. It should not be too difficult to do though. Probably, adding some more optional fields in static-networking-link for the arguments supported by link-set, then call link-set with these arguments when they are set. Do you think you could come up with a patch for that? If you want to add an IP address to the new link, we probably also need to reverse the link and addr order in network-set-up/linux. With such a patch, you should then be able to write something like > (network-link (name "br0") > (type "bridge") > (master "eth0")) WDYT?