From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gGn6JSJR3GF7XwEAgWs5BA (envelope-from ) for ; Mon, 10 Jan 2022 16:30:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oHrGHiJR3GEwJgAAG6o9tA (envelope-from ) for ; Mon, 10 Jan 2022 16:30:42 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D071250E8 for ; Mon, 10 Jan 2022 16:30:41 +0100 (CET) Received: from localhost ([::1]:56648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6wd6-00058o-Pi for larch@yhetil.org; Mon, 10 Jan 2022 10:30:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6sry-0007Td-Pu for help-guix@gnu.org; Mon, 10 Jan 2022 06:29:47 -0500 Received: from mout02.posteo.de ([185.67.36.66]:47349) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6srw-0006Kv-95 for help-guix@gnu.org; Mon, 10 Jan 2022 06:29:46 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id AECA7240103 for ; Mon, 10 Jan 2022 12:29:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1641814180; bh=9SoIxdHrS7IL5wqnKiyX1haRThWaLzIh5lUwY6gTvHA=; h=Date:From:To:Subject:From; b=A4XiGmOfyTlA242kQGdUXLkAkiU+1B0HRhsJ62Wx/+LCphJHtzJ4Lr0guZiJ5xZCX Yt4ao5qW/WQsc0wKUgAbaPvzzgDz91UodjnjiykCRw6gnruyHdJSmtaLV2q/iCagTF 2a/zqvCLe4CXvKnXRMhGITfPhbFrsgXUNQdZaq6/OW6nAjG8ElmebX7r9EoAsFFEje d0F1ghxBLo7m/U0H1koXR+a1Hy+aq5CdwrYvOTNor1BjpMibX7Xv2kXYNk2xhdEACw DFv/gUd6kkm6ldpM0d5ozskbmQ9SbWTITAt5kuAMd0QQlzGpCIDIHJWBHEai5W+/PZ rukOFNAbGo2Kw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JXWnc2DBDz9rxR for ; Mon, 10 Jan 2022 12:29:40 +0100 (CET) Date: Mon, 10 Jan 2022 11:29:38 +0000 From: Niklas Schmidt To: help-guix@gnu.org Subject: Add VLAN with Guile Netlink link-add Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Received-SPF: pass client-ip=185.67.36.66; envelope-from=snlabs@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 10 Jan 2022 10:28:32 -0500 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641828642; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DdnWvB9Q6xCv5ltQJDuiKdIw1iP5hQ5bIaI5goILeFQ=; b=g3XXvIAzq2dffvwIRUFfRstGQPUKnK39JwL1ls0d/4JVk4scbF0L38nh292emAoMAMidS9 +JdXwJm7+oCpWIzt4Zc6L3cFA6hSh0ilKYwkNbwnOrYERyV1FBNhRZB+zcmDIZuUp2uf/c v2xXkrz+6S9ndp+xGoXYS8nsIEylqh0gzQhkvRGZ8+7+2KMp7SNe2d+3B+wPsrhcsTxEHm NIci5Kht0C6MH4rA8tnf7vraVlgmwYrbGProOcyk0io02z4cfBIS69QdIq/JsggBzSsypj Si2HZEegkcqblTaOxJdn5AFdSVqdslVulhwnDWJg/yzXnxkKWKd4r/C/shyAgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641828642; a=rsa-sha256; cv=none; b=WsDAMYj2PbBow/MgMOVKVDCklLhkzfskgJHnPmdK9Hwd4j6PuqrN62QMTYN6oB8RjuYkl/ ZZzla9JhQ08BX/usfW48pO1yiq2G/PbT0f1wOjR5uxkQDty/xIfQAj1e8/jjNxjWLlgDss CG3c87fpAQVCwoxI2q11+gX01xc6s6Pu8vABLXksBty6CaZdDCPAyGRmUnuhsffx50XHSg YgpSIEgrwYt5WKcw7jTQw1g3HiNBlX/+f5hzTccEL4bCeEdHde+djZUtZp3ic32PK+BC0Z 3P319F8l+qLlrDgM1wJOwbto58xEFlmwrk20L80vby3sP6Ti4o7QP9rICTvsGg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=A4XiGmOf; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.51 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=A4XiGmOf; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 8D071250E8 X-Spam-Score: -4.51 X-Migadu-Scanner: scn1.migadu.com X-TUID: D3Wpse+vWdkT Dear Guix, I really appreciate the ability to declare a static-networking configuration. I face some difficulties adding a 802.1Q VLAN interface using the Guile Netlink package. I added guile-netlink to my operating system definition's packages field. Running guile as root using su, I get the following error: scheme@(guile-user)> (use-modules (ip link)) scheme@(guile-user)> (link-add "ens3.12" "vlan" #:type-args '((id . 12))) ice-9/boot-9.scm:1685:16: In procedure raise-exception: ERROR: 1. &netlink-response-error: 22 Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> The documentation [1] states: Scheme Procedure: link-add name type [#:type-args '()] Add a new link with given name and type. Additional arguments can be passed to control the state of the link at creation. type-args is an association list containing additional values for the given type. When type is "vlan", type-args can contain a number associated with 'id: the VLAN id to be created. It is unclear to me how to specify the hardware interface for which the VLAN link is to be added. Maybe I am missing something? Calling the above command with "ens3" instead of "ens3.12" results in the same error. I am able to add the link manually with iproute2 by executing ip link add link ens3 name ens3.12 type vlan id 12 and was able to verifiy that it works by assigning a static IPv4 address. If I run another command given in the documentation [1], (link-add "v0p0" "veth" #:type-args '((peer . "v0p1"))) that returns #t and creates the interface pair. So I think, Guile Netlink generally works with my configuration. Has someone got a working code sample showing how to add VLANs using Guile Netlink? I don't understand the internals of the Netlink kernel interface yet. A comment in the source code [2] says that every link type except veth and vlan is not implemented in Guile Netlink. I am not sure whether the functionality I whish to use is supported at all. My goal is to specify VLAN links in the links field of a static-networking record. Im running Guix inside QEMU-KVM. If that would help, I am willing to test this on real hardware. Thanks for advice. Greetings Niklas [1]: https://git.lepiller.eu/guile-netlink/manual/html_node/Link.html [2]: https://git.lepiller.eu/guile-netlink/tree/-/ip/link.scm