# Wireguard does not work on guix

**URL:** <https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170>\
**Category:** Guix\
**Created:** [November 27, 2024, 5:45pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170 "2024-11-27T17:45:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cinquiee](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cinquiee](https://forum.systemcrafters.net/u/cinquiee)\
**Post date:** [November 27, 2024, 5:45pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/1 "2024-11-27T17:45:07Z")

</div>

i followed the official documentation on setting up wireguard using network manager. the connection successfully activates, but i have no internet access

i tried using wireguard-tools too, and also doesnt work. i tried the same client config on a different machine, and it worked, so i am sure this is a guix-specific issue

any ideas on a fix?

---

<div class="post-metadata">

**Author:** ![Ishigami](https://avatars.discourse-cdn.com/v4/letter/i/f17d59/32.png) [@Ishigami](https://forum.systemcrafters.net/u/Ishigami)\
**Post date:** [November 28, 2024, 5:53pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/2 "2024-11-28T17:53:22Z")

</div>

Could you share your configuration, or what did you try to do ? Are both machines (where wireguard works, and does not work) part of same network ? Does one have firewall, and one does not have ? Did you do any `tcpdump`, or `wireguard` debugging ? I use wireguard using wireguard-tools, and as well as the guix’s `wireguard` service module, and both seem to work fine.

---

<div class="post-metadata">

**Author:** ![cinquiee](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cinquiee](https://forum.systemcrafters.net/u/cinquiee)\
**Post date:** [December 2, 2024, 2:20pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/3 "2024-12-02T14:20:09Z")

</div>

i just followed the official guix guide to enable wireguard using network manager. both machines are part of the same network and are trying to connect to the same server. neither has a firewall, unless guix adds one by default and ive not realised this? i’ll share what happens with tcpdump when i do that

---

<div class="post-metadata">

**Author:** ![apoorv569](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@apoorv569](https://forum.systemcrafters.net/u/apoorv569)\
**Post date:** [December 9, 2024, 12:06pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/4 "2024-12-09T12:06:06Z")

</div>

Could you link the guide you followed?

---

<div class="post-metadata">

**Author:** ![altomcat](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/altomcat/32/583_2.png) [@altomcat](https://forum.systemcrafters.net/u/altomcat)\
**Post date:** [December 9, 2024, 6:45pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/6 "2024-12-09T18:45:45Z")

</div>

I’m not an expert but it was straigthforward for me. However I didn’t setup the `wireguard-service-type`.  
I added the `wireguard-tools` package in my os definition. Don’t know if it’s mandatory. Then I added this `simple-service`:

```scheme
(simple-service 'wireguard-module
                kernel-module-loader-service-type
                '("wireguard"))

```

Finally, my **wg0.conf** was imported with **nmcli**.

---

<div class="post-metadata">

**Author:** ![cinquiee](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cinquiee](https://forum.systemcrafters.net/u/cinquiee)\
**Post date:** [December 9, 2024, 11:20pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/7 "2024-12-09T23:20:06Z")

</div>

i used [Connecting to Wireguard VPN (GNU Guix Cookbook)](https://guix.gnu.org/cookbook/en/html_node/Connecting-to-Wireguard-VPN.html), but i since found [VPN Services (GNU Guix Reference Manual)](https://guix.gnu.org/manual/en/html_node/VPN-Services.html) and [Solene'% : How to use WireGuard VPN on Guix](https://dataswamp.org/~solene/2021-05-22-guix-wireguard.html), which suggest defining it in guile rather than directly with a wireguard config file. i dont see how itd be different, but ill give it a shot?

---

<div class="post-metadata">

**Author:** ![cinquiee](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cinquiee](https://forum.systemcrafters.net/u/cinquiee)\
**Post date:** [December 9, 2024, 11:21pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/8 "2024-12-09T23:21:47Z")

</div>

according to the guide it isnt necessary to define it anymore as its been merged into the kernel, but ill try anyway

---

<div class="post-metadata">

**Author:** ![altomcat](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/altomcat/32/583_2.png) [@altomcat](https://forum.systemcrafters.net/u/altomcat)\
**Post date:** [December 10, 2024, 7:41pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/9 "2024-12-10T19:41:07Z")

</div>

yes you’re right!

By default, the private key points to `/etc/wireguard/private.key`. Did you put the private key from your `wg0.conf` at the right place ?

I 've switched to the service `wireguard-service-type` and I had the same behavior at first. My problem came from the private key that was different from the expected one.

`sudo wg show all` should confirm the private key is found (should return **hidden** ).

Eventually, I think you already know that but:

- You can change the default name for this interface in your `wireguard-configuration` section to avoid having several profiles with the same name **wg0**. Mine is (interface “protonwg”). The created service will be **wireguard-protonwg** (in my case).  
You’ll manage it with `sudo herd [start|stop|status] wireguard-protonwg`.
- For the debugging, you can look at `/var/log/message`.

---

<div class="post-metadata">

**Author:** ![cinquiee](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@cinquiee](https://forum.systemcrafters.net/u/cinquiee)\
**Post date:** [December 11, 2024, 11:05pm UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/10 "2024-12-11T23:05:30Z")

</div>

thanks, that tip about the private key was helpful, id only had it in my `wg0.conf` file and not also in `/etc/wireguard`

3 things:

when i dont specify the same peer and interface name, i get the following error: `Throw to key` ``%exception’ with args ```(“#<&invoke-error program: \”/gnu/store/…-wireguard-tools-…/bin/wg-quick\” arguments: (\”up\” \”/gnu/store/…-wireguard-config/wg0.conf\”) exit-status: 1 term-signal: #f stop-signal: #f>”)’ `. i believe this isnt expected behaviour, as whether the names match shouldnt matter unless theres something ive missed here (unrelated, how do you display a single backtick in code blocks on discourse?)

when i specify same names and the service starts, the public key from `sudo wg show all` is different from the one i specify in my os config, which is an obvious reason its not connecting… i think its generating a new keypair, but im not sure why, because ive already given it both (i am getting `(hidden)` for the `private.key`)

i used `nmcli c edit` then `print` to view the interface properties, and it specifies the address fine, but doesnt have a value for dns when i did give it a different dns value. i assume its just the same format as addresses, so `(dns ‘(“<address>”))`?

---

<div class="post-metadata">

**Author:** ![dgr](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/dgr/32/394_2.png) [@dgr](https://forum.systemcrafters.net/u/dgr)\
**Post date:** [December 12, 2024, 11:34am UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/11 "2024-12-12T11:34:18Z")

</div>

You need to use two backticks to surround the code block.  
```

---

<div class="post-metadata">

**Author:** ![Kolev](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kolev/32/1045_2.png) [@Kolev](https://forum.systemcrafters.net/u/Kolev)\
**Post date:** [December 19, 2024, 12:08am UTC](https://forum.systemcrafters.net/t/wireguard-does-not-work-on-guix/1170/12 "2024-12-19T00:08:17Z")

</div>

I would like an updated guide on how to do this. My server needs to use [Hoppy](https://hoppy.network/) to get a decent IP address set up.
