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 sDhYFKTUIWS8ZAEASxT56A (envelope-from ) for ; Mon, 27 Mar 2023 19:38:44 +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 WARxFKTUIWSpoAAA9RJhRA (envelope-from ) for ; Mon, 27 Mar 2023 19:38:44 +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 2950A8F3B for ; Mon, 27 Mar 2023 19:38:43 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgqnV-0000Vd-Rn; Mon, 27 Mar 2023 13:38:21 -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 1pgqnU-0000SO-M4 for help-guix@gnu.org; Mon, 27 Mar 2023 13:38:20 -0400 Received: from cyberdimension.org ([80.67.179.20] helo=gnutoo.cyberdimension.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pgqnS-0003tG-Je for help-guix@gnu.org; Mon, 27 Mar 2023 13:38:20 -0400 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id b2265f7e; Mon, 27 Mar 2023 17:38:12 +0000 (UTC) Received: from primary_laptop (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id 07e90c4a; Mon, 27 Mar 2023 17:38:12 +0000 (UTC) Date: Mon, 27 Mar 2023 19:37:53 +0200 From: Denis 'GNUtoo' Carikli To: Julien Lepiller Cc: help-guix@gnu.org Subject: Re: static-networking-service-type: Using a static network bridge Message-ID: <20230327193753.7c4a04c1@primary_laptop> In-Reply-To: References: <20230322013248.7299a393@primary_laptop> <66E59A8E-82D0-4CE0-B37B-EA4C91A5FA2A@lepiller.eu> <20230324000850.27e89cc1@primary_laptop> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.30; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/LP+11.7ycwBDoRFk2tm4=sh"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=80.67.179.20; envelope-from=GNUtoo@cyberdimension.org; helo=gnutoo.cyberdimension.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679938724; a=rsa-sha256; cv=none; b=Wofu5vq5jPff1OKr4UXC+Cjx5Qtv7vPIh7gPDloMZ9QXa05ZLjbon1balBsRAvXhcx6qAC tHEa95xyhGl/Uzy98Zao+53qfVywDN3p9LiD3TJ8CcKLlYSvuHHltXy2DqxvmxYkFwTxjv y3m9Iq0NawECSZ9RIxr79erKgS1Mc4iD9Qegq+QztdrG+taDqErBxf/IasbWyBKMtZ/vxk p6jI1LgJVd4B6K8dlZ/kBtf3QAu5hPAdLkIrxlGqnn+6ItOAvONJRrs4VER6OIY9JpSzAd mhEcMPcwgzELqXfARuXFQvnC1bu1aGhqvVr3vLx4yFYwoKjXm8crE3LtpQSCFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679938724; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=W54fgFZS7NLC3q/xmWHm6ii6rq3kwAV1kF3tuXMP1sk=; b=aO0wvNzvwUUPLqWLic/8HwyU+lWSyZS7DQVN1iF4GEbIEitfBc8zTKRD5AFcAcKxprM7Rz hj3zcr4H7M6kyh96im366k89QqCyNVzXGBdxc+AdOVUO8HRwuRAU8HPd1zReG96IGty0K/ wGP+ZoNf1ss43djUaasho/Kwnl5dkHok0Z/AtIOT93fz8y3KmqbYMyT9+9iabMiRsw+53H bcipPipeL5YiVqJXq170YFXZm0BWVsoiPaenIqJiCjyHNvQ3cgwILzIqqYMS0mm9L2buk8 czmN+GM2RCnpTFCjPqy1H1OSYD5rKvEOTUHxNZ71RM79UksKEyAI4XZU9a7NkA== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.63 X-Spam-Score: -4.63 X-Migadu-Queue-Id: 2950A8F3B X-TUID: T4yOBpBirB2P --Sig_/LP+11.7ycwBDoRFk2tm4=sh Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 24 Mar 2023 18:14:48 +0100 Julien Lepiller wrote: > 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? What is a scenario here? If it's about reproducing a setup with bridges something like that is probably the easiest for the creation of the bridge: +-->[eth0]<---->Local network<-->Router<-->Internet | +----------+ v +----------+ | VM1 [eth0]<--> [br0] <-->[eth0] VM2 | +----------+ +----------+ The bridge would be created with: > sudo ip link add br0 type bridge > ip link set dev br0 up Then the host eth0 can joint it like that: > sudo ip link set dev eth0 master br0 > sudo ip link set dev eth0 up I've only tested that setup with eth0 being unconfigured (no IP address), and by having br0 get the IP address instead. So if you use DHCP, you can use 'dhclient br0' instead of the usual 'dhclient eth0', or you can set the static IP address to br0 instead of eth0. For the VM, you'd need to setup two qemu-kvm VMs with virt-manager. Once you have a VM, there is a "Add hardware" button. You then need to select "Network" for the type of hardware to add and fill some information: "Network source" should be set to Bridge device, and "Device name:" should be set to the bridge name on the host (like br0 for instance). The equivalent libvirt XML for the VM network interface looks like that: > > > > >
function=3D"0x0"/> Then you can setup a static IP address to the Ethernet interface inside the VMs, and ping the static IP address of one VM from the other VM or ping your router from a VM or vice versa. Maybe there are easier ways to test that without VMs or physical network but I don't have ideas about that yet. In my case the bridge is used for 2 different things: - making the VMs join the local network and be treated like any other physical machine. - Enabling GNU/Linux smartphones connected to my laptop though USB to also join the local network: when a smartphone is connected, an usb0 Ethernet interface appears, and an udev rule makes it join the bridge. Thanks a lot for the infos and the help. Denis. --Sig_/LP+11.7ycwBDoRFk2tm4=sh Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmQh1HEACgkQX138wUF3 4mPRxBAAp0yICmX7wWIlbJmOCWzYReyFwEXsVnLM37GycsFr9tRFObwWwRQNI5Y6 JXXoepx9CuXrwA1BUAZsYl0NDGT2Tyci14syisIQmdpUMRUlrKsXNgDTUyhW0NAs FRd3oqVzspUWHh2YQrw5H2JT9btHJDaq09MjiW3eRGxCPo5MDPpgM+vvonvVkhvV tKwbzZ+VJdNerglQPfsNX1h8kU53qKJ77phmYNWqXrNLcWYpk7Hx/1Md/jtMYd/M vERBoO4Ax0fNnRukHs/cnZ5a+sP1psPqCUe1ih6r2vqUwD9mJq6rdEuNjGPaj5pt vrLJbv5W4qXh1qLOUx5O1kqTcP8XBH2eLWim9kgfiZN4ZF0b+USfa609EwQcv0JJ tpSCH1M5icmMOdYo03qY4apBVg1fPoPVuOINQ1MJRViDpoXlG1EdguR7H51wkizr 54gGcD1d1G6uNVfoHT7ASK7TKKlaLFYBnH5MqNhyp9fNb6GtZg7OuzyBA06BXE0f aT86PgVId3xJn/SEZeHzgQvtFnGkSi6PupGLPYhMB1LIuUwAl2/7gqj+vI50sCMd qmFYgnZKBbpKudGgm1a61GfdpwnOp1ag86bkI38DlrZPmcvhIkn9TN6K6SS8Wg5L QBUDsQ1CNS57df49qWJFouKsCT9vKql3jmUAJnOZkWsA+O18fzk= =uoEl -----END PGP SIGNATURE----- --Sig_/LP+11.7ycwBDoRFk2tm4=sh--