From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4DTTMCTRXWFJpgAAgWs5BA (envelope-from ) for ; Wed, 06 Oct 2021 18:39:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yK6ELCTRXWGNTwAA1q6Kng (envelope-from ) for ; Wed, 06 Oct 2021 16:39:00 +0000 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 6D5C683E4 for ; Wed, 6 Oct 2021 18:39:00 +0200 (CEST) Received: from localhost ([::1]:36292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY9wZ-0008Lp-F4 for larch@yhetil.org; Wed, 06 Oct 2021 12:38:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY9mI-0000vC-RY for guix-devel@gnu.org; Wed, 06 Oct 2021 12:28:23 -0400 Received: from vps-93-95-228-136.1984.is ([93.95.228.136]:34834 helo=csphy.pw) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY9mF-0000ON-NY for guix-devel@gnu.org; Wed, 06 Oct 2021 12:28:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csphy.pw; s=mail; t=1633537694; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8yEJOVpx3IbD0ztkq/Kkw8SXYXR5lnjqZgmXbgL6nD4=; b=b7fmKtaESeIKMchaG4yx1+H4Rxm7FnN3I4QWlzqk6duyvcTL6fZKaa6VZchQf4Vbx96UlB wKubfb61wABa439NorJwRer2xpoZxdwoiswOFoirsmWedfft+88u3N4rrHa2tDnihBzgWh nbY8pNuKMiQcpT8fFwMdW0dhHkbb7bg= From: crodges To: guix-devel@gnu.org, Maxime Devos Subject: Re: Wireguard Date: Wed, 06 Oct 2021 09:28:06 -0700 Message-ID: <9671087.XobH8ZdYvX@sceadufaex> In-Reply-To: References: <2301909.g8HzRWBaYy@sceadufaex> <5121813.v3WT2HIqr8@sceadufaex> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=93.95.228.136; envelope-from=crodges@csphy.pw; helo=csphy.pw X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NO_FM_NAME_IP_HOSTN=0.001, PDS_RDNS_DYNAMIC_FP=0.001, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633538340; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=8yEJOVpx3IbD0ztkq/Kkw8SXYXR5lnjqZgmXbgL6nD4=; b=LM7Lr/t0n05pTg2+zz3O7Tl0pGZ7q3DFs2qyfSX+vxUclu9xeWPyX+4Oq0t4q6nsDx7EvO rs7be6U9s/GX39Man3fasESfuiS2ax0xHDJn5bK96DvkF02bMxFlZse5oZmflfd0bbTGu7 xw7knB5WrkVQlAUivFVblF5kc5mc9vmOpsJ5jA10vWJlvYIRu5tLfWnpoEjNPgIuEW+xPI IKL57pEnXqOMWS9NpJmb48clikMlyOR22RKo34tlUJoec+zVpU3mfcG+eOrRh0zjX7yB44 DToGg7I6yDO3wBo3pCZVM8jwD5VB8q8wP2py4WMKUBmXig99NeQ/ZyedRR6EwQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633538340; a=rsa-sha256; cv=none; b=IC0xkfkykIWsCJr+MAAYzh5Unla99XWe6/yUyvGT3+/9l44Gq/7KFtvApXKR6etebBqJr8 MuB5LJG2LfI7ROt0AnOF8VGnQoOIJBObIppgBZEO2crbLoKOoFk7zQSoNj8KSA2iJNDtig vSgv4M3eaGirSK1GGcoGi3hceXfsDkaeMdU9HxC/DijGad1pr85/cdOyE8DodBbip8Hh3K gAVC2qZlxRHFjGwg6kMhprXz+OLBbPp/AM9+z2y9R1hD3wb87He36l7sB5CCqaeO8+ZaBd GvTUqAAaNfiS6jO52jo/Zd2c1L+iEkkLixWBUC+a1uNzj0loPiIXFB2iF4Bpcw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=csphy.pw header.s=mail header.b=b7fmKtaE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=csphy.pw (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.22 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=csphy.pw header.s=mail header.b=b7fmKtaE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=csphy.pw (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 6D5C683E4 X-Spam-Score: -1.22 X-Migadu-Scanner: scn1.migadu.com X-TUID: hOXOatpymgGB On Wednesday, September 22, 2021 10:23:11 A.M. PDT Maxime Devos wrote: > crodges schreef op wo 22-09-2021 om 09:03 [-0700]: > > On Wednesday, September 1, 2021 12:07:43 A.M. PDT Maxime Devos wrote: > > > crodges schreef op zo 29-08-2021 om 14:53 [-0700]: > > > > Hello everyone, > > > >=20 > > > > Let me start thanking you for developing such a interesting project= in > > > > GNU > > > > Guix. Also, I don't want to take up anyone's time, so you can just > > > > point > > > > to > > > > documentation or other resource succinctly and I'll do my best. I'm > > > > writing > > > > here because I tried the help list but not answer so far, after a f= ew > > > > days. > > > >=20 > > > > I managed to configure wireguard on a vps running guix and created > > > > clients > > > > for my desktop and cellphone. What I want to do (and did already in= a > > > > Debian vps) is to make wireguard's lan accessible to anyone connect= ed > > > > and > > > > also browse the internet using this vpn. > > >=20 > > > The Wireguard service as defined in Guix System doesn't currently > > > support > > > the forwarding you appear to describe ... > > >=20 > > > > As I remember, I need to allow ip forwarding using > > > >=20 > > > > sysctl net.ipv4.ip_forward=3D1 > > > >=20 > > > > and I also need to put these rules into wireguard (the server) under > > > > [interface], > > > >=20 > > > > PostUp =3D iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A > > > > POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j > > > > ACCEPT; > > > > ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE > > > >=20 > > > > PostDown =3D iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat = =2DD > > > > POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j > > > > ACCEPT; > > > > ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE > > >=20 > > > However, I don't see why this couldn't be implemented in Guix System > > > (after some changes to wireguard-service-type). > > >=20 > > > > Problem is, looking at the latest guix manual, PostUp and PostDown > > > > doesn't > > > > seem to exist yet. Do they exist but are still undocumented? > > >=20 > > > Guix uses "wg-quick", so it would seem they do exist, but are > > > inaccessible > > > from Guix. The configuration file is created in > > > wireguard-configuration-file (in gnu/services/vpn.scm), maybe you can > > > modify that. > > >=20 > > > > If they don't exist, where should be a reasonable place to add this > > > > configurations? > > >=20 > > > and wireguard-configuration-file in (gnu > > > services > > > vpn) it would seem. Also, sysctl-service-type would need to be exten= ded > > > (in the =E2=80=98service-extension=E2=80=99 meaning of the word) to s= et > > > net.ipv4.ip_forward > > > appropriately. > > >=20 > > > > I'm trying to do everything the guix way, when I finish this > > > > machine configuration, I'd like it to be fully replicable. > > > >=20 > > > > Also, is this something that I could solve modifying the wireguard > > > > service > > > > definition itself? > > >=20 > > > If replicability is all you need, you could add =E2=80=98postdown=E2= =80=99 and =E2=80=98postup=E2=80=99 > > > options to , which would need to be set to t= he > > > commands above. However, these strings seem rather complicated for t= he > > > uninitiated, so I'd recommend something more high-level instead. Some > > > interface like > > >=20 > > > (wireguard-configuration > > > =20 > > > [...] > > > (addresses ...) > > > (peers ...) > > > (forward? #t)) > > >=20 > > > perhaps? Make sure to add some documentation to =E2=80=98Wireguard= =E2=80=99 in > > > (guix)VPN > > > Services. (Maybe add some example situations on how forward? can be u= sed > > > and how it functions.) > > >=20 > > > I want to note that I don't understand what exactly you're doing, I o= nly > > > understand that there is some forwarding going on, and I'm not > > > unfamiliar > > > with networking issue (e.g. I recently figured out why I couldn't > > > connect > > > to the Internet with the ISP-provided =E2=80=984G minimodem=E2=80=99 = =2D- DNS was b0rken). > > > So explaining forward? to laypeople might take some care. > > >=20 > > > Writing a corresponding =E2=80=98system test=E2=80=99 in gnu/tests/ne= tworking.scm is > > > recommended. > > >=20 > > > Greetings, > > > Maxime. > >=20 > > Thanks for the pointers Maxime. > >=20 > > I'm not an expert in networking but I can briefly tell about my use case > > here. basically my setup accomplishes two things: any machine connected > > to the server running guix and wireguard should be able to browse the > > internet like a normal vpn (using the server's ip address) and any clie= nt > > theoretically could see each other. Right now I use this capability to > > play 0ad with friends, in the future there will be apps running in > > different clients, accessible to anyone inside vpn. > >=20 > > That said, I'm back here to ask one more thing. I cloned guix and follo= wed > > the manual to create an --pure environment and authenticated the commit= s. > > This machine is a different one from my server, here I have guix running > > on top of manjaro (an arch gnu/linux flavor). > >=20 > > I started changing code inside vpn.scm and my approach was to "make && > > make > > check" after changes to see if it would still build. But this week, aft= er > > a > > git pull to update the repo and using make, I'm now greeted with > >=20 > > error: failed to load 'gnu/packages/perl.scm': > > ice-9/eval.scm:293:34: In procedure abi-check: #>: > > record ABI mismatch; recompilation needed > >=20 > > I will still spend some time with this error, but I found worth to ask:= is > > this approach of "make && make check" a reasonable one? >=20 > If you see =E2=80=98recompilation needed=E2=80=99, recompile with "make c= lean && make". >=20 > > Is there a way to test > >=20 > > a guix system without installing it? Packages I know we can, but system > > capabilities like vpn I'm not sure. >=20 > You could create a VM: "./pre-inst-env guix system vm the-configuration.s= cm > --root=3Drun-the-vm.sh && ./run-the-vm.sh". Or possibly "./pre-inst-env = guix > system reconfigure the-config.scm", if you only don't want to install gui= x, > but reconfiguring the system is fine. >=20 > (You can do almost everything from ./pre-inst-env that can be done withou= t. > The exception is if you modify the guix daemon (code under nix/), then you > may need to restart it from the local checkout.) >=20 > Greetings, > Maxime. Thanks again Maxime, I was able to create and run the vm. How can I build a .iso image with my c= ode=20 changes to install in a vps? I tried to change the code, compile, run guix system image -t iso9660 gnu/system/install.scm then I grabbed the .iso from the /gnu/store but after installing it, it didn't contain my changes. Am I grabbing the wr= ong=20 iso, if so, how should I do this? I may be confusing guix installed in my p= c=20 with the one I'm making changes. Thanks, crodges.