<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Wireguard – Yeri Tiete</title>
    <link>https://yeri.be/tag/wireguard/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Fri, 26 Jun 2020 18:24:00 +0200</lastBuildDate>
    <atom:link href="https://yeri.be/tag/wireguard/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Ideal travel router: GL-AR750S</title>
      <link>https://yeri.be/ideal-travel-router-gl-ar750s/</link>
      <pubDate>Fri, 26 Jun 2020 18:24:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/ideal-travel-router-gl-ar750s/</guid><enclosure url="https://static.yeri.be/2020/04/ar750s-ext_1000x1000.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;Right. With the pandemic and all none of us are going to travel much but still...&lt;/p&gt;&#xA;&lt;p&gt;About a year ago I purchased myself an &lt;a class=&#34;aioseop-link&#34; rel=&#34;noreferrer noopener&#34; href=&#34;https://www.gl-inet.com/products/gl-ar750s/&#34; target=&#34;_blank&#34;&gt;OpenWRT router&lt;/a&gt; to use on the plane and in hotels.&lt;/p&gt;&#xA;&lt;p&gt;And so far I really like both the device and the Hong Kong based brand (launching new and updated products, and releasing relatively regular updates for older products). Pick a device that fits your needs (&lt;a href=&#34;https://www.gl-inet.com/products/gl-mt300n-v2/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;USB powered&lt;/a&gt;? &lt;a href=&#34;https://www.gl-inet.com/products/gl-e750/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;LTE&lt;/a&gt;? &lt;a href=&#34;https://www.gl-inet.com/products/vixmini/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;Small form factor&lt;/a&gt;?). &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/04/ar750s-ext_1000x1000.jpg" alt="Ideal travel router: GL-AR750S"></p><p>Right. With the pandemic and all none of us are going to travel much but still...</p>
<p>About a year ago I purchased myself an <a class="aioseop-link" rel="noreferrer noopener" href="https://www.gl-inet.com/products/gl-ar750s/" target="_blank">OpenWRT router</a> to use on the plane and in hotels.</p>
<p>And so far I really like both the device and the Hong Kong based brand (launching new and updated products, and releasing relatively regular updates for older products). Pick a device that fits your needs (<a href="https://www.gl-inet.com/products/gl-mt300n-v2/" target="_blank" rel="noreferrer noopener">USB powered</a>? <a href="https://www.gl-inet.com/products/gl-e750/" target="_blank" rel="noreferrer noopener">LTE</a>? <a href="https://www.gl-inet.com/products/vixmini/" target="_blank" rel="noreferrer noopener">Small form factor</a>?). </p>
<p>The GL-AR750S aka Slate is fully customizable but runs a few nice things out of the box: <a href="https://yeri.be/wireguard" target="_blank" rel="noreferrer noopener">WireGuard</a> (with a physical button to turn it on or off), <a href="https://yeri.be/tag/openvpn" target="_blank" rel="noreferrer noopener">OpenVPN</a>, shell access, Tor (requires the latest firmware), <a href="https://yeri.be/tag/ipv6" target="_blank" rel="noreferrer noopener">IPv6</a>, <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" rel="noreferrer noopener">DoH</a> (<a href="https://web.archive.org/web/20210827100952/https://developers.cloudflare.com/1.1.1.1/dns-over-https" target="_blank" rel="noreferrer noopener">Cloudflare</a> only for now), multiple SSIDs (i.e. Guest WiFi), and more. </p>
<p>Oh and I specifically picked this version (compared to <a href="https://www.gl-inet.com/products/" target="_blank" rel="noreferrer noopener">other or cheaper ones</a>) because it had both 2.4Ghz and 5Ghz, as well as 3 Gbit ports (1x WAN, 2x LAN).</p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/glinet-compare-1.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/glinet-compare-1-1024x694.png" alt="" class="wp-image-9088"/></a><figcaption>Pick whatever works for you...</figcaption></figure></div>
<p>I use the device on flights, where I connect to the network once in the air, purchase WiFi or use <a href="http://web.archive.org/web/20240228214834/https://www.ipass.com/inflight-internet/" target="_blank" rel="noreferrer noopener">iPass</a> "for one device" and then connect to the interwebs behind my <a href="https://en.wikipedia.org/wiki/Network_address_translation" target="_blank" rel="noreferrer noopener">NAT</a>-router from my iPad, phone(s), laptop(s), and even <a href="https://yeri.be/shan-wong-sketching" title="Shan Wong sketching" target="_blank" rel="noreferrer noopener">Shan</a>'s devices if she is travelling with me.</p>
<p>In hotels, I either connect it to the wired ethernet, if still available (tends to be more stable), or connect it to the guest WiFi and then connect my devices to the router: saves me from connecting to a new network and typing the room number and login/password/family name on every device. And once again hides the true number of connected devices; quite handy trick for those pesky hotels providing free access only to two devices.</p>
<p>Sure it takes a bit of setup every time: find a working USB port, sign in to the web interface, search for new networks if this is a new hotel or I haven't travelled on this airline, connect to said network, sign in with iPass, and optionally enable VPN)...</p>
<p>And once in a while some fiddling with VPN or DNS that's borking up or being blocked by overzealous firewalls. </p>
<p>Also, some in-flight entertainment USB ports don't provide enough power (and/or are often broken -- looking at you Lufthansa in economy) so be sure to carry <a href="https://www.apple.com/shop/product/MD810LL/A/apple-5w-usb-power-adapter?fnode=83f41015933a91450d5764c4af01b7dcde6df42b8f2bd3d69b5785e0ebe48054e25d0a20aee428acbd11aa75bf2c77677833fecc12d57e28996bdafa64dfb0a43baa67bb1e79a1e51318f290bc482600cab20f21c35e5c95c94188846e9c860c366a443744dd092235bfa2928b330b8f&amp;fs=fh%3D458e%252B45d4" target="_blank" rel="noreferrer noopener nofollow sponsored">a couple of these</a> (US-plug works best) -- I've already forgotten one on my last flight from <a href="https://my.flightradar24.com/Tuinslak" target="_blank" rel="noreferrer noopener">MUC-SIN</a> on LH, but luckily I have pretty easy access to these. </p>
<p>If you travel a lot it's totally worth the money.</p>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>networking</category><category>software</category>
      <category>china</category><category>openvpn</category><category>openwrt</category><category>router</category><category>wifi</category><category>wireguard</category>
    </item>
    
    <item>
      <title>Running WireGuard in a Docker container (RPi)</title>
      <link>https://yeri.be/running-wireguard-in-a-docker-container-rpi/</link>
      <pubDate>Fri, 08 May 2020 18:10:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/running-wireguard-in-a-docker-container-rpi/</guid><enclosure url="https://static.yeri.be/2020/04/wg-liana.png" length="0" type="image/png" />
      <description>&lt;p&gt;This follows the my two other posts about &lt;a href=&#34;https://yeri.be/wireguard&#34; target=&#34;_blank&#34; aria-label=&#34;WireGuard (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;WireGuard&lt;/a&gt;. &lt;/p&gt;&#xA;&lt;p&gt;Most of this can be copied from &lt;a aria-label=&#34;the amd64 post (opens in a new tab)&#34; href=&#34;https://yeri.be/running-wireguard-in-a-docker-container-(amd64)&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;the amd64 post&lt;/a&gt; -- with a minor change for making it work on RPi4. &lt;a aria-label=&#34;This is the full Git repo (opens in a new tab)&#34; href=&#34;https://gitlab.com/yeri/wireguard-docker/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;This is the full &lt;/a&gt;&lt;a href=&#34;https://gitlab.com/yeri/wireguard-docker/&#34; target=&#34;_blank&#34; aria-label=&#34;This is the full Git repo (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;g&lt;/a&gt;&lt;a aria-label=&#34;This is the full Git repo (opens in a new tab)&#34; href=&#34;https://gitlab.com/yeri/wireguard-docker/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;it repo&lt;/a&gt; (including both rpi and amd64). &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/04/wg-liana.png" alt="Running WireGuard in a Docker container (RPi)"></p><p>This follows the my two other posts about <a href="https://yeri.be/wireguard" target="_blank" aria-label="WireGuard (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">WireGuard</a>. </p>
