2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.0" xml:id="module-services-networking-yggdrasil">
3 <title>Yggdrasil</title>
5 <emphasis>Source:</emphasis>
6 <filename>modules/services/networking/yggdrasil/default.nix</filename>
9 <emphasis>Upstream documentation:</emphasis>
10 <link xlink:href="https://yggdrasil-network.github.io/"/>
13 Yggdrasil is an early-stage implementation of a fully end-to-end encrypted,
14 self-arranging IPv6 network.
16 <section xml:id="module-services-networking-yggdrasil-configuration">
17 <title>Configuration</title>
18 <section xml:id="module-services-networking-yggdrasil-configuration-simple">
19 <title>Simple ephemeral node</title>
21 An annotated example of a simple configuration:
24 services.yggdrasil = {
26 persistentKeys = false;
27 # The NixOS module will generate new keys and a new IPv6 address each time
28 # it is started if persistentKeys is not enabled.
32 # Yggdrasil will automatically connect and "peer" with other nodes it
33 # discovers via link-local multicast annoucements. Unless this is the
34 # case (it probably isn't) a node needs peers within the existing
35 # network that it can tunnel to.
38 # Public peers can be found at
39 # https://github.com/yggdrasil-network/public-peers
47 <section xml:id="module-services-networking-yggdrasil-configuration-prefix">
48 <title>Persistent node with prefix</title>
50 A node with a fixed address that announces a prefix:
53 address = "210:5217:69c0:9afc:1b95:b9f:8718:c3d2";
54 prefix = "310:5217:69c0:9afc";
55 # taken from the output of "yggdrasilctl getself".
58 services.yggdrasil = {
60 persistentKeys = true; # Maintain a fixed public key and IPv6 address.
62 Peers = [ "tcp://1.2.3.4:1024" "tcp://1.2.3.5:1024" ];
64 # This information is visible to the network.
65 name = config.networking.hostName;
66 location = "The North Pole";
71 boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
72 # Forward traffic under the prefix.
74 networking.interfaces.${eth0}.ipv6.addresses = [{
75 # Set a 300::/8 address on the local physical device.
76 address = prefix + "::1";
81 # Annouce the 300::/8 prefix to eth0.
87 prefix ${prefix}::/64 {
99 <section xml:id="module-services-networking-yggdrasil-configuration-container">
100 <title>Yggdrasil attached Container</title>
102 A NixOS container attached to the Yggdrasil network via a node running on the
106 yggPrefix64 = "310:5217:69c0:9afc";
107 # Again, taken from the output of "yggdrasilctl getself".
110 boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
111 # Enable IPv6 forwarding.
114 bridges.br0.interfaces = [ ];
115 # A bridge only to containers…
118 # … configured with a prefix address.
120 address = "${yggPrefix64}::1";
128 privateNetwork = true;
130 # Attach the container to the bridge only.
131 config = { config, pkgs, ... }: {
132 networking.interfaces.eth0.ipv6 = {
134 # Configure a prefix address.
135 address = "${yggPrefix64}::2";
139 # Configure the prefix route.
142 via = "${yggPrefix64}::1";
146 services.httpd.enable = true;
147 networking.firewall.allowedTCPPorts = [ 80 ];