unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Cc: help-guix@gnu.org
Subject: Re: static-networking-service-type: Using a static network bridge
Date: Wed, 29 Mar 2023 20:27:22 +0200	[thread overview]
Message-ID: <20230329202717.506cae04@sybil.lepiller.eu> (raw)
In-Reply-To: <20230327193753.7c4a04c1@primary_laptop>

Le Mon, 27 Mar 2023 19:37:53 +0200,
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> a écrit :

> On Fri, 24 Mar 2023 18:14:48 +0100
> Julien Lepiller <julien@lepiller.eu> 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  

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?


      reply	other threads:[~2023-03-29 18:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  0:32 static-networking-service-type: Using a static network bridge Denis 'GNUtoo' Carikli
2023-03-22  6:24 ` Julien Lepiller
2023-03-23 23:08   ` Denis 'GNUtoo' Carikli
2023-03-24 17:14     ` Julien Lepiller
2023-03-27 17:37       ` Denis 'GNUtoo' Carikli
2023-03-29 18:27         ` Julien Lepiller [this message]

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230329202717.506cae04@sybil.lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=GNUtoo@cyberdimension.org \
    --cc=help-guix@gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).