help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static-networking-service-type: Using a static network bridge


From: Denis 'GNUtoo' Carikli
Subject: Re: static-networking-service-type: Using a static network bridge
Date: Fri, 24 Mar 2023 00:08:50 +0100

On Wed, 22 Mar 2023 07:24:01 +0100
Julien Lepiller <julien@lepiller.eu> wrote:

> You specified type twice, with #f the last time. Maybe that's tge
> issue?
Sorry my bad: I messed up the indentation, so it makes it look like
type is specified twice.

When doing sudo guix system reconfigure I get that:
> guix system: warning: exception caught while executing 'start' on
> service 'networking':
> Throw to key `no-such-device' with args `("lan0")'.
> guix system: warning: some services could not be upgraded
> hint: To allow changes to all the system services to take effect, you
> will need to reboot.

So I'll try to rephrase and split the question: Is the following correct
to create a bridge:
> (network-link (name "lan0")
>               (type 'bridge)
>               (arguments '()))
Or is that supposed to only work on existing interfaces? Or am I
supposed to add something inside arguments to create the bridge?

The issue is that I only managed to understand what to put in name and
type with the Guix manual. The documentation describes arguments as
"List of arguments for this type of link.", and it then point to "Link
in Guile-Netlink Manual" which points to
https://git.lepiller.eu/guile-netlink/manual/manual.html#Link

But it doesn't tell how the correspondence between arguments and that
manual section is made. Do arguments expect some string? some state
(like IF_OPER_UP?), the same arguments than type-args?, a link datatype?

Though the guile-netlink documentation is very easy to use to create a
bridge and give it an address:
> (link-add "lan0" "bridge")
> (addr-add "lan0" "192.168.10.7/24")
but I've no idea how to translate that in Guix configuration.

As for making a device join a bridge I'm also unsure how to do that. I
didn't find any infos for that in the Guix manual or the guile-netlink
documentation, so maybe that's not supported?

If that's not supported, udev can still be used to run commands with
things like that:
> (udev-rule "bridge.rules"
> "SUBSYSTEM==\"net\", [some way to indentify the interface], \\
> ACTION==\"add\", \\
> RUN+=\"/run/current-system/[...]/ip link set dev $name master
> lan0\""))
and it works for other things (like changing MAC addresses with
macchanger, etc).

So does udev run late enough to already have the bridge interface
created when something like that would run? Or is there something that
could work with Guix static-networking-service-type somehow?

Thanks a lot in advance for the help.

Denis.

Attachment: pgprlkD1i_uvx.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]