<p>Most of this can be copied from <a aria-label="the amd64 post (opens in a new tab)" href="https://yeri.be/running-wireguard-in-a-docker-container-(amd64)" target="_blank" rel="noreferrer noopener" class="aioseop-link">the amd64 post</a> -- with a minor change for making it work on RPi4. <a aria-label="This is the full Git repo (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/" target="_blank" rel="noreferrer noopener" class="aioseop-link">This is the full </a><a href="https://gitlab.com/yeri/wireguard-docker/" target="_blank" aria-label="This is the full Git repo (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">g</a><a aria-label="This is the full Git repo (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/" target="_blank" rel="noreferrer noopener" class="aioseop-link">it repo</a> (including both rpi and amd64). </p>
<p>The main difference is in the <a aria-label="run.sh file (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/-/blob/master/liana.run.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">run.sh file</a>. The installation is a bit different and we'll need to install the Raspberry Pi kernel headers. </p>
<p>WireGuard is also installed from testing instead of Debian backports. </p>
<p>Note that for older RPi's (ie gen 1) you'll need to <a href="https://github.com/adrianmihalko/raspberrypiwireguard" target="_blank" aria-label="compile from scratch (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">compile from scratch</a>. </p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category>
      <category>debian</category><category>docker</category><category>raspberrypi</category><category>wireguard</category>
    </item>
    
    <item>
      <title>Error! Bad return status for module build on kernel: 4.19.0-8-amd64 (x86_64)</title>
      <link>https://yeri.be/error-bad-return-status-for-module-build-on-kernel-4-19-0-8-amd64-x86-64/</link>
      <pubDate>Mon, 04 May 2020 14:01:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/error-bad-return-status-for-module-build-on-kernel-4-19-0-8-amd64-x86-64/</guid><enclosure url="https://static.yeri.be/2020/05/WireGuard-dkms-crash.png" length="0" type="image/png" />
      <description>&lt;p&gt;I was rebuilding my &lt;a aria-label=&#34;WireGuard (opens in a new tab)&#34; href=&#34;https://yeri.be/tag/wireguard&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;WireGuard&lt;/a&gt; &lt;a aria-label=&#34;Docker (opens in a new tab)&#34; href=&#34;https://yeri.be/running-wireguard-in-a-docker-container-amd64&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;Docker&lt;/a&gt; container today and this error started popping up:&lt;/p&gt;&#xA;&lt;pre class=&#34;wp-block-code&#34;&gt;&lt;code&gt;Setting up dkms (2.6.1-4) ...&#xA;Setting up wireguard-dkms (1.0.20200429-1~bpo10+1) ...&#xA;Loading new wireguard-1.0.20200429 DKMS files...&#xA;It is likely that 4.19.0-8-cloud-amd64 belongs to a chroot&#39;s host&#xA;Building for 4.19.0-8-amd64 and 4.19.0-8-cloud-amd64&#xA;Building initial module for 4.19.0-8-amd64&#xA;Error! Bad return status for module build on kernel: 4.19.0-8-amd64 (x86_64)&#xA;Consult /var/lib/dkms/wireguard/1.0.20200429/build/make.log for more information.&#xA;dpkg: error processing package wireguard-dkms (--configure):&#xA; installed wireguard-dkms package post-installation script subprocess returned error exit status 10&#xA;Setting up build-essential (12.6) ...&#xA;Setting up libalgorithm-diff-xs-perl (0.04-5+b1) ...&#xA;Setting up libalgorithm-merge-perl (0.08-3) ...&#xA;dpkg: dependency problems prevent configuration of wireguard:&#xA; wireguard depends on wireguard-dkms (&gt;= 0.0.20200121-2) | wireguard-modules (&gt;= 0.0.20191219); however:&#xA;  Package wireguard-dkms is not configured yet.&#xA;  Package wireguard-modules is not installed.&#xA;&#xA;dpkg: error processing package wireguard (--configure):&#xA; dependency problems - leaving unconfigured&#xA;Processing triggers for systemd (241-7~deb10u3) ...&#xA;Processing triggers for libc-bin (2.28-10) ...&#xA;Errors were encountered while processing:&#xA; wireguard-dkms&#xA; wireguard&#xA;E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The solution was to install &lt;code&gt;bc&lt;/code&gt;. Seems like Debian is not pulling the right dependencies. I&#39;ll be adding it to my Dockerfile.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/05/WireGuard-dkms-crash.png" alt="Error! Bad return status for module build on kernel: 4.19.0-8-amd64 (x86_64)"></p><p>I was rebuilding my <a aria-label="WireGuard (opens in a new tab)" href="https://yeri.be/tag/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link">WireGuard</a> <a aria-label="Docker (opens in a new tab)" href="https://yeri.be/running-wireguard-in-a-docker-container-amd64" target="_blank" rel="noreferrer noopener" class="aioseop-link">Docker</a> container today and this error started popping up:</p>
<pre class="wp-block-code"><code>Setting up dkms (2.6.1-4) ...
Setting up wireguard-dkms (1.0.20200429-1~bpo10+1) ...
Loading new wireguard-1.0.20200429 DKMS files...
It is likely that 4.19.0-8-cloud-amd64 belongs to a chroot's host
Building for 4.19.0-8-amd64 and 4.19.0-8-cloud-amd64
Building initial module for 4.19.0-8-amd64
Error! Bad return status for module build on kernel: 4.19.0-8-amd64 (x86_64)
Consult /var/lib/dkms/wireguard/1.0.20200429/build/make.log for more information.
dpkg: error processing package wireguard-dkms (--configure):
 installed wireguard-dkms package post-installation script subprocess returned error exit status 10
Setting up build-essential (12.6) ...
Setting up libalgorithm-diff-xs-perl (0.04-5+b1) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
dpkg: dependency problems prevent configuration of wireguard:
 wireguard depends on wireguard-dkms (>= 0.0.20200121-2) | wireguard-modules (>= 0.0.20191219); however:
  Package wireguard-dkms is not configured yet.
  Package wireguard-modules is not installed.

dpkg: error processing package wireguard (--configure):
 dependency problems - leaving unconfigured
Processing triggers for systemd (241-7~deb10u3) ...
Processing triggers for libc-bin (2.28-10) ...
Errors were encountered while processing:
 wireguard-dkms
 wireguard
E: Sub-process /usr/bin/dpkg returned an error code (1)</code></pre>
<p>The solution was to install <code>bc</code>. Seems like Debian is not pulling the right dependencies. I'll be adding it to my Dockerfile.</p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category>
      <category>debian</category><category>docker</category><category>wireguard</category>
    </item>
    
    <item>
      <title>Running WireGuard in a Docker container (amd64)</title>
      <link>https://yeri.be/running-wireguard-in-a-docker-container-amd64/</link>
      <pubDate>Fri, 01 May 2020 17:09:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/running-wireguard-in-a-docker-container-amd64/</guid><enclosure url="https://static.yeri.be/2020/05/wg-ocean.png" length="0" type="image/png" />
      <description>&lt;p&gt;This is the 2nd post about &lt;a aria-label=&#34;WireGuard (opens in a new tab)&#34; href=&#34;https://yeri.be/tag/wireguard&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;WireGuard&lt;/a&gt;. &lt;/p&gt;&#xA;&lt;p&gt;So I am running two &lt;a aria-label=&#34;WireGuard (opens in a new tab)&#34; href=&#34;https://yeri.be/wireguard&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;WireGuard&lt;/a&gt; servers -- one on a Raspberry Pi 4, and one in an amd64 virtual machine. This post will be about getting WireGuard working on amd64 in a Docker container. &lt;/p&gt;&#xA;&lt;p&gt;As this container rarely get rebuild, I am running &lt;a aria-label=&#34;unattended-upgrades (opens in a new tab)&#34; href=&#34;https://wiki.debian.org/UnattendedUpgrades&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;unattended-upgrades&lt;/a&gt; inside the container to make sure security updates are applied. &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/05/wg-ocean.png" alt="Running WireGuard in a Docker container (amd64)"></p><p>This is the 2nd post about <a aria-label="WireGuard (opens in a new tab)" href="https://yeri.be/tag/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link">WireGuard</a>. </p>
<p>So I am running two <a aria-label="WireGuard (opens in a new tab)" href="https://yeri.be/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link">WireGuard</a> servers -- one on a Raspberry Pi 4, and one in an amd64 virtual machine. This post will be about getting WireGuard working on amd64 in a Docker container. </p>
<p>As this container rarely get rebuild, I am running <a aria-label="unattended-upgrades (opens in a new tab)" href="https://wiki.debian.org/UnattendedUpgrades" target="_blank" rel="noreferrer noopener" class="aioseop-link">unattended-upgrades</a> inside the container to make sure security updates are applied. </p>
<p>I am also running <a aria-label="Bind9 (opens in a new tab)" href="https://wiki.debian.org/Bind9" target="_blank" rel="noreferrer noopener" class="aioseop-link">Bind9</a> to act as a caching DNS server inside the container. Ideally this should be running from its dedicated container but that makes everything more complicated and not worth it for what I am trying. </p>
<p>I am also </p>
<p>The public repo that acts as a proof of concept can be found <a href="https://gitlab.com/yeri/wireguard-docker" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">here</a>. </p>
<p><a href="https://gitlab.com/yeri/wireguard-docker/-/blob/master/start.sh" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">start.sh</a> -- this file starts (or restarts) and builds the container. It will also create the files as needed, set the forwarding DNS server, etc. </p>
<p><a href="https://gitlab.com/yeri/wireguard-docker/-/blob/master/Dockerfile" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Dockerfile</a> -- the example will start a basic container based on debian-slim, set up the port forwarding, install the tools we need, and copy over the configs</p>
<p><a href="https://gitlab.com/yeri/wireguard-docker/-/blob/master/ocean.run.sh" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">run.sh</a> -- this file will be executed after the container has been built. We need to install WireGuard from this file or it will fail due to the volume not being mounted and not having the right params. <br />This will also start the named (bind9) server. <br />I manually set <code>ip address add dev wg0 10.200.200.1/24</code> because using Address in <code>wg0.conf</code> caused issues. I haven't recently tested if that's still the case. </p>
<p><a aria-label=" (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/-/blob/master/files/named.conf.options.default" target="_blank" rel="noreferrer noopener" class="aioseop-link">named.conf.options</a> -- pretty standard bind9 config file; I want to be in control of my <a aria-label="forwarding (opens in a new tab)" href="https://docstore.mik.ua/orelly/networking_2ndEd/dns/ch10_05.htm" target="_blank" rel="noreferrer noopener" class="aioseop-link">forwarding</a> server because I am using <a aria-label="NextDNS (opens in a new tab)" href="https://yeri.be/tag/nextdns" target="_blank" rel="noreferrer noopener" class="aioseop-link">NextDNS</a> and want to apply a different config. </p>
<p>And of course your <a aria-label="wg0.conf (opens in a new tab)" href="https://gitlab.com/yeri/wireguard-docker/-/blob/master/files/ocean.wg0.conf" target="_blank" rel="noreferrer noopener" class="aioseop-link">wg0.conf</a>. </p>
<p>Running <code>docker exec wireguard wg</code> should give details about your connected hosts. </p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category>
      <category>debian</category><category>docker</category><category>wireguard</category>
    </item>
    
    <item>
      <title>WireGuard</title>
      <link>https://yeri.be/wireguard/</link>
      <pubDate>Mon, 27 Apr 2020 20:34:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/wireguard/</guid><enclosure url="https://static.yeri.be/2020/04/WireGuard-network.png" length="0" type="image/png" />
      <description>&lt;p&gt;This is the first post of &lt;a href=&#34;https://yeri.be/tag/wireguard&#34; target=&#34;_blank&#34; aria-label=&#34; (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;several&lt;/a&gt;. Next posts will focus on running WireGuard inside a Docker container on &lt;a href=&#34;https://yeri.be/running-wireguard-in-a-docker-container-(amd64)&#34; target=&#34;_blank&#34; aria-label=&#34;amd64 Linux (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;amd64 Linux&lt;/a&gt; and a &lt;a href=&#34;https://yeri.be/running-wireguard-in-a-docker-container-rpi&#34; target=&#34;_blank&#34; aria-label=&#34;Raspberry Pi (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;Raspberry Pi&lt;/a&gt;. &lt;/p&gt;&#xA;&lt;p&gt;I&#39;ve been running &lt;a aria-label=&#34;Wireguard (opens in a new tab)&#34; href=&#34;https://www.wireguard.com/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;WireGuard&lt;/a&gt; for a few months now and I&#39;ve been loving it. &lt;/p&gt;&#xA;&lt;p&gt;I first started using it about a year ago when in &lt;a aria-label=&#34;China (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://yeri.be/tag/china&#34; target=&#34;_blank&#34;&gt;China&lt;/a&gt; — OpenVPN was once again being actively blocked and it was driving me nuts. Overnight I set up a &lt;a aria-label=&#34;DigitalOcean (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://m.do.co/c/3276c58fdbfd&#34; target=&#34;_blank&#34;&gt;DigitalOcean&lt;/a&gt; server in Singapore and ran WireGuard from it — both my phone and laptop were able to actively bypass the &lt;a aria-label=&#34;GFW (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://yeri.be/tag/gfw&#34; target=&#34;_blank&#34;&gt;GFW&lt;/a&gt; and (at that time) surf the internet freely once more. As WireGuard gains popularity, I am sure the GFW will start detecting it — it&#39;s a quiet but not a stealthy &lt;a aria-label=&#34;protocol (opens in a new tab)&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34; href=&#34;https://www.wireguard.com/protocol/&#34; target=&#34;_blank&#34;&gt;protocol&lt;/a&gt;. &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/04/WireGuard-network.png" alt="WireGuard"></p><p>This is the first post of <a href="https://yeri.be/tag/wireguard" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">several</a>. Next posts will focus on running WireGuard inside a Docker container on <a href="https://yeri.be/running-wireguard-in-a-docker-container-(amd64)" target="_blank" aria-label="amd64 Linux (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">amd64 Linux</a> and a <a href="https://yeri.be/running-wireguard-in-a-docker-container-rpi" target="_blank" aria-label="Raspberry Pi (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Raspberry Pi</a>. </p>
<p>I've been running <a aria-label="Wireguard (opens in a new tab)" href="https://www.wireguard.com/" target="_blank" rel="noreferrer noopener" class="aioseop-link">WireGuard</a> for a few months now and I've been loving it. </p>
<p>I first started using it about a year ago when in <a aria-label="China (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://yeri.be/tag/china" target="_blank">China</a> — OpenVPN was once again being actively blocked and it was driving me nuts. Overnight I set up a <a aria-label="DigitalOcean (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://m.do.co/c/3276c58fdbfd" target="_blank">DigitalOcean</a> server in Singapore and ran WireGuard from it — both my phone and laptop were able to actively bypass the <a aria-label="GFW (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://yeri.be/tag/gfw" target="_blank">GFW</a> and (at that time) surf the internet freely once more. As WireGuard gains popularity, I am sure the GFW will start detecting it — it's a quiet but not a stealthy <a aria-label="protocol (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://www.wireguard.com/protocol/" target="_blank">protocol</a>. </p>
<p>Since then I've dug quite a bit deeper in WireGuard and am really looking forward to what it's going to bring. </p>
<p>WireGuard differentiates itself to be an extremely simple VPN server (which can make getting started and debugging a bit more challenging) — but it wants to seamlessly work together with existing tools. One of the main features still missing is for example running a DHCP server on the server and dynamically assigning IPs (like oVPN does). </p>
<figure class="wp-block-image size-large"><a href="https://static.yeri.be/2020/04/WireGuard-network.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/04/WireGuard-network.png" alt="WireGuard network" class="wp-image-8750"/></a><figcaption>Simplified diagram of my network. Using static routing my clients can access the WireGuard network even without running WireGuard directly. (Some of) my containers are also able to access the network, this allows me to run Resilio Sync over WireGuard. It's using one big subnet to create one big LAN. </figcaption></figure>
<p>It's also pretty cool because any node can both be a server and a client at the same time. In my setup I am running two servers: one running at home in Singapore on a RPi4 (1Gbit fiber connection) and one on a virtual machine in <a aria-label="Amsterdam (opens in a new tab)" href="https://yeri.be/tag/rootspirit/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Amsterdam</a> (1Gbit as well). The RPis at my parents are connected to the server in Amsterdam, my iPad and phones are connected to the server in Singapore. If I am in Europe I might switch over and let my iDevices connect to the AMS server instead. </p>
<figure class="wp-block-image size-large"><a href="https://static.yeri.be/2020/04/WireGuard-and-traffic-shaping.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/04/WireGuard-and-traffic-shaping-1024x150.png" alt="WireGuard and traffic shaping" class="wp-image-8751"/></a><figcaption>Click to enlarge. <br />Bandwidth stats from Resilio Sync, transferring several big files. We can clearly see a speed increase (from 2-5mb/s to 11mb/s) when routing the exact same traffic over WireGuard. <a aria-label="Traffic shaping (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://en.wikipedia.org/wiki/Traffic_shaping" target="_blank">Traffic shaping</a> at its best.</figcaption></figure>
<p>The example above clearly shows speed gains by cloaking the traffic in UDP packets. The shared folder has only two nodes (sender and receiver) and shows several big files being transferred from Amsterdam to Singapore. <a aria-label="Resilio Sync (opens in a new tab)" href="https://www.resilio.com/individuals/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Resilio Sync</a> uses the <a aria-label="Bittorrent protocol (opens in a new tab)" href="https://en.wikipedia.org/wiki/Resilio_Sync#Technology" target="_blank" rel="noreferrer noopener" class="aioseop-link">Bittorrent protocol</a>, something ISPs generally hate and tend to slow down as much as they can — thanks Starhub. </p>
<p>Wireguard also allows the client to decide what to route through the server: only the VPN LAN traffic, or a whole subnet, or 0.0.0.0/0? So for my iPhone I for example route all traffic through VPN to avoid hotel/airport/... WiFi's to mine/log/scan my data. For my laptop I have two configs, one to only connect to the LAN, but another that routes all my traffic through the VPN if I want to avoid exposure or circumvent censoring. </p>
<p>Note that I am not running WireGuard to remain anonymous and I'll definitely leak some information — just trying to minimise and remain in control of what I leak. This is not a <a aria-label="Tor (opens in a new tab)" rel="noreferrer noopener" href="https://www.torproject.org/" target="_blank" class="aioseop-link">Tor</a> replacement. </p>
]]></content:encoded>
      <category>linux</category><category>networking</category><category>software</category>
      <category>debian</category><category>docker</category><category>raspberrypi</category><category>vpn</category><category>wireguard</category>
    </item>
    
    <item>
      <title>Box — Docker shell server</title>
      <link>https://yeri.be/box-docker-shell-server/</link>
      <pubDate>Fri, 24 Apr 2020 10:27:00 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/box-docker-shell-server/</guid><enclosure url="https://static.yeri.be/2020/04/box.png" length="0" type="image/png" />
      <description>&lt;p&gt;A couple of months ago I had the great idea to set up a shell server in Docker. Simply because my docker skillz were quite rusty and a shell server was something I actually genuinely needed. &lt;/p&gt;&#xA;&lt;p&gt;Shell servers... so 2005. I remember in the good old IRC days people asking for (free) shell servers to run their &lt;a aria-label=&#34;eggdrop (opens in a new tab)&#34; href=&#34;https://eggheads.org/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34; class=&#34;aioseop-link&#34;&gt;eggdrop&lt;/a&gt; and stuff. OMG am I getting old? Anyhow... &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/04/box.png" alt="Box — Docker shell server"></p><p>A couple of months ago I had the great idea to set up a shell server in Docker. Simply because my docker skillz were quite rusty and a shell server was something I actually genuinely needed. </p>
<p>Shell servers... so 2005. I remember in the good old IRC days people asking for (free) shell servers to run their <a aria-label="eggdrop (opens in a new tab)" href="https://eggheads.org/" target="_blank" rel="noreferrer noopener" class="aioseop-link">eggdrop</a> and stuff. OMG am I getting old? Anyhow... </p>
<p>I ssh quite often. I manage quite a few <a href="https://yeri.be/tag/rootspirit" target="_blank" aria-label="servers (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">servers</a> (~15?) and <a href="https://yeri.be/?s=edgerouter" target="_blank" aria-label="routers (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">routers</a> that require me to login and do some random stuff. I also work on a laptop quite often and that means closing the lid and moving around. </p>
<p>First of all, <a aria-label=" (opens in a new tab)" href="https://mosh.org/" target="_blank" rel="noreferrer noopener" class="aioseop-link">mosh</a> is amazing and allows you to stay connected via ssh, even with crappy (airport/hotel) internet as well as moving around networks -- that solves half the problem. If you are not using it, start using it now!</p>
<p>Second, during my <a aria-label="datacenter technician (opens in a new tab)" href="https://www.google.com/about/datacenters/" target="_blank" rel="noreferrer noopener" class="aioseop-link">datacenter technician</a> days at Google we used to have a "jump server" -- a shell server that allowed us to bridge the corporate network and ssh into prod machines. Doubt that's still used nowadays, but the idea stuck. I wanted something similar to ssh from, wherever I was, and easily connect to my servers. And as the network the shell server is running on is stable, I only need to use mosh to the shell server. Thereafter, the connection very rarely dies. </p>
<p>And I guess, third, I recently purchased an iPad Pro and I really need to have my local "dev" environment with my git repo that I edit quite frequently but iPadOS isn't really your average computer, and doesn't even have a proper terminal. This is my experiment to make iPadOS work as a main computer when on the move. </p>
<p>Enter box -- <a href="https://gitlab.com/yeri/box-public" target="_blank" aria-label="Docker shell server (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Docker shell server</a>... <a href="https://gitlab.com/yeri/box-public" class="aioseop-link"></a></p>
<p>I've copied over the files I use to this <a aria-label="example repo (opens in a new tab)" href="https://gitlab.com/yeri/box-public" target="_blank" rel="noreferrer noopener" class="aioseop-link">example repo</a>, and added some comments. Mind you that this repo acts as a proof of concept and isn't kept up to date, as I have my own private repo -- but this should give you a good idea on how to set up your own shell server with Docker. </p>
<p><a aria-label=" (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/start.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">start.sh</a> -- this is a simple script that I execute when I first run or need to update the container. I execute the same file on two different servers: <a label="Liana (opens in a new tab)" href="http://smokeping-sg.superuser.one/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Liana</a>, my Raspberry Pi at home and <a aria-label="Ocean (opens in a new tab)" href="http://smokeping.rootspirit.com/" target="_blank" rel="noreferrer noopener" class="aioseop-link">Ocean</a>, my server in <a aria-label="Amsterdam (opens in a new tab)" href="https://yeri.be/tag/rootspirit" target="_blank" rel="noreferrer noopener" class="aioseop-link">Amsterdam</a>. </p>
<p><a href="https://gitlab.com/yeri/box-public/-/blob/master/zsh.sh" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">zsh.sh</a> -- this installs what I care about for zsh. This could be part of the Dockerfile but for some reason I separated it. ¯\_(ツ)_/¯ </p>
<p><a aria-label=" (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/git.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">git.sh</a> -- this clones my Git repos so I can edit and commit stuff from the shell server. </p>
<p><a aria-label="run.sh (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/run.sh" target="_blank" rel="noreferrer noopener" class="aioseop-link">run.sh</a> -- this file is launched by Dockerfile at the end and executes what matters: the ssh daemon. It also adds a <a aria-label="Wireguard (opens in a new tab)" href="https://yeri.be/tag/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link">Wireguard</a> route and executes the scripts above. </p>
<p><a aria-label=" (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/blob/master/Dockerfile" target="_blank" rel="noreferrer noopener" class="aioseop-link">Dockerfile</a> -- this installs everything I need and configures the whole thing. I've added tons of comments that should get you going. </p>
<p>I am also cloning <a aria-label="misc (opens in a new tab)" href="https://gitlab.com/yeri/homefiles/" target="_blank" rel="noreferrer noopener" class="aioseop-link">misc</a> and <a aria-label="homefiles (opens in a new tab)" href="https://gitlab.com/yeri/homefiles/" target="_blank" rel="noreferrer noopener" class="aioseop-link">homefiles</a> as submodules in <a aria-label="files/ (opens in a new tab)" href="https://gitlab.com/yeri/box-public/-/tree/master/files" target="_blank" rel="noreferrer noopener" class="aioseop-link">files/</a> -- but you should change this to something that works for you. See the Dockerfile for more info. </p>
]]></content:encoded>
      <category>apple</category><category>linux</category><category>networking</category><category>software</category><category>virtualisation</category>
      <category>debian</category><category>docker</category><category>raspberrypi</category><category>rootspirit</category><category>vpn</category><category>wireguard</category>
    </item>
    
  </channel>
</rss>
