unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#64616] [PATCH 0/1] services: static-networking: Add support for bonds and vlans
@ 2023-07-14 15:29 Alexey Abramov via Guix-patches via
  2023-07-14 15:36 ` [bug#64616] [PATCH 1/1] services: static-networking: Add support for bonding Alexey Abramov via Guix-patches via
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alexey Abramov via Guix-patches via @ 2023-07-14 15:29 UTC (permalink / raw)
  To: 64616

Hi Guix!

After new release of guile-netlink, I made some changes on a guix side to be
able to configure bonds and vlans using static-networking declaration.

In short, I introduced two more structures for *matching* existing interfaces:
<network-link-by-macaddress> and <network-link-by-name>. The reason for that
is that <network-link> struct creates new interfaces in network-set-up/linux.
And if we want to construct a bond we need a way to apply settings for
existing interfaces.

With these changes applied, it is passable to do something like this:

(static-networking
 (links (list (network-link
               (name "bond0")
               (type "bond")
               (arguments '((mode . "802.3ad")
                            (miimon . 100)
                            (lacp-active . "on")
                            (lacp-rate . "fast"))))

              (network-link-by-macaddress
               (macaddress "98:11:22:33:44:55")
               (arguments '((master . "bond0"))))
              (network-link-by-macaddress
               (macaddress "98:11:22:33:44:56")
               (arguments '((master . "bond0"))))

              (network-link
               (name "bond0.1055")
               (type "vlan")
               (arguments '((id . 1055)
                            (link . "bond0"))))))
 (addresses (list (network-address
                   (value "192.168.1.4/24")
                   (device "bond0.1055")))))

This example is taken from the test, where I removed interface renaming
step. You should also know that network stack in Qemu won't with this
configuration.  The purpose of the test was to check if the stack has proper
settings.  If it is not enough, Please let me know.  I can try to use
openvswitch for that

There is one thing that bothers me. Here is a comment I put in the code:

It is interesting that "modprobe bonding" creates an interface bond0 straigt
away.  If we won't have bonding module, and execute `ip link add name bond0
type bond' we will get

RTNETLINK answers: File exists

This breaks our configuration if we want to use `bond0' name.  Create (force
modprobe bonding) and delete the interface to free up.  As you can see I
create an interface bond0 (in case some bonds are in configuration). It is
forces netlink to load the bonding module and then delete it to free up the
'name'.

Please let me know what you think.

Alexey Abramov (1):
  services: static-networking: Add support for bonding.

 doc/guix.texi            |  61 ++++++++++++++++-
 gnu/services/base.scm    | 109 +++++++++++++++++++++++++++---
 gnu/tests/networking.scm | 141 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 299 insertions(+), 12 deletions(-)

-- 
2.40.1





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-11 17:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 15:29 [bug#64616] [PATCH 0/1] services: static-networking: Add support for bonds and vlans Alexey Abramov via Guix-patches via
2023-07-14 15:36 ` [bug#64616] [PATCH 1/1] services: static-networking: Add support for bonding Alexey Abramov via Guix-patches via
2023-08-12 20:28   ` [bug#64616] [PATCH 0/1] services: static-networking: Add support for bonds and vlans Ludovic Courtès
2023-08-28 16:57     ` Alexey Abramov via Guix-patches via
2023-09-09 10:51       ` Ludovic Courtès
2023-07-22  3:12 ` 宋文武 via Guix-patches via
2023-07-25 11:07   ` Alexey Abramov via Guix-patches via
2023-09-29 19:34 ` [bug#64616] [PATCH v2] services: static-networking: Add support for bonding Alexey Abramov via Guix-patches via
2023-10-11 17:00   ` bug#64616: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).