From unknown Sun Jun 15 08:43:34 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#51440 <51440@debbugs.gnu.org> To: bug#51440 <51440@debbugs.gnu.org> Subject: Status: [PATCH 00/10] Declarative static networking interface Reply-To: bug#51440 <51440@debbugs.gnu.org> Date: Sun, 15 Jun 2025 15:43:34 +0000 retitle 51440 [PATCH 00/10] Declarative static networking interface reassign 51440 guix-patches submitter 51440 Ludovic Court=C3=A8s severity 51440 normal tag 51440 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 09:59:34 2021 Received: (at submit) by debbugs.gnu.org; 27 Oct 2021 13:59:34 +0000 Received: from localhost ([127.0.0.1]:50037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjSo-0000Do-AF for submit@debbugs.gnu.org; Wed, 27 Oct 2021 09:59:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:34660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjSm-0000De-C3 for submit@debbugs.gnu.org; Wed, 27 Oct 2021 09:59:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjSl-0004ZL-Va for guix-patches@gnu.org; Wed, 27 Oct 2021 09:59:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjSk-0004ag-Vv; Wed, 27 Oct 2021 09:59:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=eO6PxoXTDnqRtHxcrmmY/QY73k1nb+Y98hVvC6ZiSk0=; b=CusXH/ocOkS6ii RjhMU/trn4fjVoDVNqWQt4w/8ylPLPBcaGfazfodCOJYxaC7a69dA1BZzb03Dr7XI/1Cge/sG7vw9 /4FQSPl5s1UFztA6GyEO5W+jmdBT4fO+B40BdK/9of3DSmjzX22yZSTt03ugTWCrVO+D0E6x7sRSg J/jwoFUqx9awC3QnjO1IN4lBLfl1wS1j83kt3G0ZaaUOaFMRajji07yFg5E0/DWISOHk/aydrbUw7 g6ymmcdBATunoNAtALzXkAAu1DLTC9jcbV4t4Q1i2f58JJcM08xC6m5T+CabKtg/Po9wlUVWeygN+ XRfxWwpOasLZJG/kCbkA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54230 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjSk-0007wg-IK; Wed, 27 Oct 2021 09:59:30 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 00/10] Declarative static networking interface Date: Wed, 27 Oct 2021 15:59:18 +0200 Message-Id: <20211027135918.18833-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 X-Debbugs-Cc: Julien Lepiller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! This patch set builds on Julien’s neat Guile-Netlink to finally provide a proper static networking configuration interface. One can now write things like: (service static-networking-service-type ;; Network configuration for one NIC, IPv4 + IPv6. (static-networking (addresses (list (network-address (device "eno1") (value "10.0.2.15/24")) (network-address (device "eno1") (value "2001:123:4567:101::1")))) (routes (list (network-route (destination "default") (gateway "10.0.2.2")) (network-route (destination "default") (gateway "2020:321:4567:42::1")))) (name-servers '("10.0.2.3")))) For the record, the ‘static-networking-service’ procedure currently in ‘master’ is IPv4-only and would not allow you to assign more than one address to an interface anyway, among other limitations. These long-overdue patches close an embarrassing gap. The interface provided here is a direct mapping of that of Guile-Netlink, which is the same as that of the ‘ip’ command, itself closely modeled after Linux’s internal interfaces AIUI. Thus, it should be roughly as expressive as ‘ip’, but declarative. I’m not a network person though, so I’d appreciate if more knowledgeable people would take a look at the interface. In particular, I’d like to have examples of ‘links’ to include in the manual—I’m not quite sure how to use that. Ideas? This patches preserve backward-compatibility: the ‘static-networking-service’ procedure still works the same. There’s one observable difference though: there’s only one ‘networking’ Shepherd service now; you no longer get ‘networking-eno1’ and similar. The ‘static-networking’ constructor was public since commit c9436025a90b86047ba2203d58bbf238f8f9b2f9 but undocumented; thus I changed the fields of without worrying about compatibility. I tested this with: make check-system \ TESTS="static-networking openvswitch ganeti-kvm dhcpd childhurd" I would appreciate more testing, including tests on the bare metal for IPv6 support. Ensuring portability to GNU/Hurd took me more time than I’d have thought, but it works. “Links” are not supported there, and only “default” routes are supported. I took a detour in commit “Use Guile-Netlink on GNU/Linux”: that patch shows that I was blissfully hoping to use good’ol ioctls on GNU/Hurd, but that turned out to be a dead end because they don’t support IPv6 (which really isn’t a surprise but I don’t know, I must have been lacking focus at that point of my journey!). With all this I think we should be able to do “cool things with containers”, but again, that’s not my area of expertise so please do chime in if you container networking is your thing. Feedback welcome! Ludo’. Ludovic Courtès (10): tests: Add 'static-networking' test. tests: openvswitch: Check whether ovs0 is up. doc: Add new "Networking Setup" node for the main setup options. gnu: guile-netlink: Allow cross-compilation. services: static-networking: Use Guile-Netlink on GNU/Linux. services: secret-service: Turn into a Shepherd service. services: static-networking: Change interface to mimic netlink. services: Define '%qemu-static-networking'. services: Define '%loopback-static-networking'. tests: Replace uses of deprecated 'static-networking-service'. doc/guix.texi | 505 ++++++++++++++++++++++---------- gnu/build/hurd-boot.scm | 10 +- gnu/build/secret-service.scm | 17 +- gnu/packages/guile-xyz.scm | 11 +- gnu/services/base.scm | 391 +++++++++++++++++++------ gnu/services/virtualization.scm | 45 ++- gnu/system/hurd.scm | 12 +- gnu/system/install.scm | 5 +- gnu/tests/ganeti.scm | 7 +- gnu/tests/networking.scm | 141 ++++++++- 10 files changed, 851 insertions(+), 293 deletions(-) base-commit: 0a42998a50e8bbe9e49142b21a570db00efe7491 -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:03 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:03 +0000 Received: from localhost ([127.0.0.1]:50052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWB-0002VG-AZ for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjW9-0002UZ-60 for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjW3-00057C-Jr; Wed, 27 Oct 2021 10:02:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=nIMYMSxGuVBBp0yBxrJ8NiTzp8VkdLuICWMDvMaM/7M=; b=LQDQbBJ8WERjiw r26s9bCgxillYF+2glRFmODt+dSJZDomJGnVODNMkZO6EHApZBZd2FAaARGeaPh5KGJ/v2olUrZKP 5V9RPgiWfqp3c5kc9OTdWNOBdEmedD00lRhvRWZbHF4L8LSj8tlGNM3wKF3NA9/UWTOVV6JKrvJCE eWLTxpKLDIOrnMhjRN2KY6n+0SPv0yjd1XkYL/gIh71VeNjXr6ru/XHgxh5fUBCljMAZgaaxqMEhE 1M8FwO4uYn0ZMIG1logivZVbNM1+KbrTmRY+HmRaEvvLjAo0Vpu+K1p8g9uxQyOCELJQIo2X1msw+ HaQnw+CZBcv6HjR51rJQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjW1-0002Tf-0w; Wed, 27 Oct 2021 10:02:53 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 01/10] tests: Add 'static-networking' test. Date: Wed, 27 Oct 2021 16:02:36 +0200 Message-Id: <20211027140245.18970-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/tests/networking.scm (run-static-networking-test): New procedure. (%test-static-networking): New variable. --- gnu/tests/networking.scm | 99 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 453e63f52d..5da1c91da6 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2018 Arun Isaac ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,8 +38,102 @@ (define-module (gnu tests networking) #:use-module (gnu packages guile) #:use-module (gnu services shepherd) #:use-module (ice-9 match) - #:export (%test-inetd %test-openvswitch %test-dhcpd %test-tor %test-iptables - %test-ipfs)) + #:export (%test-static-networking + %test-inetd + %test-openvswitch + %test-dhcpd + %test-tor + %test-iptables + %test-ipfs)) + + +;;; +;;; Static networking. +;;; + +(define (run-static-networking-test vm) + (define test + (with-imported-modules '((gnu build marionette) + (guix build syscalls)) + #~(begin + (use-modules (gnu build marionette) + (guix build syscalls) + (srfi srfi-64)) + + (define marionette + (make-marionette + '(#$vm "-nic" "user,model=virtio-net-pci"))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "static-networking") + + (test-assert "service is up" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'networking)) + marionette)) + + (test-assert "network interfaces" + (marionette-eval + '(begin + (use-modules (guix build syscalls)) + (network-interface-names)) + marionette)) + + (test-equal "address of eth0" + "10.0.2.15" + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (addr (network-interface-address sock "eth0"))) + (close-port sock) + (inet-ntop (sockaddr:fam addr) (sockaddr:addr addr))) + marionette)) + + (test-equal "netmask of eth0" + "255.255.255.0" + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (mask (network-interface-netmask sock "eth0"))) + (close-port sock) + (inet-ntop (sockaddr:fam mask) (sockaddr:addr mask))) + marionette)) + + (test-equal "eth0 is up" + IFF_UP + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (flags (network-interface-flags sock "eth0"))) + (logand flags IFF_UP)) + marionette)) + + (test-end) + + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "static-networking" test)) + +(define %test-static-networking + (system-test + (name "static-networking") + (description "Test the 'static-networking' service.") + (value + (let ((os (marionette-operating-system + (simple-operating-system + (static-networking-service "eth0" "10.0.2.15" + #:netmask "255.255.255.0" + #:gateway "10.0.2.2" + #:name-servers '("10.0.2.2"))) + #:imported-modules '((gnu services herd) + (guix combinators))))) + (run-static-networking-test (virtual-machine os)))))) + + +;;; +;;; Inetd. +;;; (define %inetd-os ;; Operating system with 2 inetd services. -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:07 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:07 +0000 Received: from localhost ([127.0.0.1]:50058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWE-0002Vc-Mt for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWA-0002Ue-W9 for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjW5-00057L-8r; Wed, 27 Oct 2021 10:02:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=edqJOsScW5bI/S3HqRrJmuoSxiZ5+fBAqUe91M9zBi0=; b=hO1wrPq/fnoi7zljCB+V r/0ndYaQF51tWbdJjFwrjDw4kglBct13GXKELej1uAJiutZY5xgegz7z512IIgNWKA+L62ph9NhAk oQOli0+XiHgvmYLOyAKRlyLCDdHw3DQyZCmXmOjmdGB9hm1yobPX5HiWv6Tgm2DV1av/nSkynq2HK XTeu3WtbNniIUhLC9qtb2HrCOsZcBlXWv1AYf5Cm5ZLwM4bT7ONIU+cVbH6OsbPzWIKCQvxxB6WmK 9qDCN26fzk2pNVwZWkS3jVtOPXs+5gylRXvlgs8UzEOJdj5D/bxidw6t9JMTY7Tfaf3eBNGgzEuyf 5okRlqP3KFyStw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjW3-0002Tf-Rs; Wed, 27 Oct 2021 10:02:56 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 02/10] tests: openvswitch: Check whether ovs0 is up. Date: Wed, 27 Oct 2021 16:02:37 +0200 Message-Id: <20211027140245.18970-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/tests/networking.scm (run-openvswitch-test)["ovs0 is up"]: New test. --- gnu/tests/networking.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 5da1c91da6..131428c128 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -286,12 +286,15 @@ (define %openvswitch-os (define (run-openvswitch-test) (define os (marionette-operating-system %openvswitch-os - #:imported-modules '((gnu services herd)))) + #:imported-modules '((gnu services herd) + (guix build syscalls)))) (define test - (with-imported-modules '((gnu build marionette)) + (with-imported-modules '((gnu build marionette) + (guix build syscalls)) #~(begin (use-modules (gnu build marionette) + (guix build syscalls) (ice-9 popen) (ice-9 rdelim) (srfi srfi-64)) @@ -339,6 +342,18 @@ (define marionette (current-services)))) marionette)) + (test-equal "ovs0 is up" + IFF_UP + (marionette-eval + '(begin + (use-modules (guix build syscalls)) + + (let* ((sock (socket AF_INET SOCK_STREAM 0)) + (flags (network-interface-flags sock "ovs0"))) + (close-port sock) + (logand flags IFF_UP))) + marionette)) + (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:07 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:07 +0000 Received: from localhost ([127.0.0.1]:50060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWF-0002Vl-4B for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWC-0002Ui-PH for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjW7-00057d-Fb; Wed, 27 Oct 2021 10:02:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=9RiXGJeRtbEaSlC9HCBSii2Gml4rjEt9QiDUUVyODho=; b=qBbzfp9DjakZZsz7O2BT NPy51x2WEhHwjAJyG0FRWkE7JuWNYlUf4TFLA0xk5aHWjZi3FN5UynQpBLgqbAnBCrmhBPKPk2xRV RNtsXjXmG/Fot6Zo69AqVQDXt8Jz17AyZh3VlTtvcpl/RWivJzmrbj/NNHi2xDfV7f7jK3u1o5F39 g9vu8LJbDWxTjfQkidCwCufEALULpRkvgn8wvYFg91vt222Cjc2T/Qk+wwxDZmVGwEhBYj7C8v39c 88ERy0z/Bux/sgA2ZXH0yL9e/zhgYQqSdSye6oSHht89Sf2aIB+lcGofYjOG4SAcocqGRV2hXPJNO F7kNWlrJz1gZNQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjW6-0002Tf-Ty; Wed, 27 Oct 2021 10:02:59 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 04/10] gnu: guile-netlink: Allow cross-compilation. Date: Wed, 27 Oct 2021 16:02:39 +0200 Message-Id: <20211027140245.18970-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/guile-xyz.scm (guile-netlink)[arguments]: Add #:phases. Remove unnecessary #:tests? #f. [native-inputs]: Add GUILE-3.0. --- gnu/packages/guile-xyz.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 355b23f57e..daef8bbb26 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -4854,13 +4854,22 @@ (define-public guile-netlink "03zmsha2d7whlwb52gna83jdas9bqi18rq3sss7kkicv814qb35g")))) (build-system gnu-build-system) (arguments - `(#:tests? #f)); no tests + `(#:phases (modify-phases %standard-phases + (add-before 'bootstrap 'set-guile-target + (lambda* (#:key target #:allow-other-keys) + (when target + ;; Pass '--target=TRIPLET' to 'guild compile'. + (substitute* "guile.am" + (("\\$\\(GUILD\\) compile") + (string-append "$(GUILD) compile --target=" + target " "))))))))) (inputs `(("guile" ,guile-3.0))) (native-inputs `(("automake" ,automake) ("autoconf" ,autoconf) ("pkg-config" ,pkg-config) + ("guile" ,guile-3.0) ;for 'guild compile' + guile.m4 ("texinfo" ,texinfo))) (home-page "https://git.lepiller.eu/guile-netlink") (synopsis "Netlink protocol implementation for Guile") -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:18 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:18 +0000 Received: from localhost ([127.0.0.1]:50072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWM-0002Wb-Ki for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWD-0002Uj-0c for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjW6-00057W-PD; Wed, 27 Oct 2021 10:02:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=An33jywAnh0CXNFaHA9/3PoKi7M+6kESv8rS/zZPC60=; b=R1OKx9P76IFv0AjePiH3 dd08XIxWG850dRPPBi2/iWrcRxv8k7DGCrapq963UFM2+sf1MKZPpLC56RdStmlBKvkub74eQLmnY vyFr80ivqkzEJ0L+XajyKbajTUZhMk6Ilq1kWh+DhIwKq8Mo3l1GSKtmFWclkbzAl38lUWZdj+Rcc 4WlwctkXjTW0fMuB6w0QUAmObjBbjqjpH3Gx+o5jQMhTMB/DYG8zbbdfqejHJJLPszYwXxqpoa21C c2ymCiE9IKjz80ito6e8AT2kmsNCKtTfDFmcsYC2tJRtwY+YY/pTlva3RFHdj2xpEihY4/MIwB4Tv E3YSVN19w26lNg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjW5-0002Tf-Gi; Wed, 27 Oct 2021 10:02:58 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 03/10] doc: Add new "Networking Setup" node for the main setup options. Date: Wed, 27 Oct 2021 16:02:38 +0200 Message-Id: <20211027140245.18970-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This should make it easier to find how to get started setting up networking. * doc/guix.texi (Networking Setup): New section. (Networking Services): Remove 'static-networking-service', 'dhcp-client-service-type', 'network-manager-service-type', 'connman-service-type', 'wicd-service', 'modem-manager-service-type', 'usb-modeswitch-service-type', and 'wpa-supplicant-service-type'. --- doc/guix.texi | 289 ++++++++++++++++++++++++++++---------------------- 1 file changed, 160 insertions(+), 129 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 22215214e0..f7de378bdd 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -342,7 +342,8 @@ Services * Base Services:: Essential system services. * Scheduled Job Execution:: The mcron service. * Log Rotation:: The rottlog service. -* Networking Services:: Network setup, SSH daemon, etc. +* Networking Setup:: Setting up network interfaces. +* Networking Services:: Firewall, SSH daemon, etc. * Unattended Upgrades:: Automated system upgrades. * X Window:: Graphical display. * Printing Services:: Local and remote printer support. @@ -15516,7 +15517,8 @@ declaration. * Base Services:: Essential system services. * Scheduled Job Execution:: The mcron service. * Log Rotation:: The rottlog service. -* Networking Services:: Network setup, SSH daemon, etc. +* Networking Setup:: Setting up network interfaces. +* Networking Services:: Firewall, SSH daemon, etc. * Unattended Upgrades:: Automated system upgrades. * X Window:: Graphical display. * Printing Services:: Local and remote printer support. @@ -16738,63 +16740,26 @@ The list of syslog-controlled files to be rotated. By default it is: "/var/log/maillog")}. @end defvr -@node Networking Services -@subsection Networking Services +@node Networking Setup +@subsection Networking Setup -The @code{(gnu services networking)} module provides services to configure -the network interface. +The @code{(gnu services networking)} module provides services to +configure network interfaces and set up networking on your machine. +Those services provide different ways for you to set up your machine: by +declaring a static network configuration, by running a Dynamic Host +Configuration Protocol (DHCP) client, or by running daemons such as +NetworkManager and Connman that automate the whole process, +automatically adapt to connectivity changes, and provide a high-level +user interface. -@cindex DHCP, networking service -@defvr {Scheme Variable} dhcp-client-service-type -This is the type of services that run @var{dhcp}, a Dynamic Host Configuration -Protocol (DHCP) client, on all the non-loopback network interfaces. Its value -is the DHCP client package to use, @code{isc-dhcp} by default. -@end defvr +On a laptop, NetworkManager and Connman are by far the most convenient +options, which is why the default desktop services include +NetworkManager (@pxref{Desktop Services, @code{%desktop-services}}). +For a server, or for a virtual machine or a container, static network +configuration or a simple DHCP client are often more appropriate. -@deffn {Scheme Procedure} dhcpd-service-type -This type defines a service that runs a DHCP daemon. To create a -service of this type, you must supply a @code{}. -For example: - -@lisp -(service dhcpd-service-type - (dhcpd-configuration - (config-file (local-file "my-dhcpd.conf")) - (interfaces '("enp0s25")))) -@end lisp -@end deffn - -@deftp {Data Type} dhcpd-configuration -@table @asis -@item @code{package} (default: @code{isc-dhcp}) -The package that provides the DHCP daemon. This package is expected to -provide the daemon at @file{sbin/dhcpd} relative to its output -directory. The default package is the -@uref{https://www.isc.org/products/DHCP, ISC's DHCP server}. -@item @code{config-file} (default: @code{#f}) -The configuration file to use. This is required. It will be passed to -@code{dhcpd} via its @code{-cf} option. This may be any ``file-like'' -object (@pxref{G-Expressions, file-like objects}). See @code{man -dhcpd.conf} for details on the configuration file syntax. -@item @code{version} (default: @code{"4"}) -The DHCP version to use. The ISC DHCP server supports the values ``4'', -``6'', and ``4o6''. These correspond to the @code{dhcpd} program -options @code{-4}, @code{-6}, and @code{-4o6}. See @code{man dhcpd} for -details. -@item @code{run-directory} (default: @code{"/run/dhcpd"}) -The run directory to use. At service activation time, this directory -will be created if it does not exist. -@item @code{pid-file} (default: @code{"/run/dhcpd/dhcpd.pid"}) -The PID file to use. This corresponds to the @code{-pf} option of -@code{dhcpd}. See @code{man dhcpd} for details. -@item @code{interfaces} (default: @code{'()}) -The names of the network interfaces on which dhcpd should listen for -broadcasts. If this list is not empty, then its elements (which must be -strings) will be appended to the @code{dhcpd} invocation when starting -the daemon. It may not be necessary to explicitly specify any -interfaces here; see @code{man dhcpd} for details. -@end table -@end deftp +This section describes the various network setup services available, +starting with static network configuration. @defvr {Scheme Variable} static-networking-service-type This is the type for statically-configured network interfaces. @@ -16824,81 +16789,13 @@ For example: @end lisp @end deffn -@cindex wicd -@cindex wireless -@cindex WiFi -@cindex network management -@deffn {Scheme Procedure} wicd-service [#:wicd @var{wicd}] -Return a service that runs @url{https://launchpad.net/wicd,Wicd}, a network -management daemon that aims to simplify wired and wireless networking. - -This service adds the @var{wicd} package to the global profile, providing -several commands to interact with the daemon and configure networking: -@command{wicd-client}, a graphical user interface, and the @command{wicd-cli} -and @command{wicd-curses} user interfaces. -@end deffn - -@cindex ModemManager - -@defvr {Scheme Variable} modem-manager-service-type -This is the service type for the -@uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager} -service. The value for this service type is a -@code{modem-manager-configuration} record. - -This service is part of @code{%desktop-services} (@pxref{Desktop -Services}). +@cindex DHCP, networking service +@defvr {Scheme Variable} dhcp-client-service-type +This is the type of services that run @var{dhcp}, a Dynamic Host Configuration +Protocol (DHCP) client, on all the non-loopback network interfaces. Its value +is the DHCP client package to use, @code{isc-dhcp} by default. @end defvr -@deftp {Data Type} modem-manager-configuration -Data type representing the configuration of ModemManager. - -@table @asis -@item @code{modem-manager} (default: @code{modem-manager}) -The ModemManager package to use. - -@end table -@end deftp - -@cindex USB_ModeSwitch -@cindex Modeswitching - -@defvr {Scheme Variable} usb-modeswitch-service-type -This is the service type for the -@uref{https://www.draisberghof.de/usb_modeswitch/, USB_ModeSwitch} -service. The value for this service type is -a @code{usb-modeswitch-configuration} record. - -When plugged in, some USB modems (and other USB devices) initially present -themselves as a read-only storage medium and not as a modem. They need to be -@dfn{modeswitched} before they are usable. The USB_ModeSwitch service type -installs udev rules to automatically modeswitch these devices when they are -plugged in. - -This service is part of @code{%desktop-services} (@pxref{Desktop -Services}). -@end defvr - -@deftp {Data Type} usb-modeswitch-configuration -Data type representing the configuration of USB_ModeSwitch. - -@table @asis -@item @code{usb-modeswitch} (default: @code{usb-modeswitch}) -The USB_ModeSwitch package providing the binaries for modeswitching. - -@item @code{usb-modeswitch-data} (default: @code{usb-modeswitch-data}) -The package providing the device data and udev rules file used by -USB_ModeSwitch. - -@item @code{config-file} (default: @code{#~(string-append #$usb-modeswitch:dispatcher "/etc/usb_modeswitch.conf")}) -Which config file to use for the USB_ModeSwitch dispatcher. By default the -config file shipped with USB_ModeSwitch is used which disables logging to -@file{/var/log} among other default settings. If set to @code{#f}, no config -file is used. - -@end table -@end deftp - @cindex NetworkManager @defvr {Scheme Variable} network-manager-service-type @@ -17035,6 +16932,139 @@ List of additional command-line arguments to pass to the daemon. @end table @end deftp +@cindex wicd +@cindex wireless +@cindex WiFi +@cindex network management +@deffn {Scheme Procedure} wicd-service [#:wicd @var{wicd}] +Return a service that runs @url{https://launchpad.net/wicd,Wicd}, a network +management daemon that aims to simplify wired and wireless networking. + +This service adds the @var{wicd} package to the global profile, providing +several commands to interact with the daemon and configure networking: +@command{wicd-client}, a graphical user interface, and the @command{wicd-cli} +and @command{wicd-curses} user interfaces. +@end deffn + +@cindex ModemManager +Some networking devices such as modems require special care, and this is +what the services below focus on. + +@defvr {Scheme Variable} modem-manager-service-type +This is the service type for the +@uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager} +service. The value for this service type is a +@code{modem-manager-configuration} record. + +This service is part of @code{%desktop-services} (@pxref{Desktop +Services}). +@end defvr + +@deftp {Data Type} modem-manager-configuration +Data type representing the configuration of ModemManager. + +@table @asis +@item @code{modem-manager} (default: @code{modem-manager}) +The ModemManager package to use. + +@end table +@end deftp + +@cindex USB_ModeSwitch +@cindex Modeswitching + +@defvr {Scheme Variable} usb-modeswitch-service-type +This is the service type for the +@uref{https://www.draisberghof.de/usb_modeswitch/, USB_ModeSwitch} +service. The value for this service type is +a @code{usb-modeswitch-configuration} record. + +When plugged in, some USB modems (and other USB devices) initially present +themselves as a read-only storage medium and not as a modem. They need to be +@dfn{modeswitched} before they are usable. The USB_ModeSwitch service type +installs udev rules to automatically modeswitch these devices when they are +plugged in. + +This service is part of @code{%desktop-services} (@pxref{Desktop +Services}). +@end defvr + +@deftp {Data Type} usb-modeswitch-configuration +Data type representing the configuration of USB_ModeSwitch. + +@table @asis +@item @code{usb-modeswitch} (default: @code{usb-modeswitch}) +The USB_ModeSwitch package providing the binaries for modeswitching. + +@item @code{usb-modeswitch-data} (default: @code{usb-modeswitch-data}) +The package providing the device data and udev rules file used by +USB_ModeSwitch. + +@item @code{config-file} (default: @code{#~(string-append #$usb-modeswitch:dispatcher "/etc/usb_modeswitch.conf")}) +Which config file to use for the USB_ModeSwitch dispatcher. By default the +config file shipped with USB_ModeSwitch is used which disables logging to +@file{/var/log} among other default settings. If set to @code{#f}, no config +file is used. + +@end table +@end deftp + + +@node Networking Services +@subsection Networking Services + +The @code{(gnu services networking)} module discussed in the previous +section provides services for more advanced setups: providing a DHCP +service for others to use, filtering packets with iptables or nftables, +running a WiFi access point with @command{hostapd}, running the +@command{inetd} ``superdaemon'', and more. This section describes +those. + +@deffn {Scheme Procedure} dhcpd-service-type +This type defines a service that runs a DHCP daemon. To create a +service of this type, you must supply a @code{}. +For example: + +@lisp +(service dhcpd-service-type + (dhcpd-configuration + (config-file (local-file "my-dhcpd.conf")) + (interfaces '("enp0s25")))) +@end lisp +@end deffn + +@deftp {Data Type} dhcpd-configuration +@table @asis +@item @code{package} (default: @code{isc-dhcp}) +The package that provides the DHCP daemon. This package is expected to +provide the daemon at @file{sbin/dhcpd} relative to its output +directory. The default package is the +@uref{https://www.isc.org/products/DHCP, ISC's DHCP server}. +@item @code{config-file} (default: @code{#f}) +The configuration file to use. This is required. It will be passed to +@code{dhcpd} via its @code{-cf} option. This may be any ``file-like'' +object (@pxref{G-Expressions, file-like objects}). See @code{man +dhcpd.conf} for details on the configuration file syntax. +@item @code{version} (default: @code{"4"}) +The DHCP version to use. The ISC DHCP server supports the values ``4'', +``6'', and ``4o6''. These correspond to the @code{dhcpd} program +options @code{-4}, @code{-6}, and @code{-4o6}. See @code{man dhcpd} for +details. +@item @code{run-directory} (default: @code{"/run/dhcpd"}) +The run directory to use. At service activation time, this directory +will be created if it does not exist. +@item @code{pid-file} (default: @code{"/run/dhcpd/dhcpd.pid"}) +The PID file to use. This corresponds to the @code{-pf} option of +@code{dhcpd}. See @code{man dhcpd} for details. +@item @code{interfaces} (default: @code{'()}) +The names of the network interfaces on which dhcpd should listen for +broadcasts. If this list is not empty, then its elements (which must be +strings) will be appended to the @code{dhcpd} invocation when starting +the daemon. It may not be necessary to explicitly specify any +interfaces here; see @code{man dhcpd} for details. +@end table +@end deftp + @cindex hostapd service, for Wi-Fi access points @cindex Wi-Fi access points, hostapd service @defvr {Scheme Variable} hostapd-service-type @@ -17097,6 +17127,7 @@ network that can be seen on @code{wlan0}, by default. The service's value is a @code{hostapd-configuration} record. @end defvr + @cindex iptables @defvr {Scheme Variable} iptables-service-type This is the service type to set up an iptables configuration. iptables is a -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:18 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:18 +0000 Received: from localhost ([127.0.0.1]:50076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWQ-0002Wo-1m for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWI-0002VY-S6 for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjWD-00057z-Dy; Wed, 27 Oct 2021 10:03:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=2PZSQcBi7QvaYFLybO/4hOkFPRVIn5uFYlqQuLwxpHI=; b=crEorOcNfM/ubsO5CWY1 sqx30iyUVWg4pEjJ47oIGZBIfEtrTB9QZc5oarmGsoj9UWfr52Cr0yM+zqneD6KXZISuutVSgGtlD zbsJA63o1yEbNf+/PLfaofhrzEJiYk8w9oXjWGpmW4zOixQn9cuB+ovaGwCJCVCCCVMmhEkrHSpME Pu59CIFbaUnT7K9xvu3IiDG9h47mE930eBpUYeeqgZR10hvt3tDqf9tuSEyzMhcsBazmz+YqcvXdw Bx+ChfEmqUS2LCu372qfOq/r3COQFTwiakcPt9JbmNoE8kYyp2DQ1xP6Qh2any03xTIjzlFtDZq1t u3w/lRm+6S/vUA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjW7-0002Tf-Id; Wed, 27 Oct 2021 10:03:04 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 05/10] services: static-networking: Use Guile-Netlink on GNU/Linux. Date: Wed, 27 Oct 2021 16:02:40 +0200 Message-Id: <20211027140245.18970-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (static-networking-shepherd-service): Define 'set-up-via-ioctl', 'tear-down-via-ioctl', 'set-up-via-netlink', 'tear-down-via-netlink', and 'helpers' and use them in 'start' and 'stop'. Add (ip *) modules to 'modules'. --- gnu/services/base.scm | 102 +++++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 30 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 50865055fe..d5ee03bbbd 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -53,6 +53,7 @@ (define-module (gnu services base) #:use-module (gnu packages bash) #:use-module ((gnu packages base) #:select (coreutils glibc glibc-utf8-locales)) + #:autoload (gnu packages guile-xyz) (guile-netlink) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (gnu packages linux) @@ -2336,6 +2337,66 @@ (define static-networking-shepherd-service (($ interface ip netmask gateway provision requirement name-servers) (let ((loopback? (and provision (memq 'loopback provision)))) + (define set-up-via-ioctl + #~(let* ((addr (inet-pton AF_INET #$ip)) + (sockaddr (make-socket-address AF_INET addr 0)) + (mask (and #$netmask (inet-pton AF_INET #$netmask))) + (maskaddr (and mask + (make-socket-address AF_INET mask 0))) + (gateway (and #$gateway + (inet-pton AF_INET #$gateway))) + (gatewayaddr (and gateway + (make-socket-address AF_INET + gateway 0)))) + (configure-network-interface #$interface sockaddr + (logior IFF_UP + #$(if loopback? + #~IFF_LOOPBACK + 0)) + #:netmask maskaddr) + (when gateway + (let ((sock (socket AF_INET SOCK_DGRAM 0))) + (add-network-route/gateway sock gatewayaddr) + (close-port sock))))) + + (define tear-down-via-ioctl + #~(let ((sock (socket AF_INET SOCK_STREAM 0))) + (when #$gateway + (delete-network-route sock + (make-socket-address AF_INET + INADDR_ANY 0))) + (set-network-interface-flags sock #$interface 0) + (close-port sock) + #f)) + + (define set-up-via-netlink + (with-extensions (list guile-netlink) + #~(let ((ip #$(if netmask + #~(ip+netmask->cidr #$ip #$netmask) + ip))) + (addr-add #$interface ip) + (when #$gateway + (route-add "default" #:device #$interface + #:via #$gateway)) + (link-set #$interface #:up #t)))) + + (define tear-down-via-netlink + (with-extensions (list guile-netlink) + #~(begin + (link-set #$interface #:down #t) + (when #$gateway + (route-del "default" #:device #$interface)) + (addr-del #$interface #$ip) + #f))) + + (define helpers + #~(define (ip+netmask->cidr ip netmask) + ;; Return the CIDR notation (a string) for IP and NETMASK, two + ;; IPv4 address strings. + (let* ((netmask (inet-pton AF_INET netmask)) + (bits (logcount netmask))) + (string-append ip "/" (number->string bits))))) + (shepherd-service (documentation @@ -2347,38 +2408,19 @@ (define static-networking-shepherd-service (start #~(lambda _ ;; Return #t if successfully started. - (let* ((addr (inet-pton AF_INET #$ip)) - (sockaddr (make-socket-address AF_INET addr 0)) - (mask (and #$netmask - (inet-pton AF_INET #$netmask))) - (maskaddr (and mask - (make-socket-address AF_INET - mask 0))) - (gateway (and #$gateway - (inet-pton AF_INET #$gateway))) - (gatewayaddr (and gateway - (make-socket-address AF_INET - gateway 0)))) - (configure-network-interface #$interface sockaddr - (logior IFF_UP - #$(if loopback? - #~IFF_LOOPBACK - 0)) - #:netmask maskaddr) - (when gateway - (let ((sock (socket AF_INET SOCK_DGRAM 0))) - (add-network-route/gateway sock gatewayaddr) - (close-port sock)))))) + #$helpers + (if (string-contains %host-type "-linux") + #$set-up-via-netlink + #$set-up-via-ioctl))) (stop #~(lambda _ ;; Return #f is successfully stopped. - (let ((sock (socket AF_INET SOCK_STREAM 0))) - (when #$gateway - (delete-network-route sock - (make-socket-address - AF_INET INADDR_ANY 0))) - (set-network-interface-flags sock #$interface 0) - (close-port sock) - #f))) + (if (string-contains %host-type "-linux") + #$tear-down-via-netlink + #$tear-down-via-ioctl))) + (modules `((ip addr) + (ip link) + (ip route) + ,@%default-modules)) (respawn? #f)))))) (define (static-networking-etc-files interfaces) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:18 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:19 +0000 Received: from localhost ([127.0.0.1]:50078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWQ-0002Wv-Fe for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWJ-0002VZ-9G for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjWE-00058C-2T; Wed, 27 Oct 2021 10:03:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=1jh4ueGONL6MEUTK8CSCWdtTCOUYwpUL8SHWIX5sYIA=; b=PTt0C10z1q0woPvL9CLf IoA/+VSsLLvLHsaTpPfpuWSwiz78LqoBcLWAjEq76uv6UCoKB7aWplMFChGJG3sN6xhF6jGtU8tjl CPWwT2HDFvlIqrA0/Y0fF7/xPr1ETIqYYDmuBU+6EvvQYehVQKBA0BS/7AFD1Cy48j7/c8hXiJM5x qecMtdy2H/BdCF/k4hIFTIS2nnyTTeefVRhB6HM7yAaVmqWy0nTDXD0bq3WG99vGZCOLHsOigoFdc MRmbTjRenzLL4paOukld5wOrHQunqtCvrGWMuFk7jGsj27+d0cLeLaTRYX2Brdhvknax5B9g4uq6p vJepM/SmvjC4qg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjWD-0002Tf-M4; Wed, 27 Oct 2021 10:03:05 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 06/10] services: secret-service: Turn into a Shepherd service. Date: Wed, 27 Oct 2021 16:02:41 +0200 Message-Id: <20211027140245.18970-6-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/virtualization.scm (secret-service-activation): Remove. (secret-service-shepherd-services): New procedure. (secret-service-type)[extensions]: Remove ACTIVATION-SERVICE-TYPE extension. Add SHEPHERD-ROOT-SERVICE-TYPE and USER-PROCESSES-SERVICE-TYPE extensions. * gnu/build/secret-service.scm (delete-file*): New procedure. (secret-service-receive-secrets): Use it. --- gnu/build/secret-service.scm | 17 ++++++++++++- gnu/services/virtualization.scm | 45 ++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 13 deletions(-) diff --git a/gnu/build/secret-service.scm b/gnu/build/secret-service.scm index 46dcf1b9c3..4e183e11e8 100644 --- a/gnu/build/secret-service.scm +++ b/gnu/build/secret-service.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020 Ludovic Courtès +;;; Copyright © 2020, 2021 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. @@ -111,6 +111,15 @@ (define (send-files sock) (close-port sock) #f)))) +(define (delete-file* file) + "Ensure FILE does not exist." + (catch 'system-error + (lambda () + (delete-file file)) + (lambda args + (unless (= ENOENT (system-error-errno args)) + (apply throw args))))) + (define (secret-service-receive-secrets port) "Listen to local PORT and wait for a secret service client to send secrets. Write them to the file system. Return the list of files installed on success, @@ -170,6 +179,12 @@ (define (read-secrets port) (log "installing file '~a' (~a bytes)...~%" file size) (mkdir-p (dirname file)) + + ;; It could be that FILE already exists, for instance + ;; because it has been created by a service's activation + ;; snippet (e.g., SSH host keys). Delete it. + (delete-file* file) + (call-with-output-file file (lambda (output) (dump port output size) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index bca5f56b87..e7d2a7b833 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -852,23 +852,44 @@ (define qemu-binfmt-service-type ;;; Secrets for guest VMs. ;;; -(define (secret-service-activation port) - "Return an activation snippet that fetches sensitive material at local PORT, +(define (secret-service-shepherd-services port) + "Return a Shepherd service that fetches sensitive material at local PORT, over TCP. Reboot upon failure." - (with-imported-modules '((gnu build secret-service) - (guix build utils)) - #~(begin - (use-modules (gnu build secret-service)) - (let ((sent (secret-service-receive-secrets #$port))) - (unless sent - (sleep 3) - (reboot)))))) + ;; This is a Shepherd service, rather than an activation snippet, to make + ;; sure it is started once 'networking' is up so it can accept incoming + ;; connections. + (list + (shepherd-service + (documentation "Fetch secrets from the host at startup time.") + (provision '(secret-service-client)) + (requirement '(loopback networking)) + (modules '((gnu build secret-service) + (guix build utils))) + (start (with-imported-modules '((gnu build secret-service) + (guix build utils)) + #~(lambda () + ;; Since shepherd's output port goes to /dev/log, write this + ;; message to stderr so it's visible on the Mach console. + (format (current-error-port) + "receiving secrets from the host...~%") + (force-output (current-error-port)) + + (let ((sent (secret-service-receive-secrets #$port))) + (unless sent + (sleep 3) + (reboot)))))) + (stop #~(const #f))))) (define secret-service-type (service-type (name 'secret-service) - (extensions (list (service-extension activation-service-type - secret-service-activation))) + (extensions (list (service-extension shepherd-root-service-type + secret-service-shepherd-services) + + ;; Make every Shepherd service depend on + ;; 'secret-service-client'. + (service-extension user-processes-service-type + (const '(secret-service-client))))) (description "This service fetches secret key and other sensitive material over TCP at boot time. This service is meant to be used by virtual machines (VMs) that -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:20 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:20 +0000 Received: from localhost ([127.0.0.1]:50080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWQ-0002X3-UZ for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWK-0002Vj-34 for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjWE-00058J-Rx; Wed, 27 Oct 2021 10:03:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=zbIt4xF0kkuo3g5h7cxqz7CjdZNPt6hwu/7MdVLEsWY=; b=GMHfI21bkW5aDEpB1UaA Jq1p+bb2jTbipwtkmfJU7Mo4G1OfVZK3BlbrKokVePHVIRaNlZ1/3SUAF+MHLBAoX8FbPBsKilgwM 1tbE0PCPSckSjibP6d1ztPMmH/ifnwWk+UxEIDgX/9YsRJkKDAuIJPboPPduCPHcICcbADZ0eKHs7 efbZ/M6LdBPZG8O35IKWt6ZusSnBwhDLmXJAUYWDyx+G771VowF3BDXaeeHMI+0ot1qgEYSvILNJR lznSRj6XFmC1JfM9YSZaLCEZkRLLCZUeDxp6ZJA9JxBfare/T9A4Hqu+iCp9du6xoWWP6dry87Mv1 coqatHBjy72AHw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjWE-0002Tf-B0; Wed, 27 Oct 2021 10:03:06 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 07/10] services: static-networking: Change interface to mimic netlink. Date: Wed, 27 Oct 2021 16:02:42 +0200 Message-Id: <20211027140245.18970-7-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm ()[interface, ip, netmask] [gateway]: Remove. [addresses, links, routes]: New fields. [requirement]: Default to '(udev). (, , ): New record types. (ensure-no-separate-netmask, %ensure-no-separate-netmask): Remove. (ipv6-address?, cidr->netmask, ip+netmask->cidr) (network-set-up/hurd, network-tear-down/hurd) (network-set-up/linux, network-tear-down/linux) (static-networking->hurd-pfinet-options): New procedures. (static-networking-shepherd-service): New procedure. (static-networking-shepherd-services): Rewrite in terms of the above. (static-networking-service): Deprecate. Adjust to new 'static-networking' API. (%base-services): Likewise. * gnu/system/install.scm (%installation-services): Likewise. * gnu/system/hurd.scm (%base-services/hurd): Likewise, and separate 'loopback' from 'networking'. * gnu/build/hurd-boot.scm (set-hurd-device-translators): Remove "servers/socket/2". * gnu/tests/networking.scm (run-openvswitch-test)["networking has started on ovs0"]: Check for 'networking instead of 'networking-ovs0, which is no longer provided. * doc/guix.texi (Networking Setup): Document the new interface. Remove documentation of 'static-networking-service'. (Virtualization Services): Change Ganeti example to use the new interface. --- doc/guix.texi | 191 +++++++++++++++--- gnu/build/hurd-boot.scm | 10 +- gnu/services/base.scm | 410 +++++++++++++++++++++++++++------------ gnu/system/hurd.scm | 27 ++- gnu/system/install.scm | 11 +- gnu/tests/networking.scm | 2 +- 6 files changed, 481 insertions(+), 170 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f7de378bdd..b529a8db6c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16762,32 +16762,166 @@ This section describes the various network setup services available, starting with static network configuration. @defvr {Scheme Variable} static-networking-service-type -This is the type for statically-configured network interfaces. -@c TODO Document data structures. +This is the type for statically-configured network interfaces. Its +value must be a list of @code{static-networking} records. Each of them +declares a set of @dfn{addresses}, @dfn{routes}, and @dfn{links}, as +show below. + +@cindex network interface controller (NIC) +@cindex NIC, networking interface controller +Here is the simplest configuration, with only one network interface +controller (NIC) and only IPv4 connectivity: + +@example +;; Static networking for one NIC, IPv4-only. +(service static-networking-service-type + (list (static-networking + (addresses + (list (network-address + (device "eno1") + (value "10.0.2.15/24")))) + (routes + (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (name-servers '("10.0.2.3"))))) +@end example + +The snippet above can be added to the @code{services} field of your +operating system configuration (@pxref{Using the Configuration System}). +It will configure your machine to have 10.0.2.15 as its IP address, with +a 24-bit netmask for the local network---meaning that any 10.0.2.@var{x} +address is on the local area network (LAN). Traffic to addresses +outside the local network is routed @i{via} 10.0.2.2. Host names are +resolved by sending domain name system (DNS) queries to 10.0.2.3. @end defvr -@deffn {Scheme Procedure} static-networking-service @var{interface} @var{ip} @ - [#:netmask #f] [#:gateway #f] [#:name-servers @code{'()}] @ - [#:requirement @code{'(udev)}] -Return a service that starts @var{interface} with address @var{ip}. If -@var{netmask} is true, use it as the network mask. If @var{gateway} is true, -it must be a string specifying the default network gateway. @var{requirement} -can be used to declare a dependency on another service before configuring the -interface. +@deftp {Data Type} static-networking +This is the data type representing a static network configuration. -This procedure can be called several times, one for each network -interface of interest. Behind the scenes what it does is extend -@code{static-networking-service-type} with additional network interfaces -to handle. - -For example: +As an example, here is how you would declare the configuration of a +machine with a single network interface controller (NIC) available as +@code{eno1}, and with one IPv4 and one IPv6 address: @lisp -(static-networking-service "eno1" "192.168.1.82" - #:gateway "192.168.1.2" - #:name-servers '("192.168.1.2")) +;; Network configuration for one NIC, IPv4 + IPv6. +(static-networking + (addresses (list (network-address + (device "eno1") + (value "10.0.2.15/24")) + (network-address + (device "eno1") + (value "2001:123:4567:101::1")))) + (routes (list (network-route + (destination "default") + (gateway "10.0.2.2")) + (network-route + (destination "default") + (gateway "2020:321:4567:42::1")))) + (name-servers '("10.0.2.3"))) @end lisp -@end deffn + +If you are familiar with the @command{ip} command of the +@uref{https://wiki.linuxfoundation.org/networking/iproute2, +@code{iproute2} package} found on Linux-based systems, the declaration +above is equivalent to typing: + +@example +ip address add 10.0.2.15/24 dev eno1 +ip address add 2001:123:4567:101::1 dev eno1 +ip route add default via inet 10.0.2.2 +ip route add default via inet6 2020:321:4567:42::1 +@end example + +Run @command{man 8 ip} for more info. Venerable GNU/Linux users will +certainly know how to do it with @command{ifconfig} and @command{route}, +but we'll spare you that. + +The available fields of this data type are as follows: + +@table @asis +@item @code{addresses} +@itemx @code{links} (default: @code{'()}) +@itemx @code{links} (default: @code{'()}) +The list of @code{network-address}, @code{network-link}, and +@code{network-route} records for this network (see below). + +@item @code{name-servers} (default: @code{'()}) +The list of IP addresses (strings) of domain name servers. These IP +addresses go to @file{/etc/resolv.conf}. + +@item @code{provision} (default: @code{#f}) +If true, this should be a list of symbols for the Shepherd service +corresponding to this network configuration. When @code{#f}, +@code{'(networking)} or @code{'(loopback)} is used. + +@item @code{requirement} (default @code{'()}) +The list of Shepherd services depended on. +@end table +@end deftp + +@deftp {Data Type} network-address +This is the data type representing the IP address of a network +interface. + +@table @code +@item device +The name of the network interface for this address---e.g., +@code{"eno1"}. + +@item value +The actual IP address and network mask, in +@uref{https://en.wikipedia.org/wiki/CIDR#CIDR_notation, @acronym{CIDR, +Classless Inter-Domain Routing} notation}, as a string. + +For example, @code{"10.0.2.15/24"} denotes IPv4 address 10.0.2.15 on a +24-bit sub-network---all 10.0.2.@var{x} addresses are on the same local +network. + +@item ipv6? +Whether @code{value} denotes an IPv6 address. By default this is +automatically determined. +@end table +@end deftp + +@deftp {Data Type} network-route +This is the data type representing a network route. + +@table @asis +@item @code{destination} +The route destination (a string), either an IP address or +@code{"default"} to denote the default route. + +@item @code{source} (default: @code{#f}) +The route source. + +@item @code{device} (default: @code{#f}) +The device used for this route---e.g., @code{"eno2"}. + +@item @code{ipv6?} (default: auto) +Whether this is an IPv6 route. By default this is automatically +determined based on @code{destination} or @code{gateway}. + +@item @code{gateway} (default: @code{#f}) +IP address (a string) through which traffic is routed. +@end table +@end deftp + +@deftp {Data Type} network-link +Data type for a network link (@pxref{Link,,, guile-netlink, +Guile-Netlink Manual}). + +@table @code +@item name +The name of the link---e.g., @code{"v0p0"}. + +@item type +A symbol denoting the type of the link---e.g., @code{'veth}. + +@item arguments +List of arguments for this type of link. +@end table +@end deftp @cindex DHCP, networking service @defvr {Scheme Variable} dhcp-client-service-type @@ -30300,11 +30434,18 @@ cluster node that supports multiple storage backends, and installs the "ganeti-instance-guix" "ganeti-instance-debootstrap")) %base-packages)) (services - (append (list (static-networking-service "eth0" "192.168.1.201" - #:netmask "255.255.255.0" - #:gateway "192.168.1.254" - #:name-servers '("192.168.1.252" - "192.168.1.253")) + (append (list (service static-networking-service-type + (list (static-networking + (addresses + (list (network-address + (device "eth0") + (value "192.168.1.201/24")))) + (routes + (list (network-route + (destination "default") + (gateway "192.168.1.254")))) + (name-servers '("192.168.1.252" + "192.168.1.253"))))) ;; Ganeti uses SSH to communicate between nodes. (service openssh-service-type diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index 8b27995438..ac36bd17d4 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -185,13 +185,9 @@ (define servers ("servers/crash-suspend" ("/hurd/crash" "--suspend")) ("servers/password" ("/hurd/password")) ("servers/socket/1" ("/hurd/pflocal")) - ("servers/socket/2" ("/hurd/pfinet" - "--interface" "eth0" - "--address" - "10.0.2.15" ;the default QEMU guest IP - "--netmask" "255.255.255.0" - "--gateway" "10.0.2.2" - "--ipv6" "/servers/socket/26")) + ;; /servers/socket/2 and /26 are created by 'static-networking-service'. + ;; XXX: Spawn pfinet without arguments on these nodes so that a DHCP + ;; client has someone to talk to? ("proc" ("/hurd/procfs" "--stat-mode=444")))) (define devices diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d5ee03bbbd..03f6b388a8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -35,6 +35,8 @@ (define-module (gnu services base) #:use-module (guix store) #:use-module (guix deprecation) + #:autoload (guix diagnostics) (warning) + #:autoload (guix i18n) (G_) #:use-module (gnu services) #:use-module (gnu services admin) #:use-module (gnu services shepherd) @@ -54,6 +56,7 @@ (define-module (gnu services base) #:use-module ((gnu packages base) #:select (coreutils glibc glibc-utf8-locales)) #:autoload (gnu packages guile-xyz) (guile-netlink) + #:autoload (gnu packages hurd) (hurd) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (gnu packages linux) @@ -81,14 +84,32 @@ (define-module (gnu services base) virtual-terminal-service-type static-networking - static-networking? - static-networking-interface - static-networking-ip - static-networking-netmask - static-networking-gateway + static-networking-addresses + static-networking-links + static-networking-routes static-networking-requirement + network-address + network-address? + network-address-device + network-address-value + network-address-ipv6? + + network-link + network-link? + network-link-name + network-link-type + network-link-arguments + + network-route + network-route? + network-route-destination + network-route-source + network-route-device + network-route-ipv6? + network-route-gateway + static-networking-service static-networking-service-type @@ -2316,113 +2337,254 @@ (define kmscon-command (description "Start the @command{kmscon} virtual terminal emulator for the Linux @dfn{kernel mode setting} (KMS)."))) + +;;; +;;; Static networking. +;;; + +(define (ipv6-address? str) + "Return true if STR denotes an IPv6 address." + (false-if-exception (->bool (inet-pton AF_INET6 str)))) + (define-record-type* static-networking make-static-networking static-networking? - (interface static-networking-interface) - (ip static-networking-ip) - (netmask static-networking-netmask - (default #f)) - (gateway static-networking-gateway ;FIXME: doesn't belong here - (default #f)) + (addresses static-networking-addresses) ;list of + (links static-networking-links (default '())) ;list of + (routes static-networking-routes (default '())) ;list of (provision static-networking-provision (default #f)) (requirement static-networking-requirement - (default '())) + (default '(udev))) (name-servers static-networking-name-servers ;FIXME: doesn't belong here (default '()))) -(define static-networking-shepherd-service +(define-record-type* + network-address make-network-address + network-address? + (device network-address-device) ;string--e.g., "en01" + (value network-address-value) ;string--CIDR notation + (ipv6? network-address-ipv6? ;Boolean + (thunked) + (default + (ipv6-address? (cidr->ip (network-address-value this-record)))))) + +(define-record-type* + network-link make-network-link + network-link? + (name network-link-name) ;string--e.g, "v0p0" + (type network-link-type) ;symbol--e.g.,'veth + (arguments network-link-arguments)) ;list + +(define-record-type* + network-route make-network-route + network-route? + (destination network-route-destination) + (source network-route-source (default #f)) + (device network-route-device (default #f)) + (ipv6? network-route-ipv6? (thunked) + (default + (or (ipv6-address? (network-route-destination this-record)) + (and=> (network-route-gateway this-record) + ipv6-address?)))) + (gateway network-route-gateway (default #f))) + +(define* (cidr->netmask str #:optional (family AF_INET)) + "Given @var{str}, a string in CIDR notation (e.g., \"1.2.3.4/24\"), return +the netmask as a string like \"255.255.255.0\"." + (match (string-split str #\/) + ((ip (= string->number bits)) + (let ((mask (ash (- (expt 2 bits) 1) + (- (if (= family AF_INET6) 128 32) + bits)))) + (inet-ntop family mask))) + (_ #f))) + +(define (cidr->ip str) + "Strip the netmask bit of @var{str}, a CIDR-notation IP/netmask address." + (match (string-split str #\/) + ((or (ip _) (ip)) + ip))) + +(define* (ip+netmask->cidr ip netmask #:optional (family AF_INET)) + "Return the CIDR notation (a string) for @var{ip} and @var{netmask}, two +@var{family} address strings, where @var{family} is @code{AF_INET} or +@code{AF_INET6}." + (let* ((netmask (inet-pton family netmask)) + (bits (logcount netmask))) + (string-append ip "/" (number->string bits)))) + +(define (static-networking->hurd-pfinet-options config) + "Return command-line options for the Hurd's pfinet translator corresponding +to CONFIG." + (unless (null? (static-networking-links config)) + ;; XXX: Presumably this is not supported, or perhaps could be approximated + ;; by running separate pfinet instances in some cases? + (warning (G_ "network links are currently ignored on GNU/Hurd~%"))) + + (match (static-networking-addresses config) + ((and addresses (first _ ...)) + `("--ipv6" "/servers/socket/26" + "--interface" ,(network-address-device first) + ,@(append-map (lambda (address) + `(,(if (network-address-ipv6? address) + "--address6" + "--address") + ,(cidr->ip (network-address-value address)) + ,@(match (cidr->netmask (network-address-value address) + (if (network-address-ipv6? address) + AF_INET6 + AF_INET)) + (#f '()) + (mask (list "--netmask" mask))))) + addresses) + ,@(append-map (lambda (route) + (match route + (($ "default" #f device _ gateway) + (if (network-route-ipv6? route) + `("--gateway6" ,gateway) + `("--gateway" ,gateway))) + (($ destination) + (warning (G_ "ignoring network route for '~a'~%") + destination) + '()))) + (static-networking-routes config)))))) + +(define (network-set-up/hurd config) + "Set up networking for the Hurd." + ;; The Hurd implements SIOCGIFADDR and other old-style ioctls, but the only + ;; way to set up IPv6 is by starting pfinet with the right options. + (if (equal? (static-networking-provision config) '(loopback)) + (scheme-file "set-up-pflocal" #~(begin 'nothing-to-do! #t)) + (scheme-file "set-up-pfinet" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 format)) + + ;; TODO: Do that without forking. + (let ((options '#$(static-networking->hurd-pfinet-options + config))) + (format #t "starting '~a~{ ~s~}'~%" + #$(file-append hurd "/hurd/pfinet") + options) + (apply invoke #$(file-append hurd "/bin/settrans") "-fac" + "/servers/socket/2" + #$(file-append hurd "/hurd/pfinet") + options))))))) + +(define (network-tear-down/hurd config) + (scheme-file "tear-down-pfinet" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + ;; Forcefully terminate pfinet. XXX: In theory this + ;; should just undo the addresses and routes of CONFIG; + ;; this could be done using ioctls like SIOCDELRT, but + ;; these are IPv4-only; another option would be to use + ;; fsysopts but that seems to crash pfinet. + (invoke #$(file-append hurd "/bin/settrans") "-fg" + "/servers/socket/2") + #f)))) + +(define network-set-up/linux (match-lambda - (($ interface ip netmask gateway provision - requirement name-servers) + (($ addresses links routes) + (scheme-file "set-up-network" + (with-extensions (list guile-netlink) + #~(begin + (use-modules (ip addr) (ip link) (ip route)) + + #$@(map (lambda (address) + #~(begin + (addr-add #$(network-address-device address) + #$(network-address-value address) + #:ipv6? + #$(network-address-ipv6? address)) + ;; FIXME: loopback? + (link-set #$(network-address-device address) + #:up #t))) + addresses) + #$@(map (match-lambda + (($ name type arguments) + #~(link-add #:device #$name #$type + #:type-args '#$arguments))) + links) + #$@(map (lambda (route) + #~(route-add #$(network-route-destination route) + #:device + #$(network-route-device route) + #:ipv6? + #$(network-route-ipv6? route) + #:via + #$(network-route-gateway route) + #:src + #$(network-route-source route))) + routes) + #t)))))) + +(define network-tear-down/linux + (match-lambda + (($ addresses links routes) + (scheme-file "set-up-network" + (with-extensions (list guile-netlink) + #~(begin + (use-modules (ip addr) (ip link) (ip route)) + + #$@(map (lambda (route) + #~(route-del #$(network-route-destination route) + #:device + #$(network-route-device route) + #:ipv6? + #$(network-route-ipv6? route) + #:via + #$(network-route-gateway route) + #:src + #$(network-route-source route))) + routes) + #$@(map (match-lambda + (($ name type arguments) + #~(link-del #$name))) + links) + #$@(map (lambda (address) + #~(addr-del #$(network-address-device + address) + #$(network-address-value address) + #:ipv6? + #$(network-address-ipv6? address))) + addresses) + #f)))))) + +(define (static-networking-shepherd-service config) + (match config + (($ addresses links routes + provision requirement name-servers) (let ((loopback? (and provision (memq 'loopback provision)))) - (define set-up-via-ioctl - #~(let* ((addr (inet-pton AF_INET #$ip)) - (sockaddr (make-socket-address AF_INET addr 0)) - (mask (and #$netmask (inet-pton AF_INET #$netmask))) - (maskaddr (and mask - (make-socket-address AF_INET mask 0))) - (gateway (and #$gateway - (inet-pton AF_INET #$gateway))) - (gatewayaddr (and gateway - (make-socket-address AF_INET - gateway 0)))) - (configure-network-interface #$interface sockaddr - (logior IFF_UP - #$(if loopback? - #~IFF_LOOPBACK - 0)) - #:netmask maskaddr) - (when gateway - (let ((sock (socket AF_INET SOCK_DGRAM 0))) - (add-network-route/gateway sock gatewayaddr) - (close-port sock))))) - - (define tear-down-via-ioctl - #~(let ((sock (socket AF_INET SOCK_STREAM 0))) - (when #$gateway - (delete-network-route sock - (make-socket-address AF_INET - INADDR_ANY 0))) - (set-network-interface-flags sock #$interface 0) - (close-port sock) - #f)) - - (define set-up-via-netlink - (with-extensions (list guile-netlink) - #~(let ((ip #$(if netmask - #~(ip+netmask->cidr #$ip #$netmask) - ip))) - (addr-add #$interface ip) - (when #$gateway - (route-add "default" #:device #$interface - #:via #$gateway)) - (link-set #$interface #:up #t)))) - - (define tear-down-via-netlink - (with-extensions (list guile-netlink) - #~(begin - (link-set #$interface #:down #t) - (when #$gateway - (route-del "default" #:device #$interface)) - (addr-del #$interface #$ip) - #f))) - - (define helpers - #~(define (ip+netmask->cidr ip netmask) - ;; Return the CIDR notation (a string) for IP and NETMASK, two - ;; IPv4 address strings. - (let* ((netmask (inet-pton AF_INET netmask)) - (bits (logcount netmask))) - (string-append ip "/" (number->string bits))))) - (shepherd-service (documentation "Bring up the networking interface using a static IP address.") (requirement requirement) - (provision (or provision - (list (symbol-append 'networking- - (string->symbol interface))))) + (provision (or provision '(networking))) (start #~(lambda _ ;; Return #t if successfully started. - #$helpers - (if (string-contains %host-type "-linux") - #$set-up-via-netlink - #$set-up-via-ioctl))) + (load #$(let-system (system target) + (if (string-contains (or target system) "-linux") + (network-set-up/linux config) + (network-set-up/hurd config)))))) (stop #~(lambda _ ;; Return #f is successfully stopped. - (if (string-contains %host-type "-linux") - #$tear-down-via-netlink - #$tear-down-via-ioctl))) - (modules `((ip addr) - (ip link) - (ip route) - ,@%default-modules)) + #$(let-system (system target) + (if (string-contains (or target system) "-linux") + (network-tear-down/linux config) + (network-tear-down/hurd config))))) (respawn? #f)))))) +(define (static-networking-shepherd-services networks) + (map static-networking-shepherd-service networks)) + (define (static-networking-etc-files interfaces) "Return a /etc/resolv.conf entry for INTERFACES or the empty list." (match (delete-duplicates @@ -2441,30 +2603,6 @@ (define (static-networking-etc-files interfaces) # Generated by 'static-networking-service'.\n" content)))))))) -(define (static-networking-shepherd-services interfaces) - "Return the list of Shepherd services to bring up INTERFACES, a list of - objects." - (define (loopback? service) - (memq 'loopback (shepherd-service-provision service))) - - (let ((services (map static-networking-shepherd-service interfaces))) - (match (remove loopback? services) - (() - ;; There's no interface other than 'loopback', so we assume that the - ;; 'networking' service will be provided by dhclient or similar. - services) - ((non-loopback ...) - ;; Assume we're providing all the interfaces, and thus, provide a - ;; 'networking' service. - (cons (shepherd-service - (provision '(networking)) - (requirement (append-map shepherd-service-provision - services)) - (start #~(const #t)) - (stop #~(const #f)) - (documentation "Bring up all the networking interfaces.")) - services))))) - (define static-networking-service-type ;; The service type for statically-defined network interfaces. (service-type (name 'static-networking) @@ -2482,12 +2620,13 @@ (define static-networking-service-type services of this type is a list of @code{static-networking} objects, one per network interface."))) -(define* (static-networking-service interface ip - #:key - netmask gateway provision - ;; Most interfaces require udev to be usable. - (requirement '(udev)) - (name-servers '())) +(define-deprecated (static-networking-service interface ip + #:key + netmask gateway provision + ;; Most interfaces require udev to be usable. + (requirement '(udev)) + (name-servers '())) + static-networking-service-type "Return a service that starts @var{interface} with address @var{ip}. If @var{netmask} is true, use it as the network mask. If @var{gateway} is true, it must be a string specifying the default network gateway. @@ -2498,11 +2637,24 @@ (define* (static-networking-service interface ip to handle." (simple-service 'static-network-interface static-networking-service-type - (list (static-networking (interface interface) (ip ip) - (netmask netmask) (gateway gateway) - (provision provision) - (requirement requirement) - (name-servers name-servers))))) + (list (static-networking + (addresses + (list (network-address + (device interface) + (value (if netmask + (ip+netmask->cidr ip netmask) + ip)) + (ipv6? #f)))) + (routes + (if gateway + (list (network-route + (destination "default") + (gateway gateway) + (ipv6? #f))) + '())) + (requirement requirement) + (provision provision) + (name-servers name-servers))))) (define %base-services @@ -2534,10 +2686,12 @@ (define %base-services (tty "tty6"))) (service static-networking-service-type - (list (static-networking (interface "lo") - (ip "127.0.0.1") - (requirement '()) - (provision '(loopback))))) + (list (static-networking + (addresses (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback))))) (syslog-service) (service urandom-seed-service-type) (service guix-service-type) diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 0794671ce4..0e73ca0d99 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -79,11 +79,28 @@ (define %base-services/hurd (service hurd-getty-service-type (hurd-getty-configuration (tty "tty2"))) (service static-networking-service-type - (list (static-networking (interface "lo") - (ip "127.0.0.1") - (requirement '()) - (provision '(loopback networking)) - (name-servers '("10.0.2.3"))))) + (list (static-networking + (addresses + (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback))) + (static-networking + (addresses + ;; The default QEMU guest address. To get "eth0", + ;; you need QEMU to emulate a device for which Mach + ;; has an in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + (list (network-address + (device "eth0") + (value "10.0.2.15/24")))) + (routes + (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (provision '(networking)) + (name-servers '("10.0.2.3"))))) (syslog-service) (service guix-service-type (guix-configuration diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 7b394184ad..bdfe580145 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -408,10 +408,13 @@ (define bare-bones-os ;; Loopback device, needed by OpenSSH notably. (service static-networking-service-type - (list (static-networking (interface "lo") - (ip "127.0.0.1") - (requirement '()) - (provision '(loopback))))) + (list (static-networking + (addresses + (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback))))) (service wpa-supplicant-service-type) (dbus-service) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 131428c128..c66af279f2 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -337,7 +337,7 @@ (define marionette (srfi srfi-1)) (live-service-running (find (lambda (live) - (memq 'networking-ovs0 + (memq 'networking (live-service-provision live))) (current-services)))) marionette)) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:20 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:21 +0000 Received: from localhost ([127.0.0.1]:50082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWS-0002XB-Dz for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWL-0002W0-IM for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjWG-00058Y-Ax; Wed, 27 Oct 2021 10:03:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=NfHER5O+rtp5vUNrP/FtzUi2KACgFi9EmcB/+QS6z+0=; b=Q9DJd5RXi2MlebTEjLQZ nwkBDpruYg3uDtbFXnk1DbaewZiJbQiystcVbXG7JGTPYENlQfnBeYw3ODnzzGn+F2+xM8rVjvFQT w5I2NDGnDp62Pya00d5bSE+FEwSAxWF4aCH2R1JjPxFeFZBZu4wb/o7aLIInNMnY1/1w/SC1xWujS SRO/BLwqgjZn1Cv2yvJo+s0YFgZjJr85CUQ7JxowAkl79WzjpBF+lFbBJGQmR/hOGBSTDCRazku4G EcFxAZI1Ko1rBgvDniqWmHKFWzN3Z392PUvzvEcfq8NmWvHnieEAjxLfxZvZ/UDZzYuygiBO3swrv N95/Zhse36GEGw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjWF-0002Tf-37; Wed, 27 Oct 2021 10:03:08 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 08/10] services: Define '%qemu-static-networking'. Date: Wed, 27 Oct 2021 16:02:43 +0200 Message-Id: <20211027140245.18970-8-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (%qemu-static-networking): New variable. * gnu/system/hurd.scm (%base-services/hurd): Use it. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 8 ++++++++ gnu/services/base.scm | 16 ++++++++++++++++ gnu/system/hurd.scm | 21 ++++++--------------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b529a8db6c..0b23075d8c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16923,6 +16923,14 @@ List of arguments for this type of link. @end table @end deftp +@cindex networking, with QEMU +@cindex QEMU, networking +@defvr {Scheme Variable} %qemu-static-networking +This is the @code{static-networking} record representing network setup +when using QEMU's user-mode network stack on @code{eth0} (@pxref{Using +the user mode network stack,,, QEMU, QEMU Documentation}). +@end defvr + @cindex DHCP, networking service @defvr {Scheme Variable} dhcp-client-service-type This is the type of services that run @var{dhcp}, a Dynamic Host Configuration diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 03f6b388a8..380be1c71e 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -113,6 +113,8 @@ (define-module (gnu services base) static-networking-service static-networking-service-type + %qemu-static-networking + udev-configuration udev-configuration? udev-configuration-rules @@ -2656,6 +2658,20 @@ (define-deprecated (static-networking-service interface ip (provision provision) (name-servers name-servers))))) +(define %qemu-static-networking + ;; Networking configuration for QEMU's user-mode network stack (info "(QEMU) + ;; Using the user mode network stack"). + (static-networking + (addresses (list (network-address + (device "eth0") + (value "10.0.2.15/24")))) + (routes (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (requirement '()) + (provision '(networking)) + (name-servers '("10.0.2.3")))) + (define %base-services ;; Convenience variable holding the basic services. diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 0e73ca0d99..ec8484d746 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -86,21 +86,12 @@ (define %base-services/hurd (value "127.0.0.1")))) (requirement '()) (provision '(loopback))) - (static-networking - (addresses - ;; The default QEMU guest address. To get "eth0", - ;; you need QEMU to emulate a device for which Mach - ;; has an in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - (list (network-address - (device "eth0") - (value "10.0.2.15/24")))) - (routes - (list (network-route - (destination "default") - (gateway "10.0.2.2")))) - (provision '(networking)) - (name-servers '("10.0.2.3"))))) + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) (syslog-service) (service guix-service-type (guix-configuration -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:21 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:21 +0000 Received: from localhost ([127.0.0.1]:50084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWS-0002XJ-SR for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWM-0002W2-6K for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjWG-00058g-VR; Wed, 27 Oct 2021 10:03:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=9ixZsw9w1H86Yy9qbxjswPmAlVRihcKD1Z3y9hqnY+g=; b=Kwa8tzUTcdI/RcRHkOpe J9TLaDOhu8FZ/ccxLrmX6tQ+SXgUfEd4DBXjquf3a6jnCAMmbWkDuvRfb0foCfsSyuvVKK8ENRYM7 DYKklZ8GZTRHNPYUwKWtg4PpLIEeJy013xDOQTJ7ZgV4w6ddzhYhRyWhBn++zfBl7+ateTOV8gZl4 j69ZaKxcG6Fe1M68TlzQUE4Bp45Xw9R+qs9HyNW6pfM94wPUii7sx+cmPAmwuIj1EjTuN8KZ76Qg7 vurTQvFIhKZ3z9iWsjuPlLsGgKVyt1M3CcHXG85Gxy/Eu2SlPSiHbYhQviSkyFE6JQLqJjvA+2Lss hCvgk8NPcGZ0cA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjWG-0002Tf-Iq; Wed, 27 Oct 2021 10:03:08 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 09/10] services: Define '%loopback-static-networking'. Date: Wed, 27 Oct 2021 16:02:44 +0200 Message-Id: <20211027140245.18970-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (%loopback-static-networking): New variable. (%base-services): Use it. * gnu/system/hurd.scm (%base-services/hurd): Use it. * gnu/system/install.scm (%installation-services): Use it. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 7 +++++++ gnu/services/base.scm | 17 +++++++++++------ gnu/system/hurd.scm | 8 +------- gnu/system/install.scm | 8 +------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 0b23075d8c..b8b9cf2730 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16923,6 +16923,13 @@ List of arguments for this type of link. @end table @end deftp +@cindex loopback device +@defvr {Scheme Variable} %loopback-static-networking +This is the @code{static-networking} record representing the ``loopback +device'', @code{lo}, for IP addresses 127.0.0.1 and ::1, and providing +the @code{loopback} Shepherd service. +@end defvr + @cindex networking, with QEMU @cindex QEMU, networking @defvr {Scheme Variable} %qemu-static-networking diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 380be1c71e..66683f153f 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -113,6 +113,7 @@ (define-module (gnu services base) static-networking-service static-networking-service-type + %loopback-static-networking %qemu-static-networking udev-configuration @@ -2658,6 +2659,15 @@ (define-deprecated (static-networking-service interface ip (provision provision) (name-servers name-servers))))) +(define %loopback-static-networking + ;; The loopback device. + (static-networking + (addresses (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback)))) + (define %qemu-static-networking ;; Networking configuration for QEMU's user-mode network stack (info "(QEMU) ;; Using the user mode network stack"). @@ -2702,12 +2712,7 @@ (define %base-services (tty "tty6"))) (service static-networking-service-type - (list (static-networking - (addresses (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))))) + (list %loopback-static-networking)) (syslog-service) (service urandom-seed-service-type) (service guix-service-type) diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index ec8484d746..2acc7b7e11 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -79,13 +79,7 @@ (define %base-services/hurd (service hurd-getty-service-type (hurd-getty-configuration (tty "tty2"))) (service static-networking-service-type - (list (static-networking - (addresses - (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))) + (list %loopback-static-networking ;; QEMU user-mode networking. To get "eth0", you need ;; QEMU to emulate a device for which Mach has an diff --git a/gnu/system/install.scm b/gnu/system/install.scm index bdfe580145..073d7df1db 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -408,13 +408,7 @@ (define bare-bones-os ;; Loopback device, needed by OpenSSH notably. (service static-networking-service-type - (list (static-networking - (addresses - (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))))) + (list %loopback-static-networking)) (service wpa-supplicant-service-type) (dbus-service) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 10:03:34 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:34 +0000 Received: from localhost ([127.0.0.1]:50086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWg-0002Xn-AN for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWN-0002W4-1f for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjWH-00058o-R2; Wed, 27 Oct 2021 10:03:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=f0T5dgslaHqaANUOThtzyqZWhOicRkOBGFHzUtH5IrY=; b=qXujNXdaHUkz8+K+ivbi ZQJsJiQMQ7LIGNym9tuf9Ue3IjDLS+QSOzRr9wJ3PwKmOIocWSxnkYS2+Vna4tMDKEPZKB9/1OL8X mvgWDdOS7lvttdK/otf50osW0VhdF/CqVv/FaAOOrp1brZcW2tCwOaY8VTg3AxDG6y/svwpHbD+bP 2Hj7nWIGpdcGh6rrvUqQQecKoIUpNJlpEwCb2+TMjA+lJgr4LPnQ9jUvYf9ZomWV/2v9bMG3ud60Q gkgtSgJxfqYjaoyoKy9tAxHh5WPMeJ83LpnzvdA2botn50ZHZkbN0zm6I6OnkLo+bwpSrecmV40NE OGl+bnwkbE88OA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjWH-0002Tf-76; Wed, 27 Oct 2021 10:03:09 -0400 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH 10/10] tests: Replace uses of deprecated 'static-networking-service'. Date: Wed, 27 Oct 2021 16:02:45 +0200 Message-Id: <20211027140245.18970-10-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/tests/ganeti.scm (%ganeti-os): Replace call to 'static-networking-service' by instantiating STATIC-NETWORKING-SERVICE-TYPE. * gnu/tests/networking.scm (%test-static-networking) (%openvswitch-os, %dhcpd-os): Likewise. --- gnu/tests/ganeti.scm | 7 ++----- gnu/tests/networking.scm | 29 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index 5ac2fd48dd..c29b885a5e 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -59,11 +59,8 @@ (define %ganeti-os (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) %base-packages)) (services - (append (list (static-networking-service "eth0" "10.0.2.15" - #:netmask "255.255.255.0" - #:gateway "10.0.2.2" - #:name-servers '("10.0.2.3")) - + (append (list (service static-networking-service-type + (list %qemu-static-networking)) (service openssh-service-type (openssh-configuration (permit-root-login 'prohibit-password))) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index c66af279f2..246e0a15fa 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -122,10 +122,8 @@ (define %test-static-networking (value (let ((os (marionette-operating-system (simple-operating-system - (static-networking-service "eth0" "10.0.2.15" - #:netmask "255.255.255.0" - #:gateway "10.0.2.2" - #:name-servers '("10.0.2.2"))) + (service static-networking-service-type + (list %qemu-static-networking))) #:imported-modules '((gnu services herd) (guix combinators))))) (run-static-networking-test (virtual-machine os)))))) @@ -275,9 +273,13 @@ (define openvswitch-configuration-service (define %openvswitch-os (operating-system (inherit (simple-operating-system - (static-networking-service "ovs0" "10.1.1.1" - #:netmask "255.255.255.252" - #:requirement '(openvswitch-configuration)) + (simple-service 'openswitch-networking + static-networking-service-type + (list (static-networking + (addresses (list (network-address + (value "10.1.1.1/24") + (device "ovs0")))) + (requirement '(openvswitch-configuration))))) (service openvswitch-service-type) openvswitch-configuration-service)) ;; Ensure the interface name does not change depending on the driver. @@ -392,10 +394,15 @@ (define dhcpd-v4-configuration (define %dhcpd-os (simple-operating-system - (static-networking-service "ens3" "192.168.1.4" - #:netmask "255.255.255.0" - #:gateway "192.168.1.1" - #:name-servers '("192.168.1.2" "192.168.1.3")) + (service static-networking-service-type + (list (static-networking + (addresses (list (network-address + (value "192.168.1.4/24") + (device "ens3")))) + (routes (list (network-route + (destination "default") + (gateway "192.168.1.1")))) + (name-servers '("192.168.1.2" "192.168.1.3"))))) (service dhcpd-service-type dhcpd-v4-configuration))) (define (run-dhcpd-test) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 11:30:08 2021 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 15:30:08 +0000 Received: from localhost ([127.0.0.1]:50243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfksR-00011I-Gi for submit@debbugs.gnu.org; Wed, 27 Oct 2021 11:30:08 -0400 Received: from lepiller.eu ([89.234.186.109]:36856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfksP-00010s-0F; Wed, 27 Oct 2021 11:30:05 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 41d33272; Wed, 27 Oct 2021 15:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=P2Wqqvzz/97J TzqgAmxyWf1wS6UfGrurXZm2Y7AC1kw=; b=L2XSCUDpSnFRMtU3Vhrb5DCFjQvF 85J4gUo9N/HOzW8nmsP+R+oSabuRsykANqb20bcgcV94Al40jWIJcC1NZ5WxpKo6 /oHQ6i+RpYo/sLuPhUEQmFVwWZQTf7RTU3Sy/bRU1LZlov77oKzIEHZQSNtmHlt5 hwh8TC/BQ9UlsDULZb5eKcoZM/yd6yYA/vM03ue5wrH6AfTQL66a2r/2EUOpak6i 5pIARzovAtEcGES4rts7RFQxqC84F6bpw83oh3QAwbP1hQIwxTl3qCjJZBQs8pwe MKETsvwJh5Vry31iNdFHEnYQ9hZF/rHrUvJVqKvILbMhcpUQzeS1beHyrQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id b05bfbf9 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 27 Oct 2021 15:30:02 +0000 (UTC) Date: Wed, 27 Oct 2021 11:29:47 -0400 From: Julien Lepiller To: debbugs-submit@debbugs.gnu.org, =?ISO-8859-1?Q?Ludovic_Court=E8s?= , 51440@debbugs.gnu.org Subject: Re: [bug#51440] [PATCH 00/10] Declarative static networking interface User-Agent: K-9 Mail for Android In-Reply-To: <20211027135918.18833-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> Message-ID: <98B14704-7A97-4D5A-80CD-6A44DBAEFBC7@lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le 27 octobre 2021 09:59:18 GMT-04:00, "Ludovic Court=C3=A8s" a =C3=A9crit=C2=A0: >Hi! > >This patch set builds on Julien=E2=80=99s neat Guile-Netlink to finally >provide a proper static networking configuration interface=2E One >can now write things like: > > (service static-networking-service-type > ;; Network configuration for one NIC, IPv4 + IPv6=2E > (static-networking > (addresses (list (network-address > (device "eno1") > (value "10=2E0=2E2=2E15/24")) > (network-address > (device "eno1") > (value "2001:123:4567:101::1")))) > (routes (list (network-route > (destination "default") > (gateway "10=2E0=2E2=2E2")) > (network-route > (destination "default") > (gateway "2020:321:4567:42::1")))) > (name-servers '("10=2E0=2E2=2E3")))) > >For the record, the =E2=80=98static-networking-service=E2=80=99 procedure= currently >in =E2=80=98master=E2=80=99 is IPv4-only and would not allow you to assig= n more >than one address to an interface anyway, among other limitations=2E >These long-overdue patches close an embarrassing gap=2E > >The interface provided here is a direct mapping of that of Guile-Netlink, >which is the same as that of the =E2=80=98ip=E2=80=99 command, itself clo= sely >modeled after Linux=E2=80=99s internal interfaces AIUI=2E Thus, it shoul= d be >roughly as expressive as =E2=80=98ip=E2=80=99, but declarative=2E > >I=E2=80=99m not a network person though, so I=E2=80=99d appreciate if mor= e >knowledgeable people would take a look at the interface=2E In particular= , >I=E2=80=99d like to have examples of =E2=80=98links=E2=80=99 to include i= n the manual=E2=80=94I=E2=80=99m not >quite sure how to use that=2E Ideas? > >This patches preserve backward-compatibility: the >=E2=80=98static-networking-service=E2=80=99 procedure still works the sam= e=2E There=E2=80=99s >one observable difference though: there=E2=80=99s only one =E2=80=98netwo= rking=E2=80=99 >Shepherd service now; you no longer get =E2=80=98networking-eno1=E2=80=99= and similar=2E >The =E2=80=98static-networking=E2=80=99 constructor was public since comm= it >c9436025a90b86047ba2203d58bbf238f8f9b2f9 but undocumented; thus I >changed the fields of without worrying about >compatibility=2E > >I tested this with: > > make check-system \ > TESTS=3D"static-networking openvswitch ganeti-kvm dhcpd childhurd" > >I would appreciate more testing, including tests on the bare metal >for IPv6 support=2E > >Ensuring portability to GNU/Hurd took me more time than I=E2=80=99d have >thought, but it works=2E =E2=80=9CLinks=E2=80=9D are not supported there= , and only >=E2=80=9Cdefault=E2=80=9D routes are supported=2E > >I took a detour in commit =E2=80=9CUse Guile-Netlink on GNU/Linux=E2=80= =9D: that >patch shows that I was blissfully hoping to use good=E2=80=99ol ioctls >on GNU/Hurd, but that turned out to be a dead end because they >don=E2=80=99t support IPv6 (which really isn=E2=80=99t a surprise but I d= on=E2=80=99t know, >I must have been lacking focus at that point of my journey!)=2E > >With all this I think we should be able to do =E2=80=9Ccool things with >containers=E2=80=9D, but again, that=E2=80=99s not my area of expertise s= o please >do chime in if you container networking is your thing=2E > >Feedback welcome! > >Ludo=E2=80=99=2E > >Ludovic Court=C3=A8s (10): > tests: Add 'static-networking' test=2E > tests: openvswitch: Check whether ovs0 is up=2E > doc: Add new "Networking Setup" node for the main setup options=2E > gnu: guile-netlink: Allow cross-compilation=2E > services: static-networking: Use Guile-Netlink on GNU/Linux=2E > services: secret-service: Turn into a Shepherd service=2E > services: static-networking: Change interface to mimic netlink=2E > services: Define '%qemu-static-networking'=2E > services: Define '%loopback-static-networking'=2E > tests: Replace uses of deprecated 'static-networking-service'=2E > > doc/guix=2Etexi | 505 ++++++++++++++++++++++---------- > gnu/build/hurd-boot=2Escm | 10 +- > gnu/build/secret-service=2Escm | 17 +- > gnu/packages/guile-xyz=2Escm | 11 +- > gnu/services/base=2Escm | 391 +++++++++++++++++++------ > gnu/services/virtualization=2Escm | 45 ++- > gnu/system/hurd=2Escm | 12 +- > gnu/system/install=2Escm | 5 +- > gnu/tests/ganeti=2Escm | 7 +- > gnu/tests/networking=2Escm | 141 ++++++++- > 10 files changed, 851 insertions(+), 293 deletions(-) > > >base-commit: 0a42998a50e8bbe9e49142b21a570db00efe7491 Looks good at first glance=2E I noticed a few typos in the manual, so I'll= send you more details after I read it more carefully=2E I'll try that on m= y hardware, although again I'm not sure how I can run reconfigure from my c= heckout exactly? (Where do I use sudo, and what options do I need) From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 20:58:53 2021 Received: (at 51440) by debbugs.gnu.org; 28 Oct 2021 00:58:53 +0000 Received: from localhost ([127.0.0.1]:50888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mftkq-00015M-Vh for submit@debbugs.gnu.org; Wed, 27 Oct 2021 20:58:53 -0400 Received: from lepiller.eu ([89.234.186.109]:36940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mftkp-00015D-0h for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 20:58:52 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id e15acafb; Thu, 28 Oct 2021 00:58:48 +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=/EUIKITexVC2 ThxcVa0sSXffZuDneMw+ryo4EVFiUIk=; b=gsVNfzgvUdtZrVM7aYGOf1cH3o04 l+xPzG3K0apnB/Hj2kNidmiiC+HfPEpy/4PYQm605nPu/vPkT+Wgw/v64XGMvaTm fY3menzoD1+QNBbm0iK8zHPg/y15ov1mK7hTZitpT/jS0Zo/US1gbxB6FbEw/Vuo 01MLt0o3R5iGkKB7X57MUojcN1O8dup06Y2cXiYzwObfCER7/ZvVk0IDx4p4mqdo rovR2IoFnuRgOa2FHkcXnbE1v69UQf8vAOnTx345dcq8jcV/kwo1zPVv9Us1UTqe yad7NC/pI5y7ujt11dn7EeyMMLukfM+zCVZoGZBPBziLoy8HBlJzn3cuwg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 88c0ddec (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 28 Oct 2021 00:58:47 +0000 (UTC) Date: Thu, 28 Oct 2021 02:58:40 +0200 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: [bug#51440] [PATCH 04/10] gnu: guile-netlink: Allow cross-compilation. Message-ID: <20211028025840.528e0b8e@tachikoma.lepiller.eu> In-Reply-To: <20211027140245.18970-4-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> <20211027140245.18970-4-ludo@gnu.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Wed, 27 Oct 2021 16:02:39 +0200, Ludovic Court=C3=A8s a =C3=A9crit : > * gnu/packages/guile-xyz.scm (guile-netlink)[arguments]: Add #:phases. > Remove unnecessary #:tests? #f. > [native-inputs]: Add GUILE-3.0. > --- > gnu/packages/guile-xyz.scm | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) >=20 > diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm > index 355b23f57e..daef8bbb26 100644 > --- a/gnu/packages/guile-xyz.scm > +++ b/gnu/packages/guile-xyz.scm > @@ -4854,13 +4854,22 @@ (define-public guile-netlink > "03zmsha2d7whlwb52gna83jdas9bqi18rq3sss7kkicv814qb35g")))) > (build-system gnu-build-system) > (arguments > - `(#:tests? #f)); no tests > + `(#:phases (modify-phases %standard-phases > + (add-before 'bootstrap 'set-guile-target > + (lambda* (#:key target #:allow-other-keys) > + (when target > + ;; Pass '--target=3DTRIPLET' to 'guild > compile'. > + (substitute* "guile.am" > + (("\\$\\(GUILD\\) compile") > + (string-append "$(GUILD) compile > --target=3D" > + target " "))))))))) > (inputs > `(("guile" ,guile-3.0))) > (native-inputs > `(("automake" ,automake) > ("autoconf" ,autoconf) > ("pkg-config" ,pkg-config) > + ("guile" ,guile-3.0) ;for 'guild compile' > + guile.m4 ("texinfo" ,texinfo))) > (home-page "https://git.lepiller.eu/guile-netlink") > (synopsis "Netlink protocol implementation for Guile") Is there anything I can do as the author of guile-netlink to allow cross-compilation? From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 27 21:17:59 2021 Received: (at 51440) by debbugs.gnu.org; 28 Oct 2021 01:17:59 +0000 Received: from localhost ([127.0.0.1]:50898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfu3K-0001cS-PC for submit@debbugs.gnu.org; Wed, 27 Oct 2021 21:17:59 -0400 Received: from lepiller.eu ([89.234.186.109]:36952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfu3A-0001c5-M1 for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 21:17:57 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 036a5636; Thu, 28 Oct 2021 01:17:43 +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=6IIo2hkiiShW 5REy+uZ7VpeeGlo53wC7jE3xuRmTsm4=; b=YZ2G80jvR6zXJMUu/+ivBe5tf+8S uNUv68kUbQ3jn2gJouS6tUCv7IROliU57QbWyYWwNPmcPhTCF5tnUtYP90rN28qZ SLmqGPsgof5QJZHcpMmv7z7mq6LGaMvelmfBre/Pr3DdjUYNB15vVgG7oN5W6AaX GYSapvntbTPImGcQlTMpa9YvNx4yD3T5ro62oY9SMvOB0d5RFzmnLA7cxk4vSYIh Me+SU3NPLHTSTJRQwavRJpVK9iMV8ZXaa8t8UAOXWzH5WPtNPkLA995E2tzkh9jC GwXHTpnVNzM85Pu5Zb0ic6VnnLOryEdfi19HMWsvjGenFYIIWEF7h0a8gg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id fa3db5fe (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 28 Oct 2021 01:17:43 +0000 (UTC) Date: Thu, 28 Oct 2021 03:17:38 +0200 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: [bug#51440] [PATCH 07/10] services: static-networking: Change interface to mimic netlink. Message-ID: <20211028031738.50dc8114@tachikoma.lepiller.eu> In-Reply-To: <20211027140245.18970-7-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> <20211027140245.18970-7-ludo@gnu.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) A few comments on the documentation below. Le Wed, 27 Oct 2021 16:02:42 +0200, Ludovic Court=C3=A8s a =C3=A9crit : > @lisp > -(static-networking-service "eno1" "192.168.1.82" > - #:gateway "192.168.1.2" > - #:name-servers '("192.168.1.2")) > +;; Network configuration for one NIC, IPv4 + IPv6. > +(static-networking > + (addresses (list (network-address > + (device "eno1") > + (value "10.0.2.15/24")) > + (network-address > + (device "eno1") > + (value "2001:123:4567:101::1")))) > + (routes (list (network-route > + (destination "default") > + (gateway "10.0.2.2")) > + (network-route > + (destination "default") > + (gateway "2020:321:4567:42::1")))) > + (name-servers '("10.0.2.3"))) > @end lisp I don't know if you tested that, but I think this is not routable because the IPv6 network doesn't have a netmask, so I think it defaults to a /128 (one IP in the network), so the router is not on the local network. Many ISPs provide a /64 (when the provide IPv6), so maybe use that as the netmask? > -@end deffn > + > +If you are familiar with the @command{ip} command of the > +@uref{https://wiki.linuxfoundation.org/networking/iproute2, > +@code{iproute2} package} found on Linux-based systems, the > declaration +above is equivalent to typing: > + > +@example > +ip address add 10.0.2.15/24 dev eno1 > +ip address add 2001:123:4567:101::1 dev eno1 > +ip route add default via inet 10.0.2.2 > +ip route add default via inet6 2020:321:4567:42::1 > +@end example And so, change it here too. > +Run @command{man 8 ip} for more info. Venerable GNU/Linux users will > +certainly know how to do it with @command{ifconfig} and > @command{route}, +but we'll spare you that. > + > +The available fields of this data type are as follows: > + > +@table @asis > +@item @code{addresses} > +@itemx @code{links} (default: @code{'()}) > +@itemx @code{links} (default: @code{'()}) One of them should be routes, right? > +@item @code{provision} (default: @code{#f}) > +If true, this should be a list of symbols for the Shepherd service > +corresponding to this network configuration. When @code{#f}, > +@code{'(networking)} or @code{'(loopback)} is used. Under which conditions is it 'loopback instead of 'networking? > +@item @code{requirement} (default @code{'()}) > +The list of Shepherd services depended on. > +@end table > +@end deftp The rest of the manual changes look good :) From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:38:45 2021 Received: (at 51440) by debbugs.gnu.org; 29 Oct 2021 21:38:45 +0000 Received: from localhost ([127.0.0.1]:56171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZaG-0006Jf-U7 for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:38:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZaF-0006JN-Dw for 51440@debbugs.gnu.org; Fri, 29 Oct 2021 17:38:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZa8-0004cU-TC; Fri, 29 Oct 2021 17:38:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=JuLvS/+i5UnlFyoF2iczrXEuLdxHrcUqycQwq4+sNtE=; b=YdzMButSSVW1/a1DyyH0 KzSAHqPGEMZMfyrpH/w5vidTD36OQg5ZmN0sK/+LCgVv7V5j8PfCvcFJrCXyKD84R4RfUolqHsb04 d+Ir3slQyx9cxjKvaPZ7Ee1FQ1vMHnZGtr5et4/fyn9gHoxUobRj2oacsDdKcz4cfT8r7blDLpU/7 yaWbRnEKTIqNlP5A5V9vPV0kwhZoiXWhuI/N/rHx6Wu8Hgl0Ov5w6Jf72D6Lpr6W8x63ERMq5e140 HzOFcprOi9jQQkKl6bsW7EwPWyV9s3XOBO1iS+sVJpJqTwq3rqVhSRnZGJt32OC2Mly39mz2GDjB4 0DdcZ+mxMwcesA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55466 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZa8-0002vQ-Eo; Fri, 29 Oct 2021 17:38:36 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027140245.18970-1-ludo@gnu.org> <20211027140245.18970-4-ludo@gnu.org> <20211028025840.528e0b8e@tachikoma.lepiller.eu> Date: Fri, 29 Oct 2021 23:38:35 +0200 In-Reply-To: <20211028025840.528e0b8e@tachikoma.lepiller.eu> (Julien Lepiller's message of "Thu, 28 Oct 2021 02:58:40 +0200") Message-ID: <874k8zy0is.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Julien Lepiller skribis: > Le Wed, 27 Oct 2021 16:02:39 +0200, > Ludovic Court=C3=A8s a =C3=A9crit : [...] >> + ;; Pass '--target=3DTRIPLET' to 'guild >> compile'. >> + (substitute* "guile.am" >> + (("\\$\\(GUILD\\) compile") >> + (string-append "$(GUILD) compile >> --target=3D" [...] > Is there anything I can do as the author of guile-netlink to allow > cross-compilation? Yes, please! Pass =E2=80=98--target=3D$(HOST)=E2=80=99 to =E2=80=98guild c= ompile=E2=80=99. See for example how guile-zstd does it. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:43:12 2021 Received: (at 51440) by debbugs.gnu.org; 29 Oct 2021 21:43:12 +0000 Received: from localhost ([127.0.0.1]:56181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZeZ-0006SF-Oh for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:43:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZeY-0006Rx-Dr for 51440@debbugs.gnu.org; Fri, 29 Oct 2021 17:43:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZeT-0008EE-1L; Fri, 29 Oct 2021 17:43:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=U14/aO7qWkZSAjCqVGtoR6BCbiXr7T05aa0K30grMV4=; b=OWz5fPpQmUHt0uJ4Fyot dZNbeu/G8TH0Hv5CFHQcuLzBO43wdugtKX39DclKsfcW+Rao2PfUNsi2F17JGWGlACD8kz1yJxD0J oTgA+dQ2XG1GZWHfOqK3XYV1U1IfoqvuYET4YgdSXxjgvn/l1AD8SBpXnEKTO15MTuTE7tbFG0WbP 4L+3W5qbAr4V58d6Pwiqds8rcefMOhjyXXWbtiwn6JVc8H/hV17tbGlUX+hshlCw/OdNcfugHrYqk ynfmGm0PSHT0XYZB4gRB5gXt8f8VQwXFpZsYNfubW6l/d2fjOnoEz9oe6G/X1J3Qi5Gf+EvOn3KoI GIBED2vw09zcYw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55470 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZeS-0003Jg-Gz; Fri, 29 Oct 2021 17:43:04 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027140245.18970-1-ludo@gnu.org> <20211027140245.18970-7-ludo@gnu.org> <20211028031738.50dc8114@tachikoma.lepiller.eu> Date: Fri, 29 Oct 2021 23:43:02 +0200 In-Reply-To: <20211028031738.50dc8114@tachikoma.lepiller.eu> (Julien Lepiller's message of "Thu, 28 Oct 2021 03:17:38 +0200") Message-ID: <87zgqrwlqx.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Julien Lepiller skribis: > A few comments on the documentation below. > > Le Wed, 27 Oct 2021 16:02:42 +0200, > Ludovic Court=C3=A8s a =C3=A9crit : > >> @lisp >> -(static-networking-service "eno1" "192.168.1.82" >> - #:gateway "192.168.1.2" >> - #:name-servers '("192.168.1.2")) >> +;; Network configuration for one NIC, IPv4 + IPv6. >> +(static-networking >> + (addresses (list (network-address >> + (device "eno1") >> + (value "10.0.2.15/24")) >> + (network-address >> + (device "eno1") >> + (value "2001:123:4567:101::1")))) >> + (routes (list (network-route >> + (destination "default") >> + (gateway "10.0.2.2")) >> + (network-route >> + (destination "default") >> + (gateway "2020:321:4567:42::1")))) >> + (name-servers '("10.0.2.3"))) >> @end lisp > > I don't know if you tested that, but I think this is not routable > because the IPv6 network doesn't have a netmask, so I think it defaults > to a /128 (one IP in the network), so the router is not on the local > network. Many ISPs provide a /64 (when the provide IPv6), so maybe use > that as the netmask? No I didn=E2=80=99t test it, so yes: let=E2=80=99s add /64 above. >> +ip address add 10.0.2.15/24 dev eno1 >> +ip address add 2001:123:4567:101::1 dev eno1 >> +ip route add default via inet 10.0.2.2 >> +ip route add default via inet6 2020:321:4567:42::1 >> +@end example > > And so, change it here too. Yes. >> +Run @command{man 8 ip} for more info. Venerable GNU/Linux users will >> +certainly know how to do it with @command{ifconfig} and >> @command{route}, +but we'll spare you that. >> + >> +The available fields of this data type are as follows: >> + >> +@table @asis >> +@item @code{addresses} >> +@itemx @code{links} (default: @code{'()}) >> +@itemx @code{links} (default: @code{'()}) > > One of them should be routes, right? Oops, yes. >> +@item @code{provision} (default: @code{#f}) >> +If true, this should be a list of symbols for the Shepherd service >> +corresponding to this network configuration. When @code{#f}, >> +@code{'(networking)} or @code{'(loopback)} is used. > > Under which conditions is it 'loopback instead of 'networking? Hmm that part is wrong: #f is equivalent to (networking) in practice. I=E2=80=99ll fix that. > The rest of the manual changes look good :) You mentioned on IRC veth pairs as an example use of links. Could you formalize it for inclusion as an example? Thanks for the careful review! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 29 17:44:35 2021 Received: (at 51440) by debbugs.gnu.org; 29 Oct 2021 21:44:35 +0000 Received: from localhost ([127.0.0.1]:56190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZfv-0006V6-K9 for submit@debbugs.gnu.org; Fri, 29 Oct 2021 17:44:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgZft-0006Us-R8 for 51440@debbugs.gnu.org; Fri, 29 Oct 2021 17:44:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZfo-0008Km-Iw; Fri, 29 Oct 2021 17:44:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=r4HN5c8mhj4LEknG23hjMrNTdQpe/cdkvOYNnMrJKmA=; b=jMYXp+Qm8uaHiDrQcjik sYRKHP5qAsp/uTj/OiE/8Xabg8AbZDzu1BfV66OR7zibR5KLQ0KPEVVKTvD/Ffjf8/PWhstITlEA7 db43SzyeMP5oYUPgtX0+ppU0VYL8ccr0EizNkHwhoXl3fCzPBFJS0058U4CivqWLmh3sTF0NBAsgq adP+9FGMhVPIsb43U3BcfmWKEerO340MjLgTI3rRg2q4DWgoyAQGKQ4Dw0BixCd5NUUQNRphGI1/r /wDwlyOR0Ovu/uWWd1Nc9qU3Bx9AdEcSAd/j8XET1K838xiqa5lnsfMBwTlGsa2da0oZQeEhAfHYK BKWxNFa0YiqHZA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55472 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgZfo-0003QC-6X; Fri, 29 Oct 2021 17:44:28 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Julien Lepiller Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <98B14704-7A97-4D5A-80CD-6A44DBAEFBC7@lepiller.eu> Date: Fri, 29 Oct 2021 23:44:26 +0200 In-Reply-To: <98B14704-7A97-4D5A-80CD-6A44DBAEFBC7@lepiller.eu> (Julien Lepiller's message of "Wed, 27 Oct 2021 11:29:47 -0400") Message-ID: <87v91fwlol.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Julien Lepiller skribis: > Looks good at first glance. I noticed a few typos in the manual, so I'll = send you more details after I read it more carefully. I'll try that on my h= ardware, although again I'm not sure how I can run reconfigure from my chec= kout exactly? (Where do I use sudo, and what options do I need) To reconfigure from a checkout, you can run: sudo -E ./pre-inst-env guix system reconfigure =E2=80=A6 where =E2=80=98-E=E2=80=99 tells sudo to preserve notably GUILE_LOAD_PATH &= co., such that Guile-Gcrypt and the other dependencies are found. HTH! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 03 10:14:39 2021 Received: (at 51440) by debbugs.gnu.org; 3 Nov 2021 14:14:39 +0000 Received: from localhost ([127.0.0.1]:40717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miH2E-0002Au-K8 for submit@debbugs.gnu.org; Wed, 03 Nov 2021 10:14:39 -0400 Received: from alita.triconium.com ([41.216.181.14]:41812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miGID-0000Rw-NC for 51440@debbugs.gnu.org; Wed, 03 Nov 2021 09:27:06 -0400 Received: by alita.triconium.com (Postfix, from userid 1000) id 476AB42044; Wed, 3 Nov 2021 09:27:04 -0400 (EDT) Date: Wed, 3 Nov 2021 09:27:04 -0400 From: David Aaron Fendley To: 51440@debbugs.gnu.org Subject: [PATCH 00/10] Declarative static networking interface Message-ID: <20211103132704.GA24459@triconium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51440 X-Mailman-Approved-At: Wed, 03 Nov 2021 10:14:38 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) If I have: (service static-networking-service-type (list (static-networking (addresses (list (network-address (device "eno33559296") (value "10.7.99.99/24")) (network-address (device "eno16780032") (value "10.10.199.98/24")))) (routes (list (network-route (destination "default") (gateway "10.10.199.1")) (network-route (destination "192.168.0.1/32") (gateway "10.10.199.1")))) (name-servers '("10.10.199.17" "10.10.101.2"))))) After reconfigure and restart of the networking service, no routes listed are created. Only the standard routes for each network: > ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet 127.0.0.1/0 scope global lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno16780032: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:50:56:98:d1:9f brd ff:ff:ff:ff:ff:ff inet 10.10.199.98/24 scope global eno16780032 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe98:d19f/64 scope link valid_lft forever preferred_lft forever 3: eno33559296: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:50:56:98:37:c2 brd ff:ff:ff:ff:ff:ff inet 10.7.99.99/24 scope global eno33559296 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe98:37c2/64 scope link valid_lft forever preferred_lft forever > ip r 10.7.99.0/24 dev eno33559296 proto kernel scope link src 10.7.99.99 10.10.199.0/24 dev eno16780032 proto kernel scope link src 10.10.199.98 If I then change the config to: (service static-networking-service-type (list (static-networking (addresses (list (network-address (device "eno33559296") (value "10.0.7.15/24")) (network-address (device "eno16780032") (value "10.10.2.15/24")))) (routes (list (network-route (destination "default") (gateway "10.0.2.2")))) (name-servers '("10.0.2.3"))))) After reconfigure and restart of the networking service, routes specified are still not created, and the addresses and routes are appended: > ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet 127.0.0.1/0 scope global lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno16780032: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:50:56:98:d1:9f brd ff:ff:ff:ff:ff:ff inet 10.10.199.98/24 scope global eno16780032 valid_lft forever preferred_lft forever inet 10.10.2.15/24 scope global eno16780032 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe98:d19f/64 scope link valid_lft forever preferred_lft forever 3: eno33559296: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:50:56:98:37:c2 brd ff:ff:ff:ff:ff:ff inet 10.7.99.99/24 scope global eno33559296 valid_lft forever preferred_lft forever inet 10.0.7.15/24 scope global eno33559296 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe98:37c2/64 scope link valid_lft forever preferred_lft forever > ip r 10.0.7.0/24 dev eno33559296 proto kernel scope link src 10.0.7.15 10.7.99.0/24 dev eno33559296 proto kernel scope link src 10.7.99.99 10.10.2.0/24 dev eno16780032 proto kernel scope link src 10.10.2.15 10.10.199.0/24 dev eno16780032 proto kernel scope link src 10.10.199.98 Expectation: Routes declared would be added and standard network routes would be removed if no longer relevant. Environment: These ten patches were applied on top of: 7af3b822178782d6598865e1d6a780a756dd0cb3 > guix describe Generation 2 Nov 02 2021 13:37:58 (current) guix 8d02b0d repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 8d02b0d46cfc27b905f9276760aefacf518ae4f7 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 11 17:08:52 2021 Received: (at 51440) by debbugs.gnu.org; 11 Nov 2021 22:08:53 +0000 Received: from localhost ([127.0.0.1]:42500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlIFY-0005mx-JU for submit@debbugs.gnu.org; Thu, 11 Nov 2021 17:08:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlIFT-0005md-I5 for 51440@debbugs.gnu.org; Thu, 11 Nov 2021 17:08:51 -0500 Received: from [2001:470:142:3::e] (port=46558 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlIFO-0001hG-06; Thu, 11 Nov 2021 17:08:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Mqena+G2rALlvCHSnUb6FzklWJefL1oDQ3MIawd/5RI=; b=qEJDSxjs1pkpfv/kPizT Aax1hPcyTpD5LZRGUaS6WAM6NvzeY7qlAPpZriu7UYCFLAUsq0V4v/jJUPru6kLyKMnC/zPXj8Hfl kl5zATaZMQKMDlrHNV+u1V4Ag93rQ8JQjYDQFs6RhGNUI8+vXWQwjJa7NoQnD0B/YgjLd9I2X5foe t2pRSvn9ElLRBIimS2VSnEL5/rtEH2XezP0nFybn9mnwr1ihZVor/L+Zu31nFaI7CvfIGbdLHFzpM PIAKY1Za6k3BgwGe8wGMr74k6vjnuSJbQtM4h1MTGsD82Mg9J7jm9rjEpGCXdrDrlyyXT+G+VQeWA Bh0phatnDkSP5w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55424 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlIFN-0001UB-NQ; Thu, 11 Nov 2021 17:08:41 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: David Aaron Fendley Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <20211103132704.GA24459@triconium.com> Date: Thu, 11 Nov 2021 23:08:39 +0100 In-Reply-To: <20211103132704.GA24459@triconium.com> (David Aaron Fendley's message of "Wed, 3 Nov 2021 09:27:04 -0400") Message-ID: <878rxufiqg.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi David, David Aaron Fendley skribis: > If I have: > > (service static-networking-service-type > (list (static-networking > (addresses (list (network-address > (device "eno33559296") > (value "10.7.99.99/24")) > (network-address > (device "eno16780032") > (value "10.10.199.98/24")))) > (routes (list (network-route > (destination "default") > (gateway "10.10.199.1")) > (network-route > (destination "192.168.0.1/32") > (gateway "10.10.199.1")))) > (name-servers '("10.10.199.17" "10.10.101.2"))))) > > After reconfigure and restart of the networking service, no routes > listed are created. Only the standard routes for each network: Hmm right, I need to investigate this one some more. Apparently the =E2=80=98route-add=E2=80=99 call leads to =E2=80=9CNetwork is unreachable= =E2=80=9D. [...] > If I then change the config to: > > (service static-networking-service-type > (list (static-networking > (addresses (list (network-address > (device "eno33559296") > (value "10.0.7.15/24")) > (network-address > (device "eno16780032") > (value "10.10.2.15/24")))) > (routes (list (network-route > (destination "default") > (gateway "10.0.2.2")))) > (name-servers '("10.0.2.3"))))) > > > > After reconfigure and restart of the networking service, routes > specified are still not created, and the addresses and routes are > appended: This one is fixed by the patch below: the =E2=80=98stop=E2=80=99 method of = the service would not actually load the =E2=80=9Ctear-down-network=E2=80=9D file, oops! Thanks a lot for testing and reporting! To be continued=E2=80=A6 Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 66683f153f..3123122200 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2511,7 +2511,7 @@ (define network-set-up/linux addresses) #$@(map (match-lambda (($ name type arguments) - #~(link-add #:device #$name #$type + #~(link-add #$name #$type #:type-args '#$arguments))) links) #$@(map (lambda (route) @@ -2530,7 +2530,7 @@ (define network-set-up/linux (define network-tear-down/linux (match-lambda (($ addresses links routes) - (scheme-file "set-up-network" + (scheme-file "tear-down-network" (with-extensions (list guile-netlink) #~(begin (use-modules (ip addr) (ip link) (ip route)) @@ -2579,10 +2579,10 @@ (define (static-networking-shepherd-service config) (network-set-up/hurd config)))))) (stop #~(lambda _ ;; Return #f is successfully stopped. - #$(let-system (system target) - (if (string-contains (or target system) "-linux") - (network-tear-down/linux config) - (network-tear-down/hurd config))))) + (load #$(let-system (system target) + (if (string-contains (or target system) "-linux") + (network-tear-down/linux config) + (network-tear-down/hurd config)))))) (respawn? #f)))))) (define (static-networking-shepherd-services networks) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 14 15:52:36 2021 Received: (at 51440) by debbugs.gnu.org; 14 Nov 2021 20:52:36 +0000 Received: from localhost ([127.0.0.1]:51869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmMUO-0007mh-6e for submit@debbugs.gnu.org; Sun, 14 Nov 2021 15:52:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmMUM-0007mT-Mz for 51440@debbugs.gnu.org; Sun, 14 Nov 2021 15:52:35 -0500 Received: from [2001:470:142:3::e] (port=37412 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmMUH-0003UI-3b; Sun, 14 Nov 2021 15:52:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=7jbkeKVutv3BYU4uZqMVir61NaohHTxad4mut0UPTFI=; b=qjp0egyrVmgjvtT5YmAh OYSL1T5zLEXoyqlmsyhH2yioZRRmyRoar8HvQYUNKDjsCwULPNmRLp26R/HYSz/UdzBlN/ofAC/UP JseeEUor9hzgatZWhOqXbHGTglXmalifN2CCfLVVYioKBm20jrJrrp6apb+4aiFRMGB2c1fzRINTR FgywQlCWj7MHSwqEB7ysjSJHF6t2ah5iaIjRYAFFpfzZu/fLcmEYXXnwqeu+elegDNbPIwGCe+B8q eG06B3v4rQN1r13/ZNFe57n3UTKuy4S897CtBo2EMlN+jQpVtkyGpi5VCBIRYY7wccFjVMwwlPEGw jzFNWTXjBukwAw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53376 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmMUG-0006o8-Rs; Sun, 14 Nov 2021 15:52:29 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: David Aaron Fendley Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <20211103132704.GA24459@triconium.com> <878rxufiqg.fsf_-_@gnu.org> Date: Sun, 14 Nov 2021 21:52:26 +0100 In-Reply-To: <878rxufiqg.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Thu, 11 Nov 2021 23:08:39 +0100") Message-ID: <8735nya29h.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: > David Aaron Fendley skribis: > >> If I have: >> >> (service static-networking-service-type >> (list (static-networking >> (addresses (list (network-address >> (device "eno33559296") >> (value "10.7.99.99/24")) >> (network-address >> (device "eno16780032") >> (value "10.10.199.98/24")))) >> (routes (list (network-route >> (destination "default") >> (gateway "10.10.199.1")) >> (network-route >> (destination "192.168.0.1/32") >> (gateway "10.10.199.1")))) >> (name-servers '("10.10.199.17" "10.10.101.2"))))) >> >> After reconfigure and restart of the networking service, no routes >> listed are created. Only the standard routes for each network: > > Hmm right, I need to investigate this one some more. Apparently the > =E2=80=98route-add=E2=80=99 call leads to =E2=80=9CNetwork is unreachable= =E2=80=9D. Julien has just fixed that: https://git.lepiller.eu/guile-netlink/commit/f5867cc920ea3703b11e257a6304= 3ac29153e34c Hopefully we=E2=80=99ll have a new Guile-Netlink release soon with this fix. :-) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:09 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:09 +0000 Received: from localhost ([127.0.0.1]:56420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVC-0003hg-Bq for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVA-0003gl-HI for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:00 -0500 Received: from [2001:470:142:3::e] (port=52016 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV4-0001yS-Up; Mon, 15 Nov 2021 17:30:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=LZLjxIIlgf1IdNnzBLbG3qrn1y5Z/awTGy01oaCGgYE=; b=OzGeefZb7fnxo6BrTj5s ojv6IzF9DOA6TxK1ZBduTZtoshRtxLuWLa0VSTFJt2bLoAX+VhPW6pZulrQdXOQuFSIOBZKzvv/LP jEO134nF8dyURCKku3W7zQ8obXRsYaMsd/VASFNe6bgy65uuALCSL1f6ycthEN04UW0qEeEFiyLDm 0RTxtTxRI85WeDDV5cgAKFhq9QAx5yE4GGrknfY6fRURNd2j3mgaMpOozSo3y3a9w8pIolfhQPQKS KugAiRdli0joQXSBuXUb050ZXOeoVSv34iRq74VcEZJkGXKnwluaxD53yA1xSdYboXNqX0OTNwfth OSiefyWIsK2xgg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV4-0001jO-Mn; Mon, 15 Nov 2021 17:30:54 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 00/10] Declarative static networking interface Date: Mon, 15 Nov 2021 23:30:34 +0100 Message-Id: <20211115223044.10943-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027135918.18833-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Changes since v1: • ‘herd stop networking’ fixed, as reported by David Aaron Fendley. • Guile-Netlink cross-compilation simplified thanks to changes in Guile-Netlink 1.1. • ‘provision’ field of defaults to '(networking), as suggested by Julien. • “network-tear-down” script wraps calls in ‘false-if-netlink-error’ to go as far as possible. • Documentation fixed as suggested by Julien. Thoughts? Test reports? :-) Note: It requires Guile-Netlink 1.1 as added in 46432cceebe392a1744980f370a48ef73afbac2c (it fixes another issue David reported earlier.) Ludo’. Ludovic Courtès (10): tests: Add 'static-networking' test. tests: openvswitch: Check whether ovs0 is up. doc: Add new "Networking Setup" node for the main setup options. gnu: guile-netlink: Allow cross-compilation. services: static-networking: Use Guile-Netlink on GNU/Linux. services: secret-service: Turn into a Shepherd service. services: static-networking: Change interface to mimic netlink. services: Define '%qemu-static-networking'. services: Define '%loopback-static-networking'. tests: Replace uses of deprecated 'static-networking-service'. doc/guix.texi | 504 ++++++++++++++++++++++---------- gnu/build/hurd-boot.scm | 10 +- gnu/build/secret-service.scm | 17 +- gnu/packages/guile-xyz.scm | 3 +- gnu/services/base.scm | 406 +++++++++++++++++++------ gnu/services/virtualization.scm | 45 ++- gnu/system/hurd.scm | 12 +- gnu/system/install.scm | 5 +- gnu/tests/ganeti.scm | 7 +- gnu/tests/networking.scm | 141 ++++++++- 10 files changed, 855 insertions(+), 295 deletions(-) base-commit: 21332f3b8cb8f407a89cdfe7d0460a9947675872 -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:13 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:13 +0000 Received: from localhost ([127.0.0.1]:56436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVJ-0003i2-Gq for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVB-0003gr-B3 for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:01 -0500 Received: from [2001:470:142:3::e] (port=52020 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV6-0001zn-4P; Mon, 15 Nov 2021 17:30:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=edqJOsScW5bI/S3HqRrJmuoSxiZ5+fBAqUe91M9zBi0=; b=HcBlaT/PT7AEI30x7nI5 tdxTWnTeu3S0+LyJ8EjqwPJ7FA1BPMiCQ+DLkiV3+gMu6WRJ12Pf5qJvtu4OiCzVgA8ureQ3KzqfF zv1Lw9J9F5E9/pTNNrkI1QOMS6uFjZVKJYeX0HRDA0SzNZAWmGxaJRXESHE4hqYNN2jfPCOAQr/lX C14IPzsTHVS0R3fnM+LgvpipQq+6jNSyI+tUayQAgFulJq+Q3qeDLyKecZb5HWgVKobyltL02vql2 FEfcX7Lw2fmY9SDMf63GPtWIxvAkUoklyh2PHV4GV0IFixPliFFQrEhzDBWr/NODssnypoAQRiH6j ukV1+Q0ZMQmz6A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV5-0001jO-T4; Mon, 15 Nov 2021 17:30:56 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 02/10] tests: openvswitch: Check whether ovs0 is up. Date: Mon, 15 Nov 2021 23:30:36 +0100 Message-Id: <20211115223044.10943-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/tests/networking.scm (run-openvswitch-test)["ovs0 is up"]: New test. --- gnu/tests/networking.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 5da1c91da6..131428c128 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -286,12 +286,15 @@ (define %openvswitch-os (define (run-openvswitch-test) (define os (marionette-operating-system %openvswitch-os - #:imported-modules '((gnu services herd)))) + #:imported-modules '((gnu services herd) + (guix build syscalls)))) (define test - (with-imported-modules '((gnu build marionette)) + (with-imported-modules '((gnu build marionette) + (guix build syscalls)) #~(begin (use-modules (gnu build marionette) + (guix build syscalls) (ice-9 popen) (ice-9 rdelim) (srfi srfi-64)) @@ -339,6 +342,18 @@ (define marionette (current-services)))) marionette)) + (test-equal "ovs0 is up" + IFF_UP + (marionette-eval + '(begin + (use-modules (guix build syscalls)) + + (let* ((sock (socket AF_INET SOCK_STREAM 0)) + (flags (network-interface-flags sock "ovs0"))) + (close-port sock) + (logand flags IFF_UP))) + marionette)) + (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:14 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:14 +0000 Received: from localhost ([127.0.0.1]:56438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVN-0003ij-CN for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVB-0003gs-W7 for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:08 -0500 Received: from [2001:470:142:3::e] (port=52022 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV6-0001zt-Oi; Mon, 15 Nov 2021 17:30:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=1ulVydhPC+iA4o2JRorEDWwfZMN2Oj2CVNOk9sCK3po=; b=XqU5McockVq0Z3UBTySw 1h+es0/tlgiBC2DT35SVOrS4NiGzxk/rZygSzgKFP2YgxVYmLWuGedXOB1hK8PBpEETQ2rygqBfgC eg91gAmlS/bsMVe3oMWbbLXlM7pxJq2L6lIAQK1mlFeCNWpLEbxhRMdP7K+Ub5d8ubKh1fe0WAeuH elp/iKksslN/3czKH2FEPM2q/KRi/uZZaLwRkQbUc5yS3OCJBxxGj1pAIEKAGgioS/D4nUlkzY1Sv 6x36d+yzivIxN5BBTiGr6583wAEhb1ogzNa6uTPihPW5xr4/qZvfT4hA+//YzfPtu7bfSjbEKn7xR 1Ucg0P6N0EcW4g==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV6-0001jO-GU; Mon, 15 Nov 2021 17:30:56 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 03/10] doc: Add new "Networking Setup" node for the main setup options. Date: Mon, 15 Nov 2021 23:30:37 +0100 Message-Id: <20211115223044.10943-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This should make it easier to find how to get started setting up networking. * doc/guix.texi (Networking Setup): New section. (Networking Services): Remove 'static-networking-service', 'dhcp-client-service-type', 'network-manager-service-type', 'connman-service-type', 'wicd-service', 'modem-manager-service-type', 'usb-modeswitch-service-type', and 'wpa-supplicant-service-type'. --- doc/guix.texi | 289 ++++++++++++++++++++++++++++---------------------- 1 file changed, 160 insertions(+), 129 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ea0c51d11a..399664b910 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -342,7 +342,8 @@ Services * Base Services:: Essential system services. * Scheduled Job Execution:: The mcron service. * Log Rotation:: The rottlog service. -* Networking Services:: Network setup, SSH daemon, etc. +* Networking Setup:: Setting up network interfaces. +* Networking Services:: Firewall, SSH daemon, etc. * Unattended Upgrades:: Automated system upgrades. * X Window:: Graphical display. * Printing Services:: Local and remote printer support. @@ -15534,7 +15535,8 @@ declaration. * Base Services:: Essential system services. * Scheduled Job Execution:: The mcron service. * Log Rotation:: The rottlog service. -* Networking Services:: Network setup, SSH daemon, etc. +* Networking Setup:: Setting up network interfaces. +* Networking Services:: Firewall, SSH daemon, etc. * Unattended Upgrades:: Automated system upgrades. * X Window:: Graphical display. * Printing Services:: Local and remote printer support. @@ -16756,63 +16758,26 @@ The list of syslog-controlled files to be rotated. By default it is: "/var/log/maillog")}. @end defvr -@node Networking Services -@subsection Networking Services +@node Networking Setup +@subsection Networking Setup -The @code{(gnu services networking)} module provides services to configure -the network interface. +The @code{(gnu services networking)} module provides services to +configure network interfaces and set up networking on your machine. +Those services provide different ways for you to set up your machine: by +declaring a static network configuration, by running a Dynamic Host +Configuration Protocol (DHCP) client, or by running daemons such as +NetworkManager and Connman that automate the whole process, +automatically adapt to connectivity changes, and provide a high-level +user interface. -@cindex DHCP, networking service -@defvr {Scheme Variable} dhcp-client-service-type -This is the type of services that run @var{dhcp}, a Dynamic Host Configuration -Protocol (DHCP) client, on all the non-loopback network interfaces. Its value -is the DHCP client package to use, @code{isc-dhcp} by default. -@end defvr +On a laptop, NetworkManager and Connman are by far the most convenient +options, which is why the default desktop services include +NetworkManager (@pxref{Desktop Services, @code{%desktop-services}}). +For a server, or for a virtual machine or a container, static network +configuration or a simple DHCP client are often more appropriate. -@deffn {Scheme Procedure} dhcpd-service-type -This type defines a service that runs a DHCP daemon. To create a -service of this type, you must supply a @code{}. -For example: - -@lisp -(service dhcpd-service-type - (dhcpd-configuration - (config-file (local-file "my-dhcpd.conf")) - (interfaces '("enp0s25")))) -@end lisp -@end deffn - -@deftp {Data Type} dhcpd-configuration -@table @asis -@item @code{package} (default: @code{isc-dhcp}) -The package that provides the DHCP daemon. This package is expected to -provide the daemon at @file{sbin/dhcpd} relative to its output -directory. The default package is the -@uref{https://www.isc.org/products/DHCP, ISC's DHCP server}. -@item @code{config-file} (default: @code{#f}) -The configuration file to use. This is required. It will be passed to -@code{dhcpd} via its @code{-cf} option. This may be any ``file-like'' -object (@pxref{G-Expressions, file-like objects}). See @code{man -dhcpd.conf} for details on the configuration file syntax. -@item @code{version} (default: @code{"4"}) -The DHCP version to use. The ISC DHCP server supports the values ``4'', -``6'', and ``4o6''. These correspond to the @code{dhcpd} program -options @code{-4}, @code{-6}, and @code{-4o6}. See @code{man dhcpd} for -details. -@item @code{run-directory} (default: @code{"/run/dhcpd"}) -The run directory to use. At service activation time, this directory -will be created if it does not exist. -@item @code{pid-file} (default: @code{"/run/dhcpd/dhcpd.pid"}) -The PID file to use. This corresponds to the @code{-pf} option of -@code{dhcpd}. See @code{man dhcpd} for details. -@item @code{interfaces} (default: @code{'()}) -The names of the network interfaces on which dhcpd should listen for -broadcasts. If this list is not empty, then its elements (which must be -strings) will be appended to the @code{dhcpd} invocation when starting -the daemon. It may not be necessary to explicitly specify any -interfaces here; see @code{man dhcpd} for details. -@end table -@end deftp +This section describes the various network setup services available, +starting with static network configuration. @defvr {Scheme Variable} static-networking-service-type This is the type for statically-configured network interfaces. @@ -16842,81 +16807,13 @@ For example: @end lisp @end deffn -@cindex wicd -@cindex wireless -@cindex WiFi -@cindex network management -@deffn {Scheme Procedure} wicd-service [#:wicd @var{wicd}] -Return a service that runs @url{https://launchpad.net/wicd,Wicd}, a network -management daemon that aims to simplify wired and wireless networking. - -This service adds the @var{wicd} package to the global profile, providing -several commands to interact with the daemon and configure networking: -@command{wicd-client}, a graphical user interface, and the @command{wicd-cli} -and @command{wicd-curses} user interfaces. -@end deffn - -@cindex ModemManager - -@defvr {Scheme Variable} modem-manager-service-type -This is the service type for the -@uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager} -service. The value for this service type is a -@code{modem-manager-configuration} record. - -This service is part of @code{%desktop-services} (@pxref{Desktop -Services}). +@cindex DHCP, networking service +@defvr {Scheme Variable} dhcp-client-service-type +This is the type of services that run @var{dhcp}, a Dynamic Host Configuration +Protocol (DHCP) client, on all the non-loopback network interfaces. Its value +is the DHCP client package to use, @code{isc-dhcp} by default. @end defvr -@deftp {Data Type} modem-manager-configuration -Data type representing the configuration of ModemManager. - -@table @asis -@item @code{modem-manager} (default: @code{modem-manager}) -The ModemManager package to use. - -@end table -@end deftp - -@cindex USB_ModeSwitch -@cindex Modeswitching - -@defvr {Scheme Variable} usb-modeswitch-service-type -This is the service type for the -@uref{https://www.draisberghof.de/usb_modeswitch/, USB_ModeSwitch} -service. The value for this service type is -a @code{usb-modeswitch-configuration} record. - -When plugged in, some USB modems (and other USB devices) initially present -themselves as a read-only storage medium and not as a modem. They need to be -@dfn{modeswitched} before they are usable. The USB_ModeSwitch service type -installs udev rules to automatically modeswitch these devices when they are -plugged in. - -This service is part of @code{%desktop-services} (@pxref{Desktop -Services}). -@end defvr - -@deftp {Data Type} usb-modeswitch-configuration -Data type representing the configuration of USB_ModeSwitch. - -@table @asis -@item @code{usb-modeswitch} (default: @code{usb-modeswitch}) -The USB_ModeSwitch package providing the binaries for modeswitching. - -@item @code{usb-modeswitch-data} (default: @code{usb-modeswitch-data}) -The package providing the device data and udev rules file used by -USB_ModeSwitch. - -@item @code{config-file} (default: @code{#~(string-append #$usb-modeswitch:dispatcher "/etc/usb_modeswitch.conf")}) -Which config file to use for the USB_ModeSwitch dispatcher. By default the -config file shipped with USB_ModeSwitch is used which disables logging to -@file{/var/log} among other default settings. If set to @code{#f}, no config -file is used. - -@end table -@end deftp - @cindex NetworkManager @defvr {Scheme Variable} network-manager-service-type @@ -17053,6 +16950,139 @@ List of additional command-line arguments to pass to the daemon. @end table @end deftp +@cindex wicd +@cindex wireless +@cindex WiFi +@cindex network management +@deffn {Scheme Procedure} wicd-service [#:wicd @var{wicd}] +Return a service that runs @url{https://launchpad.net/wicd,Wicd}, a network +management daemon that aims to simplify wired and wireless networking. + +This service adds the @var{wicd} package to the global profile, providing +several commands to interact with the daemon and configure networking: +@command{wicd-client}, a graphical user interface, and the @command{wicd-cli} +and @command{wicd-curses} user interfaces. +@end deffn + +@cindex ModemManager +Some networking devices such as modems require special care, and this is +what the services below focus on. + +@defvr {Scheme Variable} modem-manager-service-type +This is the service type for the +@uref{https://wiki.gnome.org/Projects/ModemManager, ModemManager} +service. The value for this service type is a +@code{modem-manager-configuration} record. + +This service is part of @code{%desktop-services} (@pxref{Desktop +Services}). +@end defvr + +@deftp {Data Type} modem-manager-configuration +Data type representing the configuration of ModemManager. + +@table @asis +@item @code{modem-manager} (default: @code{modem-manager}) +The ModemManager package to use. + +@end table +@end deftp + +@cindex USB_ModeSwitch +@cindex Modeswitching + +@defvr {Scheme Variable} usb-modeswitch-service-type +This is the service type for the +@uref{https://www.draisberghof.de/usb_modeswitch/, USB_ModeSwitch} +service. The value for this service type is +a @code{usb-modeswitch-configuration} record. + +When plugged in, some USB modems (and other USB devices) initially present +themselves as a read-only storage medium and not as a modem. They need to be +@dfn{modeswitched} before they are usable. The USB_ModeSwitch service type +installs udev rules to automatically modeswitch these devices when they are +plugged in. + +This service is part of @code{%desktop-services} (@pxref{Desktop +Services}). +@end defvr + +@deftp {Data Type} usb-modeswitch-configuration +Data type representing the configuration of USB_ModeSwitch. + +@table @asis +@item @code{usb-modeswitch} (default: @code{usb-modeswitch}) +The USB_ModeSwitch package providing the binaries for modeswitching. + +@item @code{usb-modeswitch-data} (default: @code{usb-modeswitch-data}) +The package providing the device data and udev rules file used by +USB_ModeSwitch. + +@item @code{config-file} (default: @code{#~(string-append #$usb-modeswitch:dispatcher "/etc/usb_modeswitch.conf")}) +Which config file to use for the USB_ModeSwitch dispatcher. By default the +config file shipped with USB_ModeSwitch is used which disables logging to +@file{/var/log} among other default settings. If set to @code{#f}, no config +file is used. + +@end table +@end deftp + + +@node Networking Services +@subsection Networking Services + +The @code{(gnu services networking)} module discussed in the previous +section provides services for more advanced setups: providing a DHCP +service for others to use, filtering packets with iptables or nftables, +running a WiFi access point with @command{hostapd}, running the +@command{inetd} ``superdaemon'', and more. This section describes +those. + +@deffn {Scheme Procedure} dhcpd-service-type +This type defines a service that runs a DHCP daemon. To create a +service of this type, you must supply a @code{}. +For example: + +@lisp +(service dhcpd-service-type + (dhcpd-configuration + (config-file (local-file "my-dhcpd.conf")) + (interfaces '("enp0s25")))) +@end lisp +@end deffn + +@deftp {Data Type} dhcpd-configuration +@table @asis +@item @code{package} (default: @code{isc-dhcp}) +The package that provides the DHCP daemon. This package is expected to +provide the daemon at @file{sbin/dhcpd} relative to its output +directory. The default package is the +@uref{https://www.isc.org/products/DHCP, ISC's DHCP server}. +@item @code{config-file} (default: @code{#f}) +The configuration file to use. This is required. It will be passed to +@code{dhcpd} via its @code{-cf} option. This may be any ``file-like'' +object (@pxref{G-Expressions, file-like objects}). See @code{man +dhcpd.conf} for details on the configuration file syntax. +@item @code{version} (default: @code{"4"}) +The DHCP version to use. The ISC DHCP server supports the values ``4'', +``6'', and ``4o6''. These correspond to the @code{dhcpd} program +options @code{-4}, @code{-6}, and @code{-4o6}. See @code{man dhcpd} for +details. +@item @code{run-directory} (default: @code{"/run/dhcpd"}) +The run directory to use. At service activation time, this directory +will be created if it does not exist. +@item @code{pid-file} (default: @code{"/run/dhcpd/dhcpd.pid"}) +The PID file to use. This corresponds to the @code{-pf} option of +@code{dhcpd}. See @code{man dhcpd} for details. +@item @code{interfaces} (default: @code{'()}) +The names of the network interfaces on which dhcpd should listen for +broadcasts. If this list is not empty, then its elements (which must be +strings) will be appended to the @code{dhcpd} invocation when starting +the daemon. It may not be necessary to explicitly specify any +interfaces here; see @code{man dhcpd} for details. +@end table +@end deftp + @cindex hostapd service, for Wi-Fi access points @cindex Wi-Fi access points, hostapd service @defvr {Scheme Variable} hostapd-service-type @@ -17115,6 +17145,7 @@ network that can be seen on @code{wlan0}, by default. The service's value is a @code{hostapd-configuration} record. @end defvr + @cindex iptables @defvr {Scheme Variable} iptables-service-type This is the service type to set up an iptables configuration. iptables is a -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:15 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:15 +0000 Received: from localhost ([127.0.0.1]:56440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVO-0003in-Hb for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVA-0003gm-On for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:10 -0500 Received: from [2001:470:142:3::e] (port=52018 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV5-0001zT-HZ; Mon, 15 Nov 2021 17:30:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=nIMYMSxGuVBBp0yBxrJ8NiTzp8VkdLuICWMDvMaM/7M=; b=Pr0GAbckkbi4q1dFVrlj Nw3NxtPdWIxRd0EOxV2yj/aRdMM9Bpuphfc9YNQ/YLd1Th09+SIEAKVMIpnXtiwJndvgd0b5eOGH3 sHDw2bspNSxi3+ynJmx7JyNo8kBgy5wOWUUfLg9VccK8K/g427VCII6KZcSSwBsAOfVUR7SBw+5mo 1YRfl1/QT3vO9eAlXf8W8NUq8oJZUnmBaRYBPLtK4H1bRTC9n8T2/Z4ZTJoNSeME2XrNLrMUKd35+ OBKNX3i1YXuclhFFaE30+GEQYZCnZFBQzC6u8c3dfG0bS+6Fn9ur1XD/uYRaKvZCZUKmIQD9NFrN/ ErU8yqF9bGlosg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV5-0001jO-9Y; Mon, 15 Nov 2021 17:30:55 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 01/10] tests: Add 'static-networking' test. Date: Mon, 15 Nov 2021 23:30:35 +0100 Message-Id: <20211115223044.10943-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/tests/networking.scm (run-static-networking-test): New procedure. (%test-static-networking): New variable. --- gnu/tests/networking.scm | 99 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 453e63f52d..5da1c91da6 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Chris Marusich ;;; Copyright © 2018 Arun Isaac ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,8 +38,102 @@ (define-module (gnu tests networking) #:use-module (gnu packages guile) #:use-module (gnu services shepherd) #:use-module (ice-9 match) - #:export (%test-inetd %test-openvswitch %test-dhcpd %test-tor %test-iptables - %test-ipfs)) + #:export (%test-static-networking + %test-inetd + %test-openvswitch + %test-dhcpd + %test-tor + %test-iptables + %test-ipfs)) + + +;;; +;;; Static networking. +;;; + +(define (run-static-networking-test vm) + (define test + (with-imported-modules '((gnu build marionette) + (guix build syscalls)) + #~(begin + (use-modules (gnu build marionette) + (guix build syscalls) + (srfi srfi-64)) + + (define marionette + (make-marionette + '(#$vm "-nic" "user,model=virtio-net-pci"))) + + (mkdir #$output) + (chdir #$output) + + (test-begin "static-networking") + + (test-assert "service is up" + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'networking)) + marionette)) + + (test-assert "network interfaces" + (marionette-eval + '(begin + (use-modules (guix build syscalls)) + (network-interface-names)) + marionette)) + + (test-equal "address of eth0" + "10.0.2.15" + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (addr (network-interface-address sock "eth0"))) + (close-port sock) + (inet-ntop (sockaddr:fam addr) (sockaddr:addr addr))) + marionette)) + + (test-equal "netmask of eth0" + "255.255.255.0" + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (mask (network-interface-netmask sock "eth0"))) + (close-port sock) + (inet-ntop (sockaddr:fam mask) (sockaddr:addr mask))) + marionette)) + + (test-equal "eth0 is up" + IFF_UP + (marionette-eval + '(let* ((sock (socket AF_INET SOCK_STREAM 0)) + (flags (network-interface-flags sock "eth0"))) + (logand flags IFF_UP)) + marionette)) + + (test-end) + + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "static-networking" test)) + +(define %test-static-networking + (system-test + (name "static-networking") + (description "Test the 'static-networking' service.") + (value + (let ((os (marionette-operating-system + (simple-operating-system + (static-networking-service "eth0" "10.0.2.15" + #:netmask "255.255.255.0" + #:gateway "10.0.2.2" + #:name-servers '("10.0.2.2"))) + #:imported-modules '((gnu services herd) + (guix combinators))))) + (run-static-networking-test (virtual-machine os)))))) + + +;;; +;;; Inetd. +;;; (define %inetd-os ;; Operating system with 2 inetd services. -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:16 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:16 +0000 Received: from localhost ([127.0.0.1]:56442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVQ-0003iw-7V for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVF-0003h3-9M for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:11 -0500 Received: from [2001:470:142:3::e] (port=52032 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkVA-00020Y-2x; Mon, 15 Nov 2021 17:31:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=RGZGk2T8KUz5/i5BnLz684J2l78w5TL3HmxXzTYaXOw=; b=fs/o1NNO78BsCbh6Q0br 66sSail2XXT6TmD4wYSGrYAK4nBfwLaI91iDRarqprCifggyt4tCDO1G/z3BpGcV9H1XNVNnIzTKz exsYBuIJoOx/ZoY8q6rJLOMyYidX+a4giEtnQA8r0Lv8juPRnBKKzcf37W5zhswWh5Y2NO//H3xUC JWcYKDgj6GgeDh5tODjaTiahK2fdKaO0cf5faJfG4K070oIBCJ3BVfe0Mndjgh/9sJxP4HxVB1yKP ovO0W7qtE2wCpTB1t3t+DPEGeNcj/4b5BeEvwjr2TqUI4bJsHnX4IDV8fa5ImAbpc/ZMo8Af6cZEd TQLsHWjj7cjt9g==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV9-0001jO-N3; Mon, 15 Nov 2021 17:31:00 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 08/10] services: Define '%qemu-static-networking'. Date: Mon, 15 Nov 2021 23:30:42 +0100 Message-Id: <20211115223044.10943-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (%qemu-static-networking): New variable. * gnu/system/hurd.scm (%base-services/hurd): Use it. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 8 ++++++++ gnu/services/base.scm | 16 ++++++++++++++++ gnu/system/hurd.scm | 21 ++++++--------------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 439ef28e96..85e76991d9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16940,6 +16940,14 @@ List of arguments for this type of link. @end table @end deftp +@cindex networking, with QEMU +@cindex QEMU, networking +@defvr {Scheme Variable} %qemu-static-networking +This is the @code{static-networking} record representing network setup +when using QEMU's user-mode network stack on @code{eth0} (@pxref{Using +the user mode network stack,,, QEMU, QEMU Documentation}). +@end defvr + @cindex DHCP, networking service @defvr {Scheme Variable} dhcp-client-service-type This is the type of services that run @var{dhcp}, a Dynamic Host Configuration diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 112c6ab065..e78add4e20 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -113,6 +113,8 @@ (define-module (gnu services base) static-networking-service static-networking-service-type + %qemu-static-networking + udev-configuration udev-configuration? udev-configuration-rules @@ -2669,6 +2671,20 @@ (define-deprecated (static-networking-service interface ip (provision (or provision '(networking))) (name-servers name-servers))))) +(define %qemu-static-networking + ;; Networking configuration for QEMU's user-mode network stack (info "(QEMU) + ;; Using the user mode network stack"). + (static-networking + (addresses (list (network-address + (device "eth0") + (value "10.0.2.15/24")))) + (routes (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (requirement '()) + (provision '(networking)) + (name-servers '("10.0.2.3")))) + (define %base-services ;; Convenience variable holding the basic services. diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 0e73ca0d99..ec8484d746 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -86,21 +86,12 @@ (define %base-services/hurd (value "127.0.0.1")))) (requirement '()) (provision '(loopback))) - (static-networking - (addresses - ;; The default QEMU guest address. To get "eth0", - ;; you need QEMU to emulate a device for which Mach - ;; has an in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - (list (network-address - (device "eth0") - (value "10.0.2.15/24")))) - (routes - (list (network-route - (destination "default") - (gateway "10.0.2.2")))) - (provision '(networking)) - (name-servers '("10.0.2.3"))))) + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) (syslog-service) (service guix-service-type (guix-configuration -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:17 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:17 +0000 Received: from localhost ([127.0.0.1]:56444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVQ-0003j5-OI for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVG-0003hG-Gm for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:12 -0500 Received: from [2001:470:142:3::e] (port=52036 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkVB-00020m-9p; Mon, 15 Nov 2021 17:31:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=f0T5dgslaHqaANUOThtzyqZWhOicRkOBGFHzUtH5IrY=; b=YjMU1aERlOUF5GJ5G7iZ Wm+mZUjIbij6B08cq7hrwlMEQvE+ynllyrnqItB2+qebFCT/SWfNV7hIl06SHvSjgPMmrxyOIkQry fveTEVHr5+tiX5VPUtS2OPBJAXt3KwhqAZME5ugCPlWNo4+rOrLuYzEWnYxhHnnCt4/cWKLRh2fnJ EZZGrt+AQ27Vhxj9cahxe56yDm8Tc0i7zYXF6AuiJpqOcVzcpkBitfUdiEIjueu6WIQ3iXkDsMTYW h6v43TZ/QE3TsB+aOiJgj3wwc9TLqca8pQx8+/Hx7v3bEGaT/gwa4IhpJAkKg5AzwqtMY2fK1VxuR nEC2dkH5cFoAKw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkVB-0001jO-1p; Mon, 15 Nov 2021 17:31:01 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 10/10] tests: Replace uses of deprecated 'static-networking-service'. Date: Mon, 15 Nov 2021 23:30:44 +0100 Message-Id: <20211115223044.10943-11-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/tests/ganeti.scm (%ganeti-os): Replace call to 'static-networking-service' by instantiating STATIC-NETWORKING-SERVICE-TYPE. * gnu/tests/networking.scm (%test-static-networking) (%openvswitch-os, %dhcpd-os): Likewise. --- gnu/tests/ganeti.scm | 7 ++----- gnu/tests/networking.scm | 29 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index 5ac2fd48dd..c29b885a5e 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -59,11 +59,8 @@ (define %ganeti-os (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) %base-packages)) (services - (append (list (static-networking-service "eth0" "10.0.2.15" - #:netmask "255.255.255.0" - #:gateway "10.0.2.2" - #:name-servers '("10.0.2.3")) - + (append (list (service static-networking-service-type + (list %qemu-static-networking)) (service openssh-service-type (openssh-configuration (permit-root-login 'prohibit-password))) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index c66af279f2..246e0a15fa 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -122,10 +122,8 @@ (define %test-static-networking (value (let ((os (marionette-operating-system (simple-operating-system - (static-networking-service "eth0" "10.0.2.15" - #:netmask "255.255.255.0" - #:gateway "10.0.2.2" - #:name-servers '("10.0.2.2"))) + (service static-networking-service-type + (list %qemu-static-networking))) #:imported-modules '((gnu services herd) (guix combinators))))) (run-static-networking-test (virtual-machine os)))))) @@ -275,9 +273,13 @@ (define openvswitch-configuration-service (define %openvswitch-os (operating-system (inherit (simple-operating-system - (static-networking-service "ovs0" "10.1.1.1" - #:netmask "255.255.255.252" - #:requirement '(openvswitch-configuration)) + (simple-service 'openswitch-networking + static-networking-service-type + (list (static-networking + (addresses (list (network-address + (value "10.1.1.1/24") + (device "ovs0")))) + (requirement '(openvswitch-configuration))))) (service openvswitch-service-type) openvswitch-configuration-service)) ;; Ensure the interface name does not change depending on the driver. @@ -392,10 +394,15 @@ (define dhcpd-v4-configuration (define %dhcpd-os (simple-operating-system - (static-networking-service "ens3" "192.168.1.4" - #:netmask "255.255.255.0" - #:gateway "192.168.1.1" - #:name-servers '("192.168.1.2" "192.168.1.3")) + (service static-networking-service-type + (list (static-networking + (addresses (list (network-address + (value "192.168.1.4/24") + (device "ens3")))) + (routes (list (network-route + (destination "default") + (gateway "192.168.1.1")))) + (name-servers '("192.168.1.2" "192.168.1.3"))))) (service dhcpd-service-type dhcpd-v4-configuration))) (define (run-dhcpd-test) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:19 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:19 +0000 Received: from localhost ([127.0.0.1]:56446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVR-0003jH-Ck for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVE-0003h1-Hz for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:12 -0500 Received: from [2001:470:142:3::e] (port=52030 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV9-00020R-BS; Mon, 15 Nov 2021 17:30:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=VsVK2SwpAc70beZ+U/Y1hbwkNhorT1sQEKZ7E6AjU/Q=; b=TLkvPxwlybn+AgFDlIHU zxYWnwjxKWNZPTKzKBH1ujsRdQYb+m+OtXRyLP/VXlVQ+CYjElVXpIRGX0FtxJ1opEzm38D20YkVH rfml0uRHM4S3zWOEqf976qZxNBeUoymbf3YNcWLzaNrJgRfp8+wLtnEUBUYRmOOC3CZ1EESxqPOtD KbM3L5ehcdAnaS2cIaSIj873dOSIu7IhMv7T8hwXB6yVHz+uYrd2xChWW1HHnMJxGF6R5t7MqmSvE vuDSIludy3YIguG1RpR3qxZuX1wgGSDraxq9ZlIki81sA4zPaI5LLwEUiJeCjhpjAU02iC12azwhk g69ajkeoAkXjeA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV9-0001jO-0N; Mon, 15 Nov 2021 17:30:59 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 07/10] services: static-networking: Change interface to mimic netlink. Date: Mon, 15 Nov 2021 23:30:41 +0100 Message-Id: <20211115223044.10943-8-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm ()[interface, ip, netmask] [gateway]: Remove. [addresses, links, routes]: New fields. [requirement]: Default to '(udev). (, , ): New record types. (ensure-no-separate-netmask, %ensure-no-separate-netmask): Remove. (ipv6-address?, cidr->netmask, ip+netmask->cidr) (network-set-up/hurd, network-tear-down/hurd) (network-set-up/linux, network-tear-down/linux) (static-networking->hurd-pfinet-options): New procedures. (static-networking-shepherd-service): New procedure. (static-networking-shepherd-services): Rewrite in terms of the above. (static-networking-service): Deprecate. Adjust to new 'static-networking' API. (%base-services): Likewise. * gnu/system/install.scm (%installation-services): Likewise. * gnu/system/hurd.scm (%base-services/hurd): Likewise, and separate 'loopback' from 'networking'. * gnu/build/hurd-boot.scm (set-hurd-device-translators): Remove "servers/socket/2". * gnu/tests/networking.scm (run-openvswitch-test)["networking has started on ovs0"]: Check for 'networking instead of 'networking-ovs0, which is no longer provided. * doc/guix.texi (Networking Setup): Document the new interface. Remove documentation of 'static-networking-service'. (Virtualization Services): Change Ganeti example to use the new interface. --- doc/guix.texi | 190 ++++++++++++++--- gnu/build/hurd-boot.scm | 10 +- gnu/services/base.scm | 425 +++++++++++++++++++++++++++------------ gnu/system/hurd.scm | 27 ++- gnu/system/install.scm | 11 +- gnu/tests/networking.scm | 2 +- 6 files changed, 494 insertions(+), 171 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 399664b910..439ef28e96 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16780,32 +16780,165 @@ This section describes the various network setup services available, starting with static network configuration. @defvr {Scheme Variable} static-networking-service-type -This is the type for statically-configured network interfaces. -@c TODO Document data structures. +This is the type for statically-configured network interfaces. Its +value must be a list of @code{static-networking} records. Each of them +declares a set of @dfn{addresses}, @dfn{routes}, and @dfn{links}, as +show below. + +@cindex network interface controller (NIC) +@cindex NIC, networking interface controller +Here is the simplest configuration, with only one network interface +controller (NIC) and only IPv4 connectivity: + +@example +;; Static networking for one NIC, IPv4-only. +(service static-networking-service-type + (list (static-networking + (addresses + (list (network-address + (device "eno1") + (value "10.0.2.15/24")))) + (routes + (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (name-servers '("10.0.2.3"))))) +@end example + +The snippet above can be added to the @code{services} field of your +operating system configuration (@pxref{Using the Configuration System}). +It will configure your machine to have 10.0.2.15 as its IP address, with +a 24-bit netmask for the local network---meaning that any 10.0.2.@var{x} +address is on the local area network (LAN). Traffic to addresses +outside the local network is routed @i{via} 10.0.2.2. Host names are +resolved by sending domain name system (DNS) queries to 10.0.2.3. @end defvr -@deffn {Scheme Procedure} static-networking-service @var{interface} @var{ip} @ - [#:netmask #f] [#:gateway #f] [#:name-servers @code{'()}] @ - [#:requirement @code{'(udev)}] -Return a service that starts @var{interface} with address @var{ip}. If -@var{netmask} is true, use it as the network mask. If @var{gateway} is true, -it must be a string specifying the default network gateway. @var{requirement} -can be used to declare a dependency on another service before configuring the -interface. +@deftp {Data Type} static-networking +This is the data type representing a static network configuration. -This procedure can be called several times, one for each network -interface of interest. Behind the scenes what it does is extend -@code{static-networking-service-type} with additional network interfaces -to handle. - -For example: +As an example, here is how you would declare the configuration of a +machine with a single network interface controller (NIC) available as +@code{eno1}, and with one IPv4 and one IPv6 address: @lisp -(static-networking-service "eno1" "192.168.1.82" - #:gateway "192.168.1.2" - #:name-servers '("192.168.1.2")) +;; Network configuration for one NIC, IPv4 + IPv6. +(static-networking + (addresses (list (network-address + (device "eno1") + (value "10.0.2.15/24")) + (network-address + (device "eno1") + (value "2001:123:4567:101::1/64")))) + (routes (list (network-route + (destination "default") + (gateway "10.0.2.2")) + (network-route + (destination "default") + (gateway "2020:321:4567:42::1")))) + (name-servers '("10.0.2.3"))) @end lisp -@end deffn + +If you are familiar with the @command{ip} command of the +@uref{https://wiki.linuxfoundation.org/networking/iproute2, +@code{iproute2} package} found on Linux-based systems, the declaration +above is equivalent to typing: + +@example +ip address add 10.0.2.15/24 dev eno1 +ip address add 2001:123:4567:101::1/64 dev eno1 +ip route add default via inet 10.0.2.2 +ip route add default via inet6 2020:321:4567:42::1 +@end example + +Run @command{man 8 ip} for more info. Venerable GNU/Linux users will +certainly know how to do it with @command{ifconfig} and @command{route}, +but we'll spare you that. + +The available fields of this data type are as follows: + +@table @asis +@item @code{addresses} +@itemx @code{links} (default: @code{'()}) +@itemx @code{routes} (default: @code{'()}) +The list of @code{network-address}, @code{network-link}, and +@code{network-route} records for this network (see below). + +@item @code{name-servers} (default: @code{'()}) +The list of IP addresses (strings) of domain name servers. These IP +addresses go to @file{/etc/resolv.conf}. + +@item @code{provision} (default: @code{'(networking)}) +If true, this should be a list of symbols for the Shepherd service +corresponding to this network configuration. + +@item @code{requirement} (default @code{'()}) +The list of Shepherd services depended on. +@end table +@end deftp + +@deftp {Data Type} network-address +This is the data type representing the IP address of a network +interface. + +@table @code +@item device +The name of the network interface for this address---e.g., +@code{"eno1"}. + +@item value +The actual IP address and network mask, in +@uref{https://en.wikipedia.org/wiki/CIDR#CIDR_notation, @acronym{CIDR, +Classless Inter-Domain Routing} notation}, as a string. + +For example, @code{"10.0.2.15/24"} denotes IPv4 address 10.0.2.15 on a +24-bit sub-network---all 10.0.2.@var{x} addresses are on the same local +network. + +@item ipv6? +Whether @code{value} denotes an IPv6 address. By default this is +automatically determined. +@end table +@end deftp + +@deftp {Data Type} network-route +This is the data type representing a network route. + +@table @asis +@item @code{destination} +The route destination (a string), either an IP address or +@code{"default"} to denote the default route. + +@item @code{source} (default: @code{#f}) +The route source. + +@item @code{device} (default: @code{#f}) +The device used for this route---e.g., @code{"eno2"}. + +@item @code{ipv6?} (default: auto) +Whether this is an IPv6 route. By default this is automatically +determined based on @code{destination} or @code{gateway}. + +@item @code{gateway} (default: @code{#f}) +IP address (a string) through which traffic is routed. +@end table +@end deftp + +@deftp {Data Type} network-link +Data type for a network link (@pxref{Link,,, guile-netlink, +Guile-Netlink Manual}). + +@table @code +@item name +The name of the link---e.g., @code{"v0p0"}. + +@item type +A symbol denoting the type of the link---e.g., @code{'veth}. + +@item arguments +List of arguments for this type of link. +@end table +@end deftp @cindex DHCP, networking service @defvr {Scheme Variable} dhcp-client-service-type @@ -30371,11 +30504,18 @@ cluster node that supports multiple storage backends, and installs the "ganeti-instance-guix" "ganeti-instance-debootstrap")) %base-packages)) (services - (append (list (static-networking-service "eth0" "192.168.1.201" - #:netmask "255.255.255.0" - #:gateway "192.168.1.254" - #:name-servers '("192.168.1.252" - "192.168.1.253")) + (append (list (service static-networking-service-type + (list (static-networking + (addresses + (list (network-address + (device "eth0") + (value "192.168.1.201/24")))) + (routes + (list (network-route + (destination "default") + (gateway "192.168.1.254")))) + (name-servers '("192.168.1.252" + "192.168.1.253"))))) ;; Ganeti uses SSH to communicate between nodes. (service openssh-service-type diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm index 8b27995438..ac36bd17d4 100644 --- a/gnu/build/hurd-boot.scm +++ b/gnu/build/hurd-boot.scm @@ -185,13 +185,9 @@ (define servers ("servers/crash-suspend" ("/hurd/crash" "--suspend")) ("servers/password" ("/hurd/password")) ("servers/socket/1" ("/hurd/pflocal")) - ("servers/socket/2" ("/hurd/pfinet" - "--interface" "eth0" - "--address" - "10.0.2.15" ;the default QEMU guest IP - "--netmask" "255.255.255.0" - "--gateway" "10.0.2.2" - "--ipv6" "/servers/socket/26")) + ;; /servers/socket/2 and /26 are created by 'static-networking-service'. + ;; XXX: Spawn pfinet without arguments on these nodes so that a DHCP + ;; client has someone to talk to? ("proc" ("/hurd/procfs" "--stat-mode=444")))) (define devices diff --git a/gnu/services/base.scm b/gnu/services/base.scm index d5ee03bbbd..112c6ab065 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -35,6 +35,8 @@ (define-module (gnu services base) #:use-module (guix store) #:use-module (guix deprecation) + #:autoload (guix diagnostics) (warning) + #:autoload (guix i18n) (G_) #:use-module (gnu services) #:use-module (gnu services admin) #:use-module (gnu services shepherd) @@ -54,6 +56,7 @@ (define-module (gnu services base) #:use-module ((gnu packages base) #:select (coreutils glibc glibc-utf8-locales)) #:autoload (gnu packages guile-xyz) (guile-netlink) + #:autoload (gnu packages hurd) (hurd) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (gnu packages linux) @@ -81,14 +84,32 @@ (define-module (gnu services base) virtual-terminal-service-type static-networking - static-networking? - static-networking-interface - static-networking-ip - static-networking-netmask - static-networking-gateway + static-networking-addresses + static-networking-links + static-networking-routes static-networking-requirement + network-address + network-address? + network-address-device + network-address-value + network-address-ipv6? + + network-link + network-link? + network-link-name + network-link-type + network-link-arguments + + network-route + network-route? + network-route-destination + network-route-source + network-route-device + network-route-ipv6? + network-route-gateway + static-networking-service static-networking-service-type @@ -2316,113 +2337,267 @@ (define kmscon-command (description "Start the @command{kmscon} virtual terminal emulator for the Linux @dfn{kernel mode setting} (KMS)."))) + +;;; +;;; Static networking. +;;; + +(define (ipv6-address? str) + "Return true if STR denotes an IPv6 address." + (false-if-exception (->bool (inet-pton AF_INET6 str)))) + (define-record-type* static-networking make-static-networking static-networking? - (interface static-networking-interface) - (ip static-networking-ip) - (netmask static-networking-netmask - (default #f)) - (gateway static-networking-gateway ;FIXME: doesn't belong here - (default #f)) + (addresses static-networking-addresses) ;list of + (links static-networking-links (default '())) ;list of + (routes static-networking-routes (default '())) ;list of (provision static-networking-provision - (default #f)) + (default '(networking))) (requirement static-networking-requirement - (default '())) + (default '(udev))) (name-servers static-networking-name-servers ;FIXME: doesn't belong here (default '()))) -(define static-networking-shepherd-service +(define-record-type* + network-address make-network-address + network-address? + (device network-address-device) ;string--e.g., "en01" + (value network-address-value) ;string--CIDR notation + (ipv6? network-address-ipv6? ;Boolean + (thunked) + (default + (ipv6-address? (cidr->ip (network-address-value this-record)))))) + +(define-record-type* + network-link make-network-link + network-link? + (name network-link-name) ;string--e.g, "v0p0" + (type network-link-type) ;symbol--e.g.,'veth + (arguments network-link-arguments)) ;list + +(define-record-type* + network-route make-network-route + network-route? + (destination network-route-destination) + (source network-route-source (default #f)) + (device network-route-device (default #f)) + (ipv6? network-route-ipv6? (thunked) + (default + (or (ipv6-address? (network-route-destination this-record)) + (and=> (network-route-gateway this-record) + ipv6-address?)))) + (gateway network-route-gateway (default #f))) + +(define* (cidr->netmask str #:optional (family AF_INET)) + "Given @var{str}, a string in CIDR notation (e.g., \"1.2.3.4/24\"), return +the netmask as a string like \"255.255.255.0\"." + (match (string-split str #\/) + ((ip (= string->number bits)) + (let ((mask (ash (- (expt 2 bits) 1) + (- (if (= family AF_INET6) 128 32) + bits)))) + (inet-ntop family mask))) + (_ #f))) + +(define (cidr->ip str) + "Strip the netmask bit of @var{str}, a CIDR-notation IP/netmask address." + (match (string-split str #\/) + ((or (ip _) (ip)) + ip))) + +(define* (ip+netmask->cidr ip netmask #:optional (family AF_INET)) + "Return the CIDR notation (a string) for @var{ip} and @var{netmask}, two +@var{family} address strings, where @var{family} is @code{AF_INET} or +@code{AF_INET6}." + (let* ((netmask (inet-pton family netmask)) + (bits (logcount netmask))) + (string-append ip "/" (number->string bits)))) + +(define (static-networking->hurd-pfinet-options config) + "Return command-line options for the Hurd's pfinet translator corresponding +to CONFIG." + (unless (null? (static-networking-links config)) + ;; XXX: Presumably this is not supported, or perhaps could be approximated + ;; by running separate pfinet instances in some cases? + (warning (G_ "network links are currently ignored on GNU/Hurd~%"))) + + (match (static-networking-addresses config) + ((and addresses (first _ ...)) + `("--ipv6" "/servers/socket/26" + "--interface" ,(network-address-device first) + ,@(append-map (lambda (address) + `(,(if (network-address-ipv6? address) + "--address6" + "--address") + ,(cidr->ip (network-address-value address)) + ,@(match (cidr->netmask (network-address-value address) + (if (network-address-ipv6? address) + AF_INET6 + AF_INET)) + (#f '()) + (mask (list "--netmask" mask))))) + addresses) + ,@(append-map (lambda (route) + (match route + (($ "default" #f device _ gateway) + (if (network-route-ipv6? route) + `("--gateway6" ,gateway) + `("--gateway" ,gateway))) + (($ destination) + (warning (G_ "ignoring network route for '~a'~%") + destination) + '()))) + (static-networking-routes config)))))) + +(define (network-set-up/hurd config) + "Set up networking for the Hurd." + ;; The Hurd implements SIOCGIFADDR and other old-style ioctls, but the only + ;; way to set up IPv6 is by starting pfinet with the right options. + (if (equal? (static-networking-provision config) '(loopback)) + (scheme-file "set-up-pflocal" #~(begin 'nothing-to-do! #t)) + (scheme-file "set-up-pfinet" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 format)) + + ;; TODO: Do that without forking. + (let ((options '#$(static-networking->hurd-pfinet-options + config))) + (format #t "starting '~a~{ ~s~}'~%" + #$(file-append hurd "/hurd/pfinet") + options) + (apply invoke #$(file-append hurd "/bin/settrans") "-fac" + "/servers/socket/2" + #$(file-append hurd "/hurd/pfinet") + options))))))) + +(define (network-tear-down/hurd config) + (scheme-file "tear-down-pfinet" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + ;; Forcefully terminate pfinet. XXX: In theory this + ;; should just undo the addresses and routes of CONFIG; + ;; this could be done using ioctls like SIOCDELRT, but + ;; these are IPv4-only; another option would be to use + ;; fsysopts but that seems to crash pfinet. + (invoke #$(file-append hurd "/bin/settrans") "-fg" + "/servers/socket/2") + #f)))) + +(define network-set-up/linux (match-lambda - (($ interface ip netmask gateway provision - requirement name-servers) + (($ addresses links routes) + (scheme-file "set-up-network" + (with-extensions (list guile-netlink) + #~(begin + (use-modules (ip addr) (ip link) (ip route)) + + #$@(map (lambda (address) + #~(begin + (addr-add #$(network-address-device address) + #$(network-address-value address) + #:ipv6? + #$(network-address-ipv6? address)) + ;; FIXME: loopback? + (link-set #$(network-address-device address) + #:up #t))) + addresses) + #$@(map (match-lambda + (($ name type arguments) + #~(link-add #$name #$type + #:type-args '#$arguments))) + links) + #$@(map (lambda (route) + #~(route-add #$(network-route-destination route) + #:device + #$(network-route-device route) + #:ipv6? + #$(network-route-ipv6? route) + #:via + #$(network-route-gateway route) + #:src + #$(network-route-source route))) + routes) + #t)))))) + +(define network-tear-down/linux + (match-lambda + (($ addresses links routes) + (scheme-file "tear-down-network" + (with-extensions (list guile-netlink) + #~(begin + (use-modules (ip addr) (ip link) (ip route) + (netlink error) + (srfi srfi-34)) + + (define-syntax-rule (false-if-netlink-error exp) + (guard (c ((netlink-error? c) #f)) + exp)) + + ;; Wrap calls in 'false-if-netlink-error' so this + ;; script goes as far as possible undoing the effects + ;; of "set-up-network". + + #$@(map (lambda (route) + #~(false-if-netlink-error + (route-del #$(network-route-destination route) + #:device + #$(network-route-device route) + #:ipv6? + #$(network-route-ipv6? route) + #:via + #$(network-route-gateway route) + #:src + #$(network-route-source route)))) + routes) + #$@(map (match-lambda + (($ name type arguments) + #~(false-if-netlink-error + (link-del #$name)))) + links) + #$@(map (lambda (address) + #~(false-if-netlink-error + (addr-del #$(network-address-device + address) + #$(network-address-value address) + #:ipv6? + #$(network-address-ipv6? address)))) + addresses) + #f)))))) + +(define (static-networking-shepherd-service config) + (match config + (($ addresses links routes + provision requirement name-servers) (let ((loopback? (and provision (memq 'loopback provision)))) - (define set-up-via-ioctl - #~(let* ((addr (inet-pton AF_INET #$ip)) - (sockaddr (make-socket-address AF_INET addr 0)) - (mask (and #$netmask (inet-pton AF_INET #$netmask))) - (maskaddr (and mask - (make-socket-address AF_INET mask 0))) - (gateway (and #$gateway - (inet-pton AF_INET #$gateway))) - (gatewayaddr (and gateway - (make-socket-address AF_INET - gateway 0)))) - (configure-network-interface #$interface sockaddr - (logior IFF_UP - #$(if loopback? - #~IFF_LOOPBACK - 0)) - #:netmask maskaddr) - (when gateway - (let ((sock (socket AF_INET SOCK_DGRAM 0))) - (add-network-route/gateway sock gatewayaddr) - (close-port sock))))) - - (define tear-down-via-ioctl - #~(let ((sock (socket AF_INET SOCK_STREAM 0))) - (when #$gateway - (delete-network-route sock - (make-socket-address AF_INET - INADDR_ANY 0))) - (set-network-interface-flags sock #$interface 0) - (close-port sock) - #f)) - - (define set-up-via-netlink - (with-extensions (list guile-netlink) - #~(let ((ip #$(if netmask - #~(ip+netmask->cidr #$ip #$netmask) - ip))) - (addr-add #$interface ip) - (when #$gateway - (route-add "default" #:device #$interface - #:via #$gateway)) - (link-set #$interface #:up #t)))) - - (define tear-down-via-netlink - (with-extensions (list guile-netlink) - #~(begin - (link-set #$interface #:down #t) - (when #$gateway - (route-del "default" #:device #$interface)) - (addr-del #$interface #$ip) - #f))) - - (define helpers - #~(define (ip+netmask->cidr ip netmask) - ;; Return the CIDR notation (a string) for IP and NETMASK, two - ;; IPv4 address strings. - (let* ((netmask (inet-pton AF_INET netmask)) - (bits (logcount netmask))) - (string-append ip "/" (number->string bits))))) - (shepherd-service (documentation "Bring up the networking interface using a static IP address.") (requirement requirement) - (provision (or provision - (list (symbol-append 'networking- - (string->symbol interface))))) + (provision provision) (start #~(lambda _ ;; Return #t if successfully started. - #$helpers - (if (string-contains %host-type "-linux") - #$set-up-via-netlink - #$set-up-via-ioctl))) + (load #$(let-system (system target) + (if (string-contains (or target system) "-linux") + (network-set-up/linux config) + (network-set-up/hurd config)))))) (stop #~(lambda _ ;; Return #f is successfully stopped. - (if (string-contains %host-type "-linux") - #$tear-down-via-netlink - #$tear-down-via-ioctl))) - (modules `((ip addr) - (ip link) - (ip route) - ,@%default-modules)) + (load #$(let-system (system target) + (if (string-contains (or target system) "-linux") + (network-tear-down/linux config) + (network-tear-down/hurd config)))))) (respawn? #f)))))) +(define (static-networking-shepherd-services networks) + (map static-networking-shepherd-service networks)) + (define (static-networking-etc-files interfaces) "Return a /etc/resolv.conf entry for INTERFACES or the empty list." (match (delete-duplicates @@ -2441,30 +2616,6 @@ (define (static-networking-etc-files interfaces) # Generated by 'static-networking-service'.\n" content)))))))) -(define (static-networking-shepherd-services interfaces) - "Return the list of Shepherd services to bring up INTERFACES, a list of - objects." - (define (loopback? service) - (memq 'loopback (shepherd-service-provision service))) - - (let ((services (map static-networking-shepherd-service interfaces))) - (match (remove loopback? services) - (() - ;; There's no interface other than 'loopback', so we assume that the - ;; 'networking' service will be provided by dhclient or similar. - services) - ((non-loopback ...) - ;; Assume we're providing all the interfaces, and thus, provide a - ;; 'networking' service. - (cons (shepherd-service - (provision '(networking)) - (requirement (append-map shepherd-service-provision - services)) - (start #~(const #t)) - (stop #~(const #f)) - (documentation "Bring up all the networking interfaces.")) - services))))) - (define static-networking-service-type ;; The service type for statically-defined network interfaces. (service-type (name 'static-networking) @@ -2482,12 +2633,13 @@ (define static-networking-service-type services of this type is a list of @code{static-networking} objects, one per network interface."))) -(define* (static-networking-service interface ip - #:key - netmask gateway provision - ;; Most interfaces require udev to be usable. - (requirement '(udev)) - (name-servers '())) +(define-deprecated (static-networking-service interface ip + #:key + netmask gateway provision + ;; Most interfaces require udev to be usable. + (requirement '(udev)) + (name-servers '())) + static-networking-service-type "Return a service that starts @var{interface} with address @var{ip}. If @var{netmask} is true, use it as the network mask. If @var{gateway} is true, it must be a string specifying the default network gateway. @@ -2498,11 +2650,24 @@ (define* (static-networking-service interface ip to handle." (simple-service 'static-network-interface static-networking-service-type - (list (static-networking (interface interface) (ip ip) - (netmask netmask) (gateway gateway) - (provision provision) - (requirement requirement) - (name-servers name-servers))))) + (list (static-networking + (addresses + (list (network-address + (device interface) + (value (if netmask + (ip+netmask->cidr ip netmask) + ip)) + (ipv6? #f)))) + (routes + (if gateway + (list (network-route + (destination "default") + (gateway gateway) + (ipv6? #f))) + '())) + (requirement requirement) + (provision (or provision '(networking))) + (name-servers name-servers))))) (define %base-services @@ -2534,10 +2699,12 @@ (define %base-services (tty "tty6"))) (service static-networking-service-type - (list (static-networking (interface "lo") - (ip "127.0.0.1") - (requirement '()) - (provision '(loopback))))) + (list (static-networking + (addresses (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback))))) (syslog-service) (service urandom-seed-service-type) (service guix-service-type) diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 0794671ce4..0e73ca0d99 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -79,11 +79,28 @@ (define %base-services/hurd (service hurd-getty-service-type (hurd-getty-configuration (tty "tty2"))) (service static-networking-service-type - (list (static-networking (interface "lo") - (ip "127.0.0.1") - (requirement '()) - (provision '(loopback networking)) - (name-servers '("10.0.2.3"))))) + (list (static-networking + (addresses + (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback))) + (static-networking + (addresses + ;; The default QEMU guest address. To get "eth0", + ;; you need QEMU to emulate a device for which Mach + ;; has an in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + (list (network-address + (device "eth0") + (value "10.0.2.15/24")))) + (routes + (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (provision '(networking)) + (name-servers '("10.0.2.3"))))) (syslog-service) (service guix-service-type (guix-configuration diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 7b394184ad..bdfe580145 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -408,10 +408,13 @@ (define bare-bones-os ;; Loopback device, needed by OpenSSH notably. (service static-networking-service-type - (list (static-networking (interface "lo") - (ip "127.0.0.1") - (requirement '()) - (provision '(loopback))))) + (list (static-networking + (addresses + (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback))))) (service wpa-supplicant-service-type) (dbus-service) diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm index 131428c128..c66af279f2 100644 --- a/gnu/tests/networking.scm +++ b/gnu/tests/networking.scm @@ -337,7 +337,7 @@ (define marionette (srfi srfi-1)) (live-service-running (find (lambda (live) - (memq 'networking-ovs0 + (memq 'networking (live-service-provision live))) (current-services)))) marionette)) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:19 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:19 +0000 Received: from localhost ([127.0.0.1]:56448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVT-0003jV-7b for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVG-0003hU-TQ for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:12 -0500 Received: from [2001:470:142:3::e] (port=52034 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkVA-00020f-MO; Mon, 15 Nov 2021 17:31:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=UIkbXTI2A46uLQe+s//tWj5frJIcM+VVSoLKmmhCNcE=; b=r0rBwvsKKqMTKl3hnI9F AyrwhGIReAJmEwnDJtdF536Xbse0Y8Vri9ooPEkR7p4jsqfZXGHiTn5BT65K90WXfQ9XGGPILTi2q 81Rb8a3qlojzlq54DfgR+37r1bOyBl8QbERKhByjsBKt+427UfdGJOUSqByzFJf2pEe7mr0S5QEZz yroXxNU+usjYhz8hytyw+cgYvN0IP98ZUBwabqDBQ6+5fCV+9M5J6Z6O0L1CK+cFGPnKuFQxx+TE0 QCQB2+f9iKagTRWT31bk/P7n4oNKwfpRt5aaVblGX758RnBF7mA5EhjNP6Ykdt22e0rrKSgOHNkrz Y8ZoVL8G6KAbXw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkVA-0001jO-EU; Mon, 15 Nov 2021 17:31:00 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 09/10] services: Define '%loopback-static-networking'. Date: Mon, 15 Nov 2021 23:30:43 +0100 Message-Id: <20211115223044.10943-10-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (%loopback-static-networking): New variable. (%base-services): Use it. * gnu/system/hurd.scm (%base-services/hurd): Use it. * gnu/system/install.scm (%installation-services): Use it. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 7 +++++++ gnu/services/base.scm | 17 +++++++++++------ gnu/system/hurd.scm | 8 +------- gnu/system/install.scm | 8 +------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 85e76991d9..2e72eb64d2 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16940,6 +16940,13 @@ List of arguments for this type of link. @end table @end deftp +@cindex loopback device +@defvr {Scheme Variable} %loopback-static-networking +This is the @code{static-networking} record representing the ``loopback +device'', @code{lo}, for IP addresses 127.0.0.1 and ::1, and providing +the @code{loopback} Shepherd service. +@end defvr + @cindex networking, with QEMU @cindex QEMU, networking @defvr {Scheme Variable} %qemu-static-networking diff --git a/gnu/services/base.scm b/gnu/services/base.scm index e78add4e20..d996a7b07c 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -113,6 +113,7 @@ (define-module (gnu services base) static-networking-service static-networking-service-type + %loopback-static-networking %qemu-static-networking udev-configuration @@ -2671,6 +2672,15 @@ (define-deprecated (static-networking-service interface ip (provision (or provision '(networking))) (name-servers name-servers))))) +(define %loopback-static-networking + ;; The loopback device. + (static-networking + (addresses (list (network-address + (device "lo") + (value "127.0.0.1")))) + (requirement '()) + (provision '(loopback)))) + (define %qemu-static-networking ;; Networking configuration for QEMU's user-mode network stack (info "(QEMU) ;; Using the user mode network stack"). @@ -2715,12 +2725,7 @@ (define %base-services (tty "tty6"))) (service static-networking-service-type - (list (static-networking - (addresses (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))))) + (list %loopback-static-networking)) (syslog-service) (service urandom-seed-service-type) (service guix-service-type) diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index ec8484d746..2acc7b7e11 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -79,13 +79,7 @@ (define %base-services/hurd (service hurd-getty-service-type (hurd-getty-configuration (tty "tty2"))) (service static-networking-service-type - (list (static-networking - (addresses - (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))) + (list %loopback-static-networking ;; QEMU user-mode networking. To get "eth0", you need ;; QEMU to emulate a device for which Mach has an diff --git a/gnu/system/install.scm b/gnu/system/install.scm index bdfe580145..073d7df1db 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -408,13 +408,7 @@ (define bare-bones-os ;; Loopback device, needed by OpenSSH notably. (service static-networking-service-type - (list (static-networking - (addresses - (list (network-address - (device "lo") - (value "127.0.0.1")))) - (requirement '()) - (provision '(loopback))))) + (list %loopback-static-networking)) (service wpa-supplicant-service-type) (dbus-service) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:35 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:35 +0000 Received: from localhost ([127.0.0.1]:56450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVY-0003jw-OC for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVC-0003gw-Oe for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:17 -0500 Received: from [2001:470:142:3::e] (port=52024 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV7-000202-BU; Mon, 15 Nov 2021 17:30:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=VCsKbkRYlQewCW3Fnn4DY4nZ9l1m//oFKWCUTLjvbOU=; b=rU1mbj7W7xpPUZL8m8VB EOs9O5Ad7xbfYMiNlf0xCG4nhkaMqgWETyUrsEAKG4hzzw5FHFdZakzS2CxLghv4a32D+ghpnSHj+ Tr7+BMUduCieZszMVsnWSH2EoM5ooB47Eo+fceCCxV75AjXlYDSiq/3egcfYGkwkmW7tQUq/ttfao kclw/zTZiC6Z+uBthabxcUoWwDvWQyuH+ZencqplkscAt4t9gPW3QVbqCN93dMfPCFPHWZQYSigsJ VhCUrARvMPjBdNo5ohP3ds8xpCORhROk43E4AI6nfmQxXWw83+ZDNrkXa3aVARn6t6InIf+4LVMgN mc01fQ3lPrR4/A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV7-0001jO-3i; Mon, 15 Nov 2021 17:30:57 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 04/10] gnu: guile-netlink: Allow cross-compilation. Date: Mon, 15 Nov 2021 23:30:38 +0100 Message-Id: <20211115223044.10943-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/guile-xyz.scm (guile-netlink)[arguments]: Remove, since #:tests? #f is unnecessary. [native-inputs]: Add GUILE-3.0. --- gnu/packages/guile-xyz.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 628d81710a..2751abc8e8 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -4777,14 +4777,13 @@ (define-public guile-netlink (base32 "1x1rx6agjdah56r50cfs41vyvycydyjdq0plq3jxgvl1q2dar1gw")))) (build-system gnu-build-system) - (arguments - `(#:tests? #f)); no tests (inputs `(("guile" ,guile-3.0))) (native-inputs `(("automake" ,automake) ("autoconf" ,autoconf) ("pkg-config" ,pkg-config) + ("guile" ,guile-3.0) ;for 'guild compile' + guile.m4 ("texinfo" ,texinfo))) (home-page "https://git.lepiller.eu/guile-netlink") (synopsis "Netlink protocol implementation for Guile") -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:35 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:35 +0000 Received: from localhost ([127.0.0.1]:56452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVj-0003k9-6E for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVD-0003h0-RE for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:19 -0500 Received: from [2001:470:142:3::e] (port=52028 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV8-00020I-KM; Mon, 15 Nov 2021 17:30:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=bcmo7xmK+6SxMv3uGAmGe4imHaZ1c5Pp8ko/UcmS2CM=; b=m6DhNfVqhClrWJyQSIWE b/f5S+EeYV/voc2ua+f7o79HVQy/W2Le4n3t6gI7DJiNfCrmAmszZwapeukQ/N3nRGS3TecN9T3nX 1SYDlUf8ZGzgPaApUghYx6vpKSzi3vuAfqQJ2hSjplMVtQ+ShvrMiD4SJ8MaUDG0e0P7kKBwelmOr qcl710LN0thv0EqZ+vByXEw0LX9DSJkhWD1iB6wOIxN9Dh2ZdEo7JkYpt+m5ALAZE19txqXKqAQQC H6zdXXFr7QSOZR0pAviieEltclqjrG6Ov41EhOkyHODsP6wwsjZgMG/xFAG3UrKLOe/sQbVTQ9gu9 DilnKFL4ZTqzsA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV8-0001jO-Cg; Mon, 15 Nov 2021 17:30:58 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 06/10] services: secret-service: Turn into a Shepherd service. Date: Mon, 15 Nov 2021 23:30:40 +0100 Message-Id: <20211115223044.10943-7-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/virtualization.scm (secret-service-activation): Remove. (secret-service-shepherd-services): New procedure. (secret-service-type)[extensions]: Remove ACTIVATION-SERVICE-TYPE extension. Add SHEPHERD-ROOT-SERVICE-TYPE and USER-PROCESSES-SERVICE-TYPE extensions. * gnu/build/secret-service.scm (delete-file*): New procedure. (secret-service-receive-secrets): Use it. --- gnu/build/secret-service.scm | 17 ++++++++++++- gnu/services/virtualization.scm | 45 ++++++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 13 deletions(-) diff --git a/gnu/build/secret-service.scm b/gnu/build/secret-service.scm index 46dcf1b9c3..4e183e11e8 100644 --- a/gnu/build/secret-service.scm +++ b/gnu/build/secret-service.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020 Ludovic Courtès +;;; Copyright © 2020, 2021 Ludovic Courtès ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. @@ -111,6 +111,15 @@ (define (send-files sock) (close-port sock) #f)))) +(define (delete-file* file) + "Ensure FILE does not exist." + (catch 'system-error + (lambda () + (delete-file file)) + (lambda args + (unless (= ENOENT (system-error-errno args)) + (apply throw args))))) + (define (secret-service-receive-secrets port) "Listen to local PORT and wait for a secret service client to send secrets. Write them to the file system. Return the list of files installed on success, @@ -170,6 +179,12 @@ (define (read-secrets port) (log "installing file '~a' (~a bytes)...~%" file size) (mkdir-p (dirname file)) + + ;; It could be that FILE already exists, for instance + ;; because it has been created by a service's activation + ;; snippet (e.g., SSH host keys). Delete it. + (delete-file* file) + (call-with-output-file file (lambda (output) (dump port output size) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index 1a5744ffbf..b1b10afed6 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -898,23 +898,44 @@ (define qemu-guest-agent-service-type ;;; Secrets for guest VMs. ;;; -(define (secret-service-activation port) - "Return an activation snippet that fetches sensitive material at local PORT, +(define (secret-service-shepherd-services port) + "Return a Shepherd service that fetches sensitive material at local PORT, over TCP. Reboot upon failure." - (with-imported-modules '((gnu build secret-service) - (guix build utils)) - #~(begin - (use-modules (gnu build secret-service)) - (let ((sent (secret-service-receive-secrets #$port))) - (unless sent - (sleep 3) - (reboot)))))) + ;; This is a Shepherd service, rather than an activation snippet, to make + ;; sure it is started once 'networking' is up so it can accept incoming + ;; connections. + (list + (shepherd-service + (documentation "Fetch secrets from the host at startup time.") + (provision '(secret-service-client)) + (requirement '(loopback networking)) + (modules '((gnu build secret-service) + (guix build utils))) + (start (with-imported-modules '((gnu build secret-service) + (guix build utils)) + #~(lambda () + ;; Since shepherd's output port goes to /dev/log, write this + ;; message to stderr so it's visible on the Mach console. + (format (current-error-port) + "receiving secrets from the host...~%") + (force-output (current-error-port)) + + (let ((sent (secret-service-receive-secrets #$port))) + (unless sent + (sleep 3) + (reboot)))))) + (stop #~(const #f))))) (define secret-service-type (service-type (name 'secret-service) - (extensions (list (service-extension activation-service-type - secret-service-activation))) + (extensions (list (service-extension shepherd-root-service-type + secret-service-shepherd-services) + + ;; Make every Shepherd service depend on + ;; 'secret-service-client'. + (service-extension user-processes-service-type + (const '(secret-service-client))))) (description "This service fetches secret key and other sensitive material over TCP at boot time. This service is meant to be used by virtual machines (VMs) that -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 15 17:31:35 2021 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:36 +0000 Received: from localhost ([127.0.0.1]:56454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVj-0003kI-IO for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVD-0003gx-7X for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:22 -0500 Received: from [2001:470:142:3::e] (port=52026 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkV7-00020B-VB; Mon, 15 Nov 2021 17:30:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=2PZSQcBi7QvaYFLybO/4hOkFPRVIn5uFYlqQuLwxpHI=; b=qdPCqn1R8doNIq5gSTeB OUp4O1QtCmLTmLDA+j0yNrUaEvADv0toB3swNGOQRzr45EL3tTZ7AfFox9Bs1nEGbUcaZM9tqqP1m ib3iO95aJ4+hFHXwAr68/nCgO1HYlXqfpZlBLQYweNO5mKVAkadBEK6iNZQQw7ZuoPzSRWizI4nCc Gj2Jgzd1RZQlLJxAiFECsUxmZGI49fNvmp0FWnizH6oElb8Pf4NRQQaraJv4X/8oo3Z1Ruz2TIhEN 4ZnbyhA9O8w6odof8i29lVy3IHVWRPqyK3sO08irlzeV0yU8PvzWcpTSSgDIydYIWquT4We6T8O8q DbgDO+yXP3FDyQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkV7-0001jO-NA; Mon, 15 Nov 2021 17:30:57 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: [PATCH v2 05/10] services: static-networking: Use Guile-Netlink on GNU/Linux. Date: Mon, 15 Nov 2021 23:30:39 +0100 Message-Id: <20211115223044.10943-6-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/services/base.scm (static-networking-shepherd-service): Define 'set-up-via-ioctl', 'tear-down-via-ioctl', 'set-up-via-netlink', 'tear-down-via-netlink', and 'helpers' and use them in 'start' and 'stop'. Add (ip *) modules to 'modules'. --- gnu/services/base.scm | 102 +++++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 30 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 50865055fe..d5ee03bbbd 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -53,6 +53,7 @@ (define-module (gnu services base) #:use-module (gnu packages bash) #:use-module ((gnu packages base) #:select (coreutils glibc glibc-utf8-locales)) + #:autoload (gnu packages guile-xyz) (guile-netlink) #:use-module (gnu packages package-management) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module (gnu packages linux) @@ -2336,6 +2337,66 @@ (define static-networking-shepherd-service (($ interface ip netmask gateway provision requirement name-servers) (let ((loopback? (and provision (memq 'loopback provision)))) + (define set-up-via-ioctl + #~(let* ((addr (inet-pton AF_INET #$ip)) + (sockaddr (make-socket-address AF_INET addr 0)) + (mask (and #$netmask (inet-pton AF_INET #$netmask))) + (maskaddr (and mask + (make-socket-address AF_INET mask 0))) + (gateway (and #$gateway + (inet-pton AF_INET #$gateway))) + (gatewayaddr (and gateway + (make-socket-address AF_INET + gateway 0)))) + (configure-network-interface #$interface sockaddr + (logior IFF_UP + #$(if loopback? + #~IFF_LOOPBACK + 0)) + #:netmask maskaddr) + (when gateway + (let ((sock (socket AF_INET SOCK_DGRAM 0))) + (add-network-route/gateway sock gatewayaddr) + (close-port sock))))) + + (define tear-down-via-ioctl + #~(let ((sock (socket AF_INET SOCK_STREAM 0))) + (when #$gateway + (delete-network-route sock + (make-socket-address AF_INET + INADDR_ANY 0))) + (set-network-interface-flags sock #$interface 0) + (close-port sock) + #f)) + + (define set-up-via-netlink + (with-extensions (list guile-netlink) + #~(let ((ip #$(if netmask + #~(ip+netmask->cidr #$ip #$netmask) + ip))) + (addr-add #$interface ip) + (when #$gateway + (route-add "default" #:device #$interface + #:via #$gateway)) + (link-set #$interface #:up #t)))) + + (define tear-down-via-netlink + (with-extensions (list guile-netlink) + #~(begin + (link-set #$interface #:down #t) + (when #$gateway + (route-del "default" #:device #$interface)) + (addr-del #$interface #$ip) + #f))) + + (define helpers + #~(define (ip+netmask->cidr ip netmask) + ;; Return the CIDR notation (a string) for IP and NETMASK, two + ;; IPv4 address strings. + (let* ((netmask (inet-pton AF_INET netmask)) + (bits (logcount netmask))) + (string-append ip "/" (number->string bits))))) + (shepherd-service (documentation @@ -2347,38 +2408,19 @@ (define static-networking-shepherd-service (start #~(lambda _ ;; Return #t if successfully started. - (let* ((addr (inet-pton AF_INET #$ip)) - (sockaddr (make-socket-address AF_INET addr 0)) - (mask (and #$netmask - (inet-pton AF_INET #$netmask))) - (maskaddr (and mask - (make-socket-address AF_INET - mask 0))) - (gateway (and #$gateway - (inet-pton AF_INET #$gateway))) - (gatewayaddr (and gateway - (make-socket-address AF_INET - gateway 0)))) - (configure-network-interface #$interface sockaddr - (logior IFF_UP - #$(if loopback? - #~IFF_LOOPBACK - 0)) - #:netmask maskaddr) - (when gateway - (let ((sock (socket AF_INET SOCK_DGRAM 0))) - (add-network-route/gateway sock gatewayaddr) - (close-port sock)))))) + #$helpers + (if (string-contains %host-type "-linux") + #$set-up-via-netlink + #$set-up-via-ioctl))) (stop #~(lambda _ ;; Return #f is successfully stopped. - (let ((sock (socket AF_INET SOCK_STREAM 0))) - (when #$gateway - (delete-network-route sock - (make-socket-address - AF_INET INADDR_ANY 0))) - (set-network-interface-flags sock #$interface 0) - (close-port sock) - #f))) + (if (string-contains %host-type "-linux") + #$tear-down-via-netlink + #$tear-down-via-ioctl))) + (modules `((ip addr) + (ip link) + (ip route) + ,@%default-modules)) (respawn? #f)))))) (define (static-networking-etc-files interfaces) -- 2.33.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 17 12:14:03 2021 Received: (at 51440) by debbugs.gnu.org; 17 Nov 2021 17:14:03 +0000 Received: from localhost ([127.0.0.1]:33741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnOVX-0007Bb-I3 for submit@debbugs.gnu.org; Wed, 17 Nov 2021 12:14:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnOVT-0007An-5j for 51440@debbugs.gnu.org; Wed, 17 Nov 2021 12:14:02 -0500 Received: from [2001:470:142:3::e] (port=40672 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnOVO-0005oT-05 for 51440@debbugs.gnu.org; Wed, 17 Nov 2021 12:13:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=3fkPHR1/HVKrLrEpsN0AnTj5eFCswYNasGtXVwSR/WM=; b=HOZBK74NGofXYdLkkodJ vDUPK/K3jfZYNXwS4hYDOEddmWDtOuiOt0i2E2Z/v9n/6AIauDNyLmdlQLLbVucVDkp+qEOsRFuUv N30YlLZNk+xDFV8WHRcU4lczoVdnfl4oMaF9TxluaItx5OXFwVvpK9pucNo5R7zEdCLZXOYsVyRtm qAmdkVljUBGCJTIonzs0It5okefViP9qBJAUhrXmci4ruz0NKuIuE9vrVoOx9vSvGYsCyLtrkWlsu W/xLhEs/XzN88KSiH2kTQ7UvLZmyO+0Zn03F89ZMjsoBReTNKFj6VnJQlVhalJWO4bnB8hB+nuaZv p0LxdbP/ccjSow==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:50673 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnOVN-0007k7-P5 for 51440@debbugs.gnu.org; Wed, 17 Nov 2021 12:13:53 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 51440@debbugs.gnu.org Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> Date: Wed, 17 Nov 2021 18:13:51 +0100 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cou?= =?utf-8?Q?rt=C3=A8s=22's?= message of "Mon, 15 Nov 2021 23:30:34 +0100") Message-ID: <87lf1mu2ls.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Ludovic Court=C3=A8s skribis: > tests: Add 'static-networking' test. > tests: openvswitch: Check whether ovs0 is up. > doc: Add new "Networking Setup" node for the main setup options. > gnu: guile-netlink: Allow cross-compilation. > services: static-networking: Use Guile-Netlink on GNU/Linux. > services: secret-service: Turn into a Shepherd service. > services: static-networking: Change interface to mimic netlink. > services: Define '%qemu-static-networking'. > services: Define '%loopback-static-networking'. > tests: Replace uses of deprecated 'static-networking-service'. I pushed this as =E2=80=98wip-networking-netlink=E2=80=99 to make it easier= for people to test with something like: guix time-machine --branch=3Dwip-networking-netlink -- \ reconfigure =E2=80=A6 Useful test scenarios: =E2=80=A2 You=E2=80=99re already using the =E2=80=98static-networking-ser= vice=E2=80=99 procedure; it=E2=80=99s now deprecated but you can reconfigure without changing your config file and check that networking works the same as before. =E2=80=A2 Using the new =E2=80=98static-networking=E2=80=99 records to de= fine your network, particularly with IPv6 connectivity, crazy routes, or anything that was not previously possible. Thanks in advance. :-) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 17 14:36:17 2021 Received: (at submit) by debbugs.gnu.org; 17 Nov 2021 19:36:17 +0000 Received: from localhost ([127.0.0.1]:33940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnQjB-0003kk-Bp for submit@debbugs.gnu.org; Wed, 17 Nov 2021 14:36:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:60958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnQjA-0003kd-LS for submit@debbugs.gnu.org; Wed, 17 Nov 2021 14:36:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnQjA-0008HL-Ft for guix-patches@gnu.org; Wed, 17 Nov 2021 14:36:16 -0500 Received: from mout.web.de ([217.72.192.78]:47669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnQj8-0007bZ-E8 for guix-patches@gnu.org; Wed, 17 Nov 2021 14:36:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1637177771; bh=VOfzDua+k7NdT5EwpTTbvP2DBwK9vWZIp3bqHb/hJy8=; h=X-UI-Sender-Class:Date:To:References:From:Subject:In-Reply-To; b=p+DpPuVFuGcASihpzUCHOnum8dIsQt56Hz2fO1L0Zzkk0mSn6B3tEZbJ87Ty5uVZZ jLatXCi8uvYT+P/vHEnWLU849T5ALeeqwJPVz6O8L1ks2y4qV4DGPUX3vhQN2ouW7X YQg9nHOME2izOGBy2p9DTN1l+UDcMoCQPEZvuiJw= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.23] ([77.189.21.119]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MxYX5-1mTOjq2Kq1-00xTvg for ; Wed, 17 Nov 2021 20:36:11 +0100 Message-ID: Date: Wed, 17 Nov 2021 20:36:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Content-Language: en-GB To: guix-patches@gnu.org References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-1-ludo@gnu.org> <87lf1mu2ls.fsf_-_@gnu.org> From: Jonathan Brielmaier Subject: Re: [bug#51440] [PATCH 00/10] Declarative static networking interface In-Reply-To: <87lf1mu2ls.fsf_-_@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/1RFU6XvojFiqXp6GmTg0oHrB2Uk0k61UAFfbWKUdvcxaNUBh/0 v3gGT1RGlypW+7eca/8wPXmcO1isr0vRhd+s70XtnqtfjW8UdiEo/Gh8tTo3pDoOqDHXGgz OfD1SSdi8+5C+D1lHJgQI5Rt5XrLckiwNCkO57cFN3uyZu+YQOhdjmardGaGSn4CLpPF0RF KNIoR1BtNayqVF1mVlfQg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Kno0fQArsOo=:zINTFCPRCfEedJduI62rxN 91cNJDVVFLz/Us3Ho2iR+ckqIQJgRwCGuYoCe5b9imDOS5A20O6J0gDy8giRdc1+drlmYsv4/ pqPPF5X/u0QcWZ5IhhSacT2/CfL7lofzChEQyPREjTs05q0NJppILrnCP7VLd1Gx13gcJ8jhQ Fyq16lDKIS6LNjIZPY2CjQ6Wo+mSvYaqEdlQdZK9zDs07XBflCNsO1/m9thOF0IM2lLGvhBqO WgJ9W6vOji4OWBSTzViNjLj0K41uO/7k43IySXkib6oaRlcvxCdjlnlboLONbOo31q1Hmy3wB TXPx+VThpRtJRFOPF4DaM5NV9lgpFni0jUP20D2n8Fls0+pzn/XhaD5HmsM9IbSDZONB/kXfW cDqwu0G7DHVLRxVbpLAk5VcdHrMaGVB6/fdG/eApt9bnpF5CLS8euK81Iq+h4k/d6fje52ldj J406lyTIUV4MN6JTrLR5+3ffQxlhcy3ckRfVw8m4u37PJxo0j9881hFCRRQxEIi0H/3ILQbfg Jekgnuw6CAuSYZfXaZDFKfIANFlmw6II6BMFzJ1rYXhQU+RUmE6bJMPV+PCg7ubJ8PEUba3H5 8OQCG0Uq+5sCbiKS1lqqzRHR4jXq/LNWqomTqBXZeLnAro2EHQxg5pfZj/w2lMJ8VWSJXZpY9 eB300RgaYB/HvuzFvcmfGVUJ3K2xe1HCCsqePKeKDoqNkspCrf8O6fXAjzVuBIt19IgyUWxNp doxNP/Qr/ZyyeyBS8qoLJLF3NfX1xFwGXNT3KmgYpOkl+DsZa2DDdCLFU21qtBJDa1YL04jlR bDcnQfUjBRIkyQyIRWn1CXUab33OTfJVKcajkG3vfu72VrPkTeWf6lN+TDQ7KqpeArQ01Udib udieeRAGm6X2kkLNucHCuE/enzG9xBLGx+liCU1lNhsxUWS1capTBPMraocjgn6yeqWd6Ar+/ xSx09F5tFWTk8UdIQgvVyNkCIIZCDQv5vRnjoUHPotlT2h88xtj9YZWq5Azr2WTvG6jwZjztI V/OmVhZHmWqO3ZGmrJt2TiVu2RMDs+Aygak2SpuId9ldgZ0hK7JYfa62aYHBOHbkDJdw0KA/J LvCgQjDkKy/ApuNYpSfBCs30JzrfwwHPq1AYHgu7c0cEWpCFwVzfthPALPK+ONE+8CExmeWtB XdkLjLm/EuTE98vL/19HlzfNNe Received-SPF: pass client-ip=217.72.192.78; envelope-from=jonathan.brielmaier@web.de; helo=mout.web.de X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.009, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.5 (--) On 17.11.21 18:13, Ludovic Court=C3=A8s wrote:> Useful test scenarios Mine is much simpler. I use GNOME and want to end the "war" between NetworkManager and dnsmasq. At the moment I only configured IPv4 as Vivien said in IRC that IPv6 is a bit broken. I stumbled across the missing `(list )` around `static-networking` in your example. In the doc/manual commit although its correct :) If one uses %desktop-services don't forget to remove network-manager-service-type... From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 17 14:36:27 2021 Received: (at 51440) by debbugs.gnu.org; 17 Nov 2021 19:36:27 +0000 Received: from localhost ([127.0.0.1]:33943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnQjL-0003lF-IY for submit@debbugs.gnu.org; Wed, 17 Nov 2021 14:36:27 -0500 Received: from planete-kraus.eu ([89.234.140.182]:38356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnQjI-0003l4-Jo for 51440@debbugs.gnu.org; Wed, 17 Nov 2021 14:36:26 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id fb6f2843 for <51440@debbugs.gnu.org>; Wed, 17 Nov 2021 19:36:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:date:content-type:mime-version :content-transfer-encoding; s=dkim; bh=ulYbq81AuZp78ugAfs86ADjci ME=; b=rxDN6sMbdkdgCEDSlwgmgoayPWGbyVO4n+jaYUufEQrWFv96ThImGQ88Z 9MMizLcMB5K7tY77ZUjT2QujVoE1YaH2Shmb4rVLRFPtDOQzc65j+SMdwCOBAMcC unTeXAVLM7TDzJGAfOK1dP+ihAZPybSoEQpvcPcWwRrPSbZbBg= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id a1c43a13 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO) for <51440@debbugs.gnu.org>; Wed, 17 Nov 2021 19:36:20 +0000 (UTC) Message-ID: Subject: Static IPv6 address is reversed! From: Vivien Kraus To: 51440@debbugs.gnu.org Date: Wed, 17 Nov 2021 19:36:20 +0000 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dear guix, The static networking service looks great, but when I tried to assign address 2a00:5881:4008:2810::309/64 to my interface, I end up (when looking at ip -6 address) with 903::1028:840:8158:2a/64. Since the bytes are reversed, I would look at guile-netlink and check if all byte orders are correct when using bytevectors :) g!inggbudey ppHa Vivien From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 10 05:51:51 2021 Received: (at 51440) by debbugs.gnu.org; 10 Dec 2021 10:51:51 +0000 Received: from localhost ([127.0.0.1]:45608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvdVH-0000ah-Dw for submit@debbugs.gnu.org; Fri, 10 Dec 2021 05:51:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvdVE-0000aQ-Bj for 51440@debbugs.gnu.org; Fri, 10 Dec 2021 05:51:50 -0500 Received: from [2001:470:142:3::e] (port=55110 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvdV8-0001cq-DF; Fri, 10 Dec 2021 05:51:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=GZ3XCIO8THkbOvjOsaup2UCYFUHMqhw7WpQ4pBxpApw=; b=MTvCsPYCc7/AQsv9ja+/ 1Y2Tw55mx20EesX19w6jwI+Bg5QfwTmKTafGtKIL8TkWMjepn64zHUIHOnboWYOR2/AUwjsVlhB+S LhG5TvCt53WztyupptEhxxboCDMEVYvTpjo8ETJwuHIvUBuVhJK01Hyugyc2mEgQjT2m06AhCkEiz 6jmxBPWRDnplTBL4TazysoW0LtU8yRs7AgO0ogtsQ6p+utCLhTxjbvmeB7ogbdx+w/i3SLP6VtS6G b3wQ3cL93dp6zow5t1pX3i1+dCmeQ/XdBxNlJQqFGzSftbZXEQgf0kRFF67wmumK+nCKg7LkxRyzs 6a+b0/X6wk1eCQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56992 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvdV8-0003q8-A4; Fri, 10 Dec 2021 05:51:42 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Vivien Kraus Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> Date: Fri, 10 Dec 2021 11:51:39 +0100 In-Reply-To: (Vivien Kraus's message of "Wed, 17 Nov 2021 19:36:20 +0000") Message-ID: <87y24sag1w.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) =E2=B9=81iH Vivien Kraus skribis: > The static networking service looks great, but when I tried to assign > address 2a00:5881:4008:2810::309/64 to my interface, I end up (when > looking at ip -6 address) with 903::1028:840:8158:2a/64. > > Since the bytes are reversed, I would look at guile-netlink and check > if all byte orders are correct when using bytevectors :) Julien fixed this interesting bug in Guile-Netlink 1.1.1, which is now in =E2=80=98master=E2=80=99 (thanks!). I rebased =E2=80=98wip-networking-netlink=E2=80=99 to get this fix. Could you give it another try? Any other issues left? If not, I think we could go ahead and merge it! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 11 07:56:19 2021 Received: (at 51440) by debbugs.gnu.org; 11 Dec 2021 12:56:19 +0000 Received: from localhost ([127.0.0.1]:48728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mw1vH-0004Go-DP for submit@debbugs.gnu.org; Sat, 11 Dec 2021 07:56:19 -0500 Received: from planete-kraus.eu ([89.234.140.182]:60268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mw1vE-0004Gd-Ol for 51440@debbugs.gnu.org; Sat, 11 Dec 2021 07:56:18 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 14a8dcda; Sat, 11 Dec 2021 12:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; s=dkim; bh=sJg8gnTwlC2eJjydxJVdKU4xA Uc=; b=RA11HsQ8VaJVKB8HIx3k7IUgglvsYOgXyBB3KDdjHfmQxaIa0nxhDOp13 PdxGy8KTy3neNopb8nGyDdnRtZfw9HF4kyggk19fyugYwkDI4unK8YF6BRPDCOq3 6468xlnv7pNjQ/jQfA43MMWtCvECOOIqMs1II6yV4iPhZGqphQ= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id e213e6c2 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Sat, 11 Dec 2021 12:56:11 +0000 (UTC) Message-ID: Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface From: Vivien Kraus To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sat, 11 Dec 2021 13:56:10 +0100 In-Reply-To: <87y24sag1w.fsf_-_@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-jextAJ/SvTE7YgUQ6X+N" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-jextAJ/SvTE7YgUQ6X+N Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Le vendredi 10 d=C3=A9cembre 2021 =C3=A0 11:51 +0100, Ludovic Court=C3=A8s = a =C3=A9crit=C2=A0: > Vivien Kraus skribis: >=20 > > The static networking service looks great, but when I tried to assign > > address 2a00:5881:4008:2810::309/64 to my interface, I end up (when > > looking at ip -6 address) with 903::1028:840:8158:2a/64. > >=20 > > Since the bytes are reversed, I would look at guile-netlink and check > > if all byte orders are correct when using bytevectors :) >=20 > Julien fixed this interesting bug in Guile-Netlink 1.1.1, which is now > in =E2=80=98master=E2=80=99 (thanks!). >=20 > I rebased =E2=80=98wip-networking-netlink=E2=80=99 to get this fix. >=20 > Could you give it another try? The IP seems good. > Any other issues left? I have a couple: - I get an extra IPv6 (inet6 xxxx/64 scope global dynamic mngtmpaddr valid_lft forever preferred_lft forever) that I did not ask for and that takes precedence as a source for the default route, which defeats the purpose. I=E2=80=99m not sure it=E2=80=99s guile-netlink=E2=80=99s faul= t. - Now opensmtpd fails to start with:=20 Dec 11 12:01:32 localhost smtpd[5368]: info: OpenSMTPD 6.8.0p2 starting Dec 11 12:01:32 localhost smtpd[5373]: pony express: listen: Address already in use Dec 11 12:01:32 localhost smtpd[5369]: smtpd: process ca socket closed Maybe it=E2=80=99s unrelated, but that=E2=80=99s a problem for me. Vivien --=-jextAJ/SvTE7YgUQ6X+N Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEq4yIHjMvkliPpwQnO7C8EjLYuCwFAmG0n+oACgkQO7C8EjLY uCxeiwv/Trb1VGONkAe0e/njsVGzhKl1t5O8mNcAMc5YUR8p+QRZuSLiwfCYg2WV 66PW5kKVCrxVyhDqyVGarMQIRFbE9ccxFR5tiQW1n7Kp2sLOK8zwsbP5+DTsfGcq 0ydlN0YrgiQ2ukPOlZqjEctcDkk++Jl4Nnqf/ai2LLfExZ6OjuY+6/pPtsvfPQDb 3GdFRe+sPs7rYnqHPHwJfP7Q9A1PYx/V9AnizhKhhYYfWERVFX2iWhIG/KbvF2/P QMRUwd+twlMUNjrBxESwGDyR3d6ydeqTCLhUf1gUYBoAE3fBlDzZK8Ez71oa40S/ HiyJisuR5ZYeGwNDi4Qu8oHth65DTUlBWqJG+/3+HB35DhYquX8o0lrShOwTdvx9 HwM9uDFdyvPDDDsroJ67013XSw5sNY2D9gJqvFPrMuGgfWVOdpHFim/Jan8rx7GE /nTs2gnmS5Bix2JXAJp8Zn5H6B7BIr1Jplg9XCLLBK9ljBXOdcKUqnFrYtMZHkrs qugpSGm0 =3sqj -----END PGP SIGNATURE----- --=-jextAJ/SvTE7YgUQ6X+N-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 11 16:39:32 2021 Received: (at 51440) by debbugs.gnu.org; 11 Dec 2021 21:39:32 +0000 Received: from localhost ([127.0.0.1]:50177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwA5c-0002gT-91 for submit@debbugs.gnu.org; Sat, 11 Dec 2021 16:39:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwA5a-0002gF-NK for 51440@debbugs.gnu.org; Sat, 11 Dec 2021 16:39:31 -0500 Received: from [2001:470:142:3::e] (port=40176 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwA5S-000061-Fv; Sat, 11 Dec 2021 16:39:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=ptw7m7I2nYxAd5EXtIfJ3Soq/cdW0VZ4iNum7dgCgWE=; b=a2M8ciO5Hkp0cZx6pr2T eEB4RS4Gzt8FWxoCh0zxjjIfnysDOLsFbbP/Tk251RAFIO3uL7gWKIfwrZ3ytdhbSAxTcjFPTh2NE HyhbarNkag/dxQ2H7iPyYVUozlnJMuvQdaun1ol09Et0Q9uiPenXGNCZgDSV2RFDkhNmiHKfzsQJZ L5C5pro8t4S51g3LK5QlaxUD03z1hIXzQWAHGUpu6IFnJHr5VnMiQeSUIRccm5d1Q56kMKjMt1whd jqeYXYO5+UjUzgKJs74CpA07Q3zsHMvuozweOfYREid3ck9dZ/P0CZPzU5DC5vLFYwg58fPjrXEUq YahOnx8mXqSNJg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:61202 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwA5S-0007wd-E2; Sat, 11 Dec 2021 16:39:22 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Vivien Kraus Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> Date: Sat, 11 Dec 2021 22:39:19 +0100 In-Reply-To: (Vivien Kraus's message of "Sat, 11 Dec 2021 13:56:10 +0100") Message-ID: <87fsqy6cu0.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: Julien Lepiller , 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Vivien, Vivien Kraus skribis: > Le vendredi 10 d=C3=A9cembre 2021 =C3=A0 11:51 +0100, Ludovic Court=C3=A8= s a =C3=A9crit=C2=A0: >> Vivien Kraus skribis: [...] >> Julien fixed this interesting bug in Guile-Netlink 1.1.1, which is now >> in =E2=80=98master=E2=80=99 (thanks!). >>=20 >> I rebased =E2=80=98wip-networking-netlink=E2=80=99 to get this fix. >>=20 >> Could you give it another try? > > The IP seems good. \o/ >> Any other issues left? > > I have a couple: > - I get an extra IPv6 (inet6 xxxx/64 scope global dynamic mngtmpaddr > valid_lft forever preferred_lft forever) that I did not ask for and > that takes precedence as a source for the default route, which defeats > the purpose. I=E2=80=99m not sure it=E2=80=99s guile-netlink=E2=80=99s fa= ult. Hmm, what=E2=80=99s that IPv6 address? Is it here even if you do not confi= gure any IPv6 address in =E2=80=98static-networking=E2=80=99? Julien, could the =E2=80=98link-set=E2=80=99 call in =E2=80=98network-set-u= p/linux=E2=80=99 be the culprit? #$@(map (lambda (address) #~(begin (addr-add #$(network-address-device address) #$(network-address-value address) #:ipv6? #$(network-address-ipv6? address)) ;; FIXME: loopback? (link-set #$(network-address-device address) #:up #t))) addresses) It seems to be the only way to mark the device as =E2=80=9Cup=E2=80=9D, but= since it has arguments that seem redundant with those of =E2=80=98addr-add=E2=80=99, I w= onder if something could go wrong here. Thanks for testing, Vivien! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 11 18:29:39 2021 Received: (at 51440) by debbugs.gnu.org; 11 Dec 2021 23:29:39 +0000 Received: from localhost ([127.0.0.1]:50264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwBoB-0005Jz-4a for submit@debbugs.gnu.org; Sat, 11 Dec 2021 18:29:39 -0500 Received: from lepiller.eu ([89.234.186.109]:36364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwBo8-0005Jo-Mo for 51440@debbugs.gnu.org; Sat, 11 Dec 2021 18:29:37 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 6d1798ec; Sat, 11 Dec 2021 23:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=/A+xkKgF57EN lD4NtzQRABQRSD4jlvFEpwlEFX76cKo=; b=eNPn9bmMW7mSOXMnw4MGvTohckOR aUd5+AvOBpkANlzcxX5W9nhlFZlrJNSanKo6pagN4UHU+rJJ+0R70e4pR/32HjVQ 2a6SWuamqP9j0+mzgwpYDehEd8Y9TtngK3sKGDPU7aWfrES5V2irGzpirg6/4M5U dgXqilvH8I6gpBTFuage1Y0d1aayM1n2fXqpAiWBs1OueuLziV/tp+6kywpufhm2 ESctEG+Eor5pRDIbxw5fYFrUNnku3949zNuBzdihs4vqNwdhI19NEhzo0xgxk20H 8q9omdzAs1yXuuBhRGCg2ldvoZa6MrE/mz6C2muqUQbnGy4Ga5Iiaop/Dg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 0ccc58c0 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 11 Dec 2021 23:29:32 +0000 (UTC) Date: Sat, 11 Dec 2021 17:19:24 -0500 From: Julien Lepiller To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= , Vivien Kraus Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface User-Agent: K-9 Mail for Android In-Reply-To: <87fsqy6cu0.fsf_-_@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> Message-ID: <2E9D7B32-584F-4DDD-B040-D84888F34EF4@lepiller.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le 11 d=C3=A9cembre 2021 16:39:19 GMT-05:00, "Ludovic Court=C3=A8s" a =C3=A9crit=C2=A0: >Hi Vivien, > >Vivien Kraus skribis: > >> Le vendredi 10 d=C3=A9cembre 2021 =C3=A0 11:51 +0100, Ludovic Court=C3= =A8s a =C3=A9crit=C2=A0: >>> Vivien Kraus skribis: > >[=2E=2E=2E] > >>> Julien fixed this interesting bug in Guile-Netlink 1=2E1=2E1, which is= now >>> in =E2=80=98master=E2=80=99 (thanks!)=2E >>>=20 >>> I rebased =E2=80=98wip-networking-netlink=E2=80=99 to get this fix=2E >>>=20 >>> Could you give it another try? >> >> The IP seems good=2E > >\o/ > >>> Any other issues left? >> >> I have a couple: >> - I get an extra IPv6 (inet6 xxxx/64 scope global dynamic mngtmpaddr >> valid_lft forever preferred_lft forever) that I did not ask for and >> that takes precedence as a source for the default route, which defeats >> the purpose=2E I=E2=80=99m not sure it=E2=80=99s guile-netlink=E2=80=99= s fault=2E > >Hmm, what=E2=80=99s that IPv6 address? Is it here even if you do not con= figure >any IPv6 address in =E2=80=98static-networking=E2=80=99? > >Julien, could the =E2=80=98link-set=E2=80=99 call in =E2=80=98network-set= -up/linux=E2=80=99 be the >culprit? > > #$@(map (lambda (address) > #~(begin > (addr-add #$(network-address-device address) > #$(network-address-value address) > #:ipv6? > #$(network-address-ipv6? address)) > ;; FIXME: loopback? > (link-set #$(network-address-device address) > #:up #t))) > addresses) > >It seems to be the only way to mark the device as =E2=80=9Cup=E2=80=9D, b= ut since it has >arguments that seem redundant with those of =E2=80=98addr-add=E2=80=99, I= wonder if >something could go wrong here=2E > >Thanks for testing, Vivien! > >Ludo=E2=80=99=2E I don't think so=2E Setting the interface up will always assign a link-loc= al address (starts with fe80), and that's not under netlink control=2E Then= , maybe once the interface is up, it may react to an RA from the router and= get an additional address that way? Not sure=2E From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 11 18:32:17 2021 Received: (at 51440) by debbugs.gnu.org; 11 Dec 2021 23:32:17 +0000 Received: from localhost ([127.0.0.1]:50269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwBqj-0005Pj-K7 for submit@debbugs.gnu.org; Sat, 11 Dec 2021 18:32:17 -0500 Received: from planete-kraus.eu ([89.234.140.182]:39572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwBqf-0005PT-If for 51440@debbugs.gnu.org; Sat, 11 Dec 2021 18:32:15 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id ef7582f2; Sat, 11 Dec 2021 23:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version; s=dkim; bh=mAFShNrvIRZ3TnqwNh0l1MqGt OI=; b=wqDrN39iAc4KaXNyVV/r2mXiRQcl5dyZDaQHez81ekVQ5RNDBdYa5zlM3 B6krCmIEJJERhJxSFV+guUzSYD6OnV404ceSHXt9QoORjFTXFGEGpqKvKW3B8jI2 5JtceWitR8DqGxS40nA5PcJXnWTOQkXG7cBzD6ya1EXRQzELqk= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 4fd8d12f (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Sat, 11 Dec 2021 23:32:09 +0000 (UTC) Message-ID: <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface From: Vivien Kraus To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sun, 12 Dec 2021 00:32:08 +0100 In-Reply-To: <87fsqy6cu0.fsf_-_@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-z3TxtfrxKfDraTyLIjGV" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: Julien Lepiller , 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-z3TxtfrxKfDraTyLIjGV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le samedi 11 d=C3=A9cembre 2021 =C3=A0 22:39 +0100, Ludovic Court=C3=A8s a = =C3=A9crit=C2=A0: > > > Any other issues left? > >=20 > > I have a couple: > > - I get an extra IPv6 (inet6 xxxx/64 scope global dynamic > > mngtmpaddr > > valid_lft forever preferred_lft forever) that I did not ask for and > > that takes precedence as a source for the default route, which > > defeats > > the purpose. I=E2=80=99m not sure it=E2=80=99s guile-netlink=E2=80=99s = fault. >=20 > Hmm, what=E2=80=99s that IPv6 address?=C2=A0=C2=A0 So now I=E2=80=99m back to the DHCP setting. I configured the DHCP server on my router to give anyone 2 IPv6 addresses: one that I configure with a static lease, and another one. On the luci interface of my router, I see that the default mode for the DHCP server is "stateful + stateless", which I guess translates to the two addresses I get on the client machine. In fact, this is the default, so I didn=E2=80=99t especially chose it that way. If I keep the analogy, the "stateless" IP looks a lot like the problematic IP I get in the static configuration. I switch my DHCP server configuration to "stateful only", and now I only have the static lease on the DHCP client configuration. Let=E2=80=99s go back to the static networking configuration. And now, the parasitic IP address is gone. So, I guess there are 3 explanations: 1. That IP was committed to disk when I was running the DHCP configuration, and got activated by default when I switched to the new static configuration; 2. What guix considers a static client configuration talks to what librecmc calls the DHCPv6 server and decides whether it=E2=80=99s OK to ass= ign a stateless IP depending on what the server says; 3. Some network stuff happens way above my understanding. Anyway, I consider that problem solved for me. Now I switch back to the DHCP configuration, otherwise the SMTP server won=E2=80=99t start and I can=E2=80=99t send this email=E2=80=A6 Vivien --=-z3TxtfrxKfDraTyLIjGV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEq4yIHjMvkliPpwQnO7C8EjLYuCwFAmG1NPgACgkQO7C8EjLY uCyLQwv+MpSeNMcGlJrEktduIIM20tp8KgoFun92OWb8w/5MZ+/TVGj5UK8pKG1T l5Dqc+aTsra+97cW2rhiohxhUjFTwvhB1FOY0K9OxJj7CkqoesXbf+3C9xCSFUUG xUK0Z8ddjuFx5NLPSMd1RGfcJmFTn1LzpiKUd0dEZnF11MXIVe7O4K/cUBqJeV/q D+mNSzxWXkXwBg5Jvokdp2NhDs0s2g6JDnmzW8clwJCiHe4FtzvKuPRbvsTtI9a8 wia3iE//rA2ZIH3BLFecwxLuyWcArFuUrOGLurGvz+C8p2a7xbkFwUMpOPWlWU3f WUQgLBTCCiBFYF3VWGmitivKWNc1SiYhME7grwgmZAxmV4BBNnJqh+tdZHqGISl4 HDBaqJdxSA+k4RgIHub1si0NWLbqA/DqDgbrepykAtgf/IJCG+/yhgnos8b/zYGT WFDt81zVndULQA1kcQasuUuTI2X9fLRzSstel7ZeY7e0Ekne2hTUGRwtZHjspMsW cEB5tzMj =H1iN -----END PGP SIGNATURE----- --=-z3TxtfrxKfDraTyLIjGV-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 12 17:00:28 2021 Received: (at 51440) by debbugs.gnu.org; 12 Dec 2021 22:00:28 +0000 Received: from localhost ([127.0.0.1]:53384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwWtP-0004sj-Q2 for submit@debbugs.gnu.org; Sun, 12 Dec 2021 17:00:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwWtO-0004sW-7x for 51440@debbugs.gnu.org; Sun, 12 Dec 2021 17:00:26 -0500 Received: from [2001:470:142:3::e] (port=40848 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwWtG-0007pB-1R; Sun, 12 Dec 2021 17:00:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=GgnPnt+GEgusbp+IPhT/VLVqQkhIz/nBhKo3IB+9pI4=; b=l5UN0ea6UZDsjNkdFW3w WbppZWSHrxF3bY6Gds9UqgV2C04VwAcddOBeo8ltrRXlrBozQIJunJQFEL8o41Wg8UBOfnY+Y6KTX AXZzTBIfk4s2f3DXuFH4NF6RQJy/0QFVriK0vA7OIqs3qHiZm3Pm508WOG6ReHeza/dg/9Uwvm8Cn LdsdSWigz7B6/a7tcsJ6no+Mqb6kLVKEkGi5p1TJssSak0x+NNUE7sozUUuvCwE2Mwg2uObD/Ipt0 3ec9lbuArRiGq3cUyIMGYWjM1h8UzM0eAUtfqmeut0M2WSJIG1aJ+8ZgXjXqces2HBhZCOGLLhHt1 VSxDl5vOYOeXTA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55828 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwWtF-0007Q2-Il; Sun, 12 Dec 2021 17:00:18 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Vivien Kraus Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 Frimaire an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 12 Dec 2021 23:00:15 +0100 In-Reply-To: <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> (Vivien Kraus's message of "Sun, 12 Dec 2021 00:32:08 +0100") Message-ID: <875yrt4h74.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: Julien Lepiller , 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Vivien Kraus skribis: > I switch my DHCP server configuration to "stateful only", and now I > only have the static lease on the DHCP client configuration. > > Let=E2=80=99s go back to the static networking configuration. > > And now, the parasitic IP address is gone. In your initial testing, you did not reboot, right? The =E2=80=98stop=E2=80=99 method of the =E2=80=98networking=E2=80=99 Sheph= erd service created by =E2=80=98static-networking-service-type=E2=80=99 only deletes addresses and= routes that it (supposedly) created itself. Thus, if there are stale addresses created previously, they=E2=80=99ll stick around. It could be what happened here. [...] > Anyway, I consider that problem solved for me. \o/ > Now I switch back to the DHCP configuration, otherwise the SMTP server > won=E2=80=99t start and I can=E2=80=99t send this email=E2=80=A6 Heh. :-) Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 12 17:26:38 2021 Received: (at 51440) by debbugs.gnu.org; 12 Dec 2021 22:26:38 +0000 Received: from localhost ([127.0.0.1]:53397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwXIj-0005V5-WC for submit@debbugs.gnu.org; Sun, 12 Dec 2021 17:26:38 -0500 Received: from planete-kraus.eu ([89.234.140.182]:38524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwXIi-0005Uv-0I for 51440@debbugs.gnu.org; Sun, 12 Dec 2021 17:26:36 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 9f474609; Sun, 12 Dec 2021 22:26:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; s=dkim; bh=Yh8YJ1ZXwjJZbdz6noQ0CYrHQYY=; b=OtXajrgiGOPOc2X+PE0FWA+m4oFR GwDWoGdUy5xfOCY8iUjLflAWE5fsJYlNfQt4kpUfaDKpzMK1jRiHEC6Ad6Tw9WmK zQy8D9oonpYfnCe7suT+pHrCoD0xtR4qnokBkTSwg1Q9rNP8Cuk49af4/wjTnjrd 8g9j7jkZupq7wPA= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 67443ef4 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Sun, 12 Dec 2021 22:26:31 +0000 (UTC) Message-ID: Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface From: Vivien Kraus To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Date: Sun, 12 Dec 2021 23:26:30 +0100 In-Reply-To: <875yrt4h74.fsf@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> <875yrt4h74.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: Julien Lepiller , 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi! Le dimanche 12 décembre 2021 à 23:00 +0100, Ludovic Courtès a écrit : > In your initial testing, you did not reboot, right? I always reboot after every reconfiguration, because I can, and usually when I wildly change the networking configuration like that the networking service fails to upgrade, and with it everything else, so I can’t do anything with the machine before rebooting it. However, as I was trying a NetworkManager-based solution today, I noticed that the configuration persists after a reboot: NetworkManager tried to replicate what was there before. So I would not be surprised if other pieces of networking configuration could survive a reboot. > > Anyway, I consider that problem solved for me. > > \o/ > > > Now I switch back to the DHCP configuration, otherwise the SMTP > server > > won’t start and I can’t send this email… > > Heh. :-) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 12 18:11:54 2021 Received: (at 51440-done) by debbugs.gnu.org; 12 Dec 2021 23:11:54 +0000 Received: from localhost ([127.0.0.1]:53409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwY0X-0006be-U1 for submit@debbugs.gnu.org; Sun, 12 Dec 2021 18:11:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwY0W-0006bS-7U for 51440-done@debbugs.gnu.org; Sun, 12 Dec 2021 18:11:52 -0500 Received: from [2001:470:142:3::e] (port=41858 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwY0O-0006AS-BD; Sun, 12 Dec 2021 18:11:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=H3Vay8AlmUw/n/rAfsmoMGGzOlpkD7ZofT45JBK2fvo=; b=WamUt5k2k4ukxj3lGgaa iAmWtqkudII+Kf8dQwNgqaUFZuUe6PxFthXQvU5I68bv4u8gohEVJwiz3X18aO4S+bqsFBgKGnONR nOLGvFHu7SXgxDRW6wiuGr6YPBFsGP/aO8YLzixGXdjL9Mqi+8VZXJSOR2fqrsAija2EaIgpCEYCI DuOQ+j+9Uh+YMoSf2DFX5bRvXOFocld7hgb7CXfwpWzflwxqWczRK1CRGI0Bq5GPX+wvlCITgI7st 5S6LOgEDvXZOiwFJarLdMYO39lCmG0cJJI6KwDSg+7nZ66AVg1NLdjdYdu0Fp5S7K4aZDPeLhtCST XenIPGY2xOiUnw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:52033 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwY0O-0000Ek-A1; Sun, 12 Dec 2021 18:11:44 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Vivien Kraus Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> <875yrt4h74.fsf@gnu.org> Date: Mon, 13 Dec 2021 00:11:41 +0100 In-Reply-To: <875yrt4h74.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sun, 12 Dec 2021 23:00:15 +0100") Message-ID: <87mtl52zbm.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440-done Cc: Julien Lepiller , 51440-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) I went ahead and pushed this series: c8609493ba news: Add entry about 'static-networking-service-type'. f73ba627ab tests: Replace uses of deprecated 'static-networking-service'. 5967aee398 services: Define '%loopback-static-networking'. 1644f4f1f8 services: Define '%qemu-static-networking'. 223f1b1eb3 services: static-networking: Change interface to mimic netlink. 39e3b4b7ce services: secret-service: Turn into a Shepherd service. 0cc742b261 services: static-networking: Use Guile-Netlink on GNU/Linux. 1759292c8b gnu: guile-netlink: Allow cross-compilation. a4d33fef31 doc: Add new "Networking Setup" node for the main setup option= s. 33c498b9ee tests: openvswitch: Check whether ovs0 is up. 72f140c253 tests: Add 'static-networking' test. Let me know if anything=E2=80=99s amiss! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 13 12:29:19 2021 Received: (at 51440) by debbugs.gnu.org; 13 Dec 2021 17:29:19 +0000 Received: from localhost ([127.0.0.1]:56703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwp8Z-0008Dn-1s for submit@debbugs.gnu.org; Mon, 13 Dec 2021 12:29:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwp8X-0008Da-AP for 51440@debbugs.gnu.org; Mon, 13 Dec 2021 12:29:18 -0500 Received: from [2001:470:142:3::e] (port=38188 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwp8R-000462-PS; Mon, 13 Dec 2021 12:29:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=eD5YPQzTx3aIq0UR4ClGY1JFXkLqngFPVKy3esxxAMk=; b=mVmggzzSVbKOX6f+jUYC nHSstcSqCT/uRM8OVSFJC899LDODGoI5k91sSoLwdptO0A1Dnfm12EMrvoSd55W95Pq4Cgf9CE0kA fRchRxZdc1lbks0d9Q8d9L73pyvfV9IsF6+XBx//CDs0H3UvEfO/TXiMvlMrPKzpLjtRS0ksmmG10 SaFS/91MP81bc4isJpNNbgS2R9mGeVnwCDGfFXPnpMiN0QJFhHVo+vUA4pMF34h8eNWuZ88JY+0xk r2v/WX3makXMSxKERiVh2lHKJxi5OFQ9m2oCvWmBwsQ/k91qakraFXPjjE/FJ2E04fQVNR7QAToPf /Y5GJb5rL9CuzA==; Received: from [2a01:e0a:19b:d9a0:2ddb:d3d2:32e8:d31a] (port=33278 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwp8R-0004qe-L0; Mon, 13 Dec 2021 12:29:11 -0500 From: Mathieu Othacehe To: 51440@debbugs.gnu.org Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> <875yrt4h74.fsf@gnu.org> <87mtl52zbm.fsf_-_@gnu.org> Date: Mon, 13 Dec 2021 18:29:09 +0100 In-Reply-To: <87mtl52zbm.fsf_-_@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Mon, 13 Dec 2021 00:11:41 +0100") Message-ID: <87k0g8fm6y.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: ludo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey Ludo, > 72f140c253 tests: Add 'static-networking' test. Looks like there could be an issue with this test, see: https://ci.guix.gnu.org/build/1979106/log/raw. Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 14 06:23:35 2021 Received: (at 51440) by debbugs.gnu.org; 14 Dec 2021 11:23:35 +0000 Received: from localhost ([127.0.0.1]:57682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mx5uB-0005Uu-Gp for submit@debbugs.gnu.org; Tue, 14 Dec 2021 06:23:35 -0500 Received: from planete-kraus.eu ([89.234.140.182]:38058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mx5u8-0005UZ-O9 for 51440@debbugs.gnu.org; Tue, 14 Dec 2021 06:23:34 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id bb59b9e0; Tue, 14 Dec 2021 11:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type; s=dkim; bh=heLY1Mytuaa7i3Y5IexLBpwCl IM=; b=X5u7aZyeiTs1u0hidJRPuSLenf0HFnMrO2/24/+HIOFlt9a6oPkRUBM9g LCFI4yKIy9U9XtyjBko+FbdcZDBT2L1r5f4eC8ZoeIYv2Uyk5IpU+t1o1ZPm8X1O yehotkoKk2Pppk4nexcLEx6ihhWbKtPvzrZvcx7EaaHooXH2gQ= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id a69382d7 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Tue, 14 Dec 2021 11:23:28 +0000 (UTC) References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> <875yrt4h74.fsf@gnu.org> User-agent: mu4e 1.6.10; emacs 27.2 From: Vivien Kraus To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface Date: Tue, 14 Dec 2021 12:17:53 +0100 In-reply-to: <875yrt4h74.fsf@gnu.org> Message-ID: <874k7bv39r.fsf@planete-kraus.eu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51440 Cc: Julien Lepiller , 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Ludovic Court=C3=A8s writes: > Vivien Kraus skribis: >> Now I switch back to the DHCP configuration, otherwise the SMTP server >> won=E2=80=99t start and I can=E2=80=99t send this email=E2=80=A6 > > Heh. :-) That problem is solved if I don=E2=80=99t ask for it to listen to interface= s but rather to addresses. So now I can fully switch to the new static networking service. I=E2=80=99m happy I found a solution that checks all bo= xes at last :D --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCAAdFiEEq4yIHjMvkliPpwQnO7C8EjLYuCwFAmG4frAACgkQO7C8EjLY uCwycQv+PiyVMaQdGGwbliPgl1h8tOmTA3wgtBCkEIbnaHsdtiPHLceWnd7LjQs+ Md5OSQPOF1AVhFeLLK34wHgLCnx4cdQqGfzr3x22skc++Pm8jAGBOfqz8mBdAUKA wRH4Dr+WuwWHl1Bn5dZxx5eJYh0t/U1Wau43U9mzmqGU7pj3R1bvnliLnTsnWIto n4RhaitDaY98Rp52NeaCPFucnxZDzZMaVO2mqHoi8+ZxSiZXAjHaDE7S25l6pBsc 8oPamhZbs1hcPTL3v2WuichPUUT65M9h+3e+yfhuN6bWiAdaAQqPkB3/ZxC3PWxc bnR1g8edIwwIAY51nkLa+bt6t9P8Nb5HK1JtsF8mX1lp5/A824AVg3HWiJ/+TUFE 3srqGJ/OwLDXHdboMVwNFA6VSk5Ngg9jUVtrJaI7pdmC9pNep083cIqCRhHsg862 tErodR5wvfs0oA9/3ZNP35EhiYZ2TS1dj6twCqhWYwfdPmOqEnrxgxslCDdsU2ij i79WyNvw =zDIZ -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 14 10:03:34 2021 Received: (at 51440) by debbugs.gnu.org; 14 Dec 2021 15:03:34 +0000 Received: from localhost ([127.0.0.1]:59284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mx9L4-00053H-3i for submit@debbugs.gnu.org; Tue, 14 Dec 2021 10:03:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mx9L1-000533-ND for 51440@debbugs.gnu.org; Tue, 14 Dec 2021 10:03:33 -0500 Received: from [2001:470:142:3::e] (port=41876 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mx9Ku-0001hH-PJ; Tue, 14 Dec 2021 10:03:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=cIwRAM+poNVyD1MYxxmlbQfPwUUc6ZqKd56RMFTftGI=; b=R1w9z7mOtWUCbHsd69fL yhBu/P42Cjstet+55WvyBwOM3DHxGRwPxpLbzjJdxVN34HHShJUFgdgayvGZ9MXoGmrxUKnOOrmlY keRNitQYsEuiRH3JpqzNSM2YYWzSAW3fiv5m6UIiXXTSCliCLFTtkrvOBEi8Oa0cBzP7p9hOe4K7N jaV86uZD66o19NkFRpA5wc79y5f3kKmCUdAKudSGQMFFx3H+RWyipJZJeupW+pD3G9ffJ0UPqbMvh 7m1GhNXhRvzE1JHOdv1tcijc0MD4nM82QksWDoylV4XTgjG6UtS6jOUbjluRB7q1ZyVyAhMPGeFMz Pd3YWZMXBxCiRw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:62831 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mx9Ku-00047U-Lj; Tue, 14 Dec 2021 10:03:24 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Vivien Kraus Subject: Re: bug#51440: [PATCH 00/10] Declarative static networking interface References: <20211027135918.18833-1-ludo@gnu.org> <87y24sag1w.fsf_-_@gnu.org> <87fsqy6cu0.fsf_-_@gnu.org> <0e79f5765c75a56e88880cd12a1c0a9404d2d5bc.camel@planete-kraus.eu> <875yrt4h74.fsf@gnu.org> <874k7bv39r.fsf@planete-kraus.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 24 Frimaire an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 14 Dec 2021 16:03:21 +0100 In-Reply-To: <874k7bv39r.fsf@planete-kraus.eu> (Vivien Kraus's message of "Tue, 14 Dec 2021 12:17:53 +0100") Message-ID: <874k7b1b5y.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51440 Cc: Julien Lepiller , 51440@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Vivien Kraus skribis: > Ludovic Court=C3=A8s writes: >> Vivien Kraus skribis: >>> Now I switch back to the DHCP configuration, otherwise the SMTP server >>> won=E2=80=99t start and I can=E2=80=99t send this email=E2=80=A6 >> >> Heh. :-) > > That problem is solved if I don=E2=80=99t ask for it to listen to interfa= ces but > rather to addresses. So now I can fully switch to the new static > networking service. I=E2=80=99m happy I found a solution that checks all = boxes > at last :D Nice, thanks again for testing and reporting! Ludo=E2=80=99. From unknown Sun Jun 15 08:43:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 12 Jan 2022 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator