<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Go on Philly Mesh</title><link>https://prm.boda.dev/tags/go/</link><description>Philly Mesh (Go)</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Fri, 05 Jan 2018 14:46:04 +0000</lastBuildDate><atom:link href="https://prm.boda.dev/tags/go/index.xml" rel="self" type="application/rss+xml"/><item><title>Installing Yggdrasil – A Toy Implementation of an Encrypted IPv6 Network</title><link>https://prm.boda.dev/2018/01/05/installing-yggdrasil-a-toy-implementation-of-an-encrypted-ipv6-network/</link><pubDate>Fri, 05 Jan 2018 14:46:04 +0000</pubDate><author>Mike Dank (Famicoman)</author><guid>https://prm.boda.dev/2018/01/05/installing-yggdrasil-a-toy-implementation-of-an-encrypted-ipv6-network/</guid><description>&lt;p>&lt;em>&lt;strong>2018-08-29 Update: This tutorial is now very out of date. The Yggdrasil team now maintains great installation guides &lt;a href="https://yggdrasil-network.github.io/platforms.html">here&lt;/a>.&lt;/strong>&lt;/em>&lt;/p>
&lt;p>At Philly Mesh, we like to play around with pieces of technology that aren&amp;rsquo;t directly related to our core software stack. One such piece of software is &lt;a href="https://github.com/Arceliar/yggdrasil-go">Yggdrasil&lt;/a>, an encrypted IPv6 networking implementation developed by &lt;a href="https://github.com/Arceliar">Arceliar&lt;/a>. Yggdrasil borrows many ideas from &lt;a href="https://github.com/cjdelisle/cjdns">cjdns&lt;/a>, but was primarily written to test a new routing scheme developed by Arceliar. While it is not production-ready software, Yggdrasil is an interesting foray into encrypted networking and fun to experiment with.&lt;/p>
&lt;p>For this installation guide, we assume a Debian Stretch (or similar) Linux system with a non-root, sudo user.&lt;/p>
&lt;p>First, we need to make sure we have a recent version of &lt;code>go&lt;/code>. We can check our version using the following command:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ go --version
go version go1.9.2 linux/amd64
&lt;/code>&lt;/pre>&lt;p>Yggdrasil is built with Go 1.9. At the time of writing, Debian Stretch only comes with Go 1.3. If you need to install a more recent version of Go, you can do so manually. Below is an example installing Go 1.9.2 for the amd64 architecture using a download link from &lt;a href="https://golang.org/dl/">https://golang.org/dl/&lt;/a>:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ sudo apt-get remove golang
$ cd /usr/local
$ sudo wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz
$ sudo tar -xzf go1.9.2.linux-amd64.tar.gz
$ sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
&lt;/code>&lt;/pre>&lt;p>Now we will set up some environment variables to use Go:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ mkdir ~/go
$ export GOROOT=/usr/local/go
&lt;/code>&lt;/pre>&lt;p>Now we are ready to install Yggdrasil:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ cd ~
$ git clone https://github.com/Arceliar/yggdrasil-go.git
$ cd yggdrasil-go/
$ ./build
&lt;/code>&lt;/pre>&lt;p>If all goes well, Yggdrasil will have built successfully with no errors. Now we are ready to generate a config file:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ ./yggdrasil --genconf &amp;gt; conf.json
&lt;/code>&lt;/pre>&lt;p>The config file is pretty basic and allows for some customization:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ cat conf.json
{
&amp;#34;Listen&amp;#34;: &amp;#34;[::]:0&amp;#34;,
&amp;#34;Peers&amp;#34;: [],
&amp;#34;BoxPub&amp;#34;: &amp;#34;46d18cbcfa0d510fcd226f323efe279525c50eb15db925d4879ee675b99b0724&amp;#34;,
&amp;#34;BoxPriv&amp;#34;: &amp;#34;727213ecb3caf601ee49596fa77469674bed177f10d8607ee76ec1f35e942310&amp;#34;,
&amp;#34;SigPub&amp;#34;: &amp;#34;08565493e805e905dbcc22cdaa7e60bd6cb6fc1df21d1b807b46f6285f8b86fd&amp;#34;,
&amp;#34;SigPriv&amp;#34;: &amp;#34;4173f91e08ab2b6f7c5ae96cf9d61f7ac30b36be7a5eff298e00e0d08f6f5c9608565493e805e905dbcc22cdaa7e60bd6cb6fc1df21d1b807b46f6285f8b86fd&amp;#34;,
&amp;#34;Multicast&amp;#34;: true
}
&lt;/code>&lt;/pre>&lt;p>If you want Yggdrasil to listen on a static port, you can change the &lt;code>Listen&lt;/code> attribute to use an IP and/or port of your choosing like &lt;code>&amp;quot;12.34.57.78:1234&amp;quot;&lt;/code>. You can add entries to the &lt;code>Peers&lt;/code> attribute by listing them as strings (IP:PORT) in the array (comma-separated). The &lt;code>Multicast&lt;/code> attribute is currently set to &lt;code>true&lt;/code>, but you could set this to &lt;code>false&lt;/code> if you didn&amp;rsquo;t want to auto-peer for some reason.&lt;/p>
&lt;p>Here is a sample config that listens on port &lt;code>1234&lt;/code> on all interfaces and connects to a peer at &lt;code>12.34.57.78:1234&lt;/code>:&lt;/p>
&lt;pre tabindex="0">&lt;code>cat conf.json
{
&amp;#34;Listen&amp;#34;: &amp;#34;[::]:1234&amp;#34;,
&amp;#34;Peers&amp;#34;: [&amp;#34;12.34.57.78:1234&amp;#34;],
&amp;#34;BoxPub&amp;#34;: &amp;#34;46d18cbcfa0d510fcd226f323efe279525c50eb15db925d4879ee675b99b0724&amp;#34;,
&amp;#34;BoxPriv&amp;#34;: &amp;#34;727213ecb3caf601ee49596fa77469674bed177f10d8607ee76ec1f35e942310&amp;#34;,
&amp;#34;SigPub&amp;#34;: &amp;#34;08565493e805e905dbcc22cdaa7e60bd6cb6fc1df21d1b807b46f6285f8b86fd&amp;#34;,
&amp;#34;SigPriv&amp;#34;: &amp;#34;4173f91e08ab2b6f7c5ae96cf9d61f7ac30b36be7a5eff298e00e0d08f6f5c9608565493e805e905dbcc22cdaa7e60bd6cb6fc1df21d1b807b46f6285f8b86fd&amp;#34;,
&amp;#34;Multicast&amp;#34;: true
}
&lt;/code>&lt;/pre>&lt;p>Now, we can start Yggdrasil in the background:&lt;/p>
&lt;pre tabindex="0">&lt;code>sudo ./yggdrasil --useconf &amp;lt; conf.json &amp;amp;
&lt;/code>&lt;/pre>&lt;p>You should now have a &lt;code>tun&lt;/code> interface up for your Yggdrasil node:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ ip a
43: tun1: &amp;lt;POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP&amp;gt; mtu 1280 qdisc pfifo_fast state UNKNOWN group default qlen 500
link/none
inet6 fd00:4645:d147:7c16:98f2:20ea:d0ba:7174/8 scope global
valid_lft forever preferred_lft forever
&lt;/code>&lt;/pre>&lt;p>Now, you can ping other Yggdrasil nodes on the network:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ ping6 -c4 fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e
PING fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e(fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e) 56 data bytes
64 bytes from fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e: icmp_seq=1 ttl=64 time=14.4 ms
64 bytes from fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e: icmp_seq=2 ttl=64 time=12.6 ms
64 bytes from fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e: icmp_seq=3 ttl=64 time=15.1 ms
64 bytes from fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e: icmp_seq=4 ttl=64 time=12.9 ms
--- fd1f:dd73:7cdb:773b:a924:7ec0:800b:221e ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 12.673/13.783/15.105/1.017 ms
&lt;/code>&lt;/pre>&lt;p>Further documentation for Yggdrasil is available &lt;a href="https://github.com/Arceliar/yggdrasil-go/blob/master/doc/README.md">here&lt;/a>, and a whitepaper draft is available &lt;a href="https://github.com/Arceliar/yggdrasil-go/blob/master/doc/Whitepaper.md">here&lt;/a>.&lt;/p></description></item></channel></rss>