<?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>Debian – Yeri Tiete</title><link>https://yeri.be/tag/debian/</link><description>Yeri Tiete's blog</description><language>en</language><copyright>© Yeri Tiete</copyright><lastBuildDate>Sun, 11 Jun 2023 14:29:44 +0200</lastBuildDate><atom:link href="https://yeri.be/tag/debian/index.xml" rel="self" type="application/rss+xml"/><item><title>Bookworm: eth0 -&gt; enX0</title><link>https://yeri.be/bookworm-eth0-enx0/</link><pubDate>Sun, 11 Jun 2023 14:29:44 +0200</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/bookworm-eth0-enx0/</guid><description>&lt;p&gt;Started updating my Debian systems from Bullseye to Bookworm.&lt;/p&gt;
&lt;p&gt;The first thing I noticed was that ethX renamed to enXY.&lt;/p&gt;
&lt;p&gt;To get back to the old naming scheme, you can fix this by adding the following in &lt;code&gt;/etc/network/interfaces&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="wp-block-code"&gt;&lt;code&gt;rename enX0=eth0
rename enX1=eth1&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And reboot. &lt;/p&gt;</description><content:encoded><![CDATA[<p>Started updating my Debian systems from Bullseye to Bookworm.</p>
<p>The first thing I noticed was that ethX renamed to enXY.</p>
<p>To get back to the old naming scheme, you can fix this by adding the following in <code>/etc/network/interfaces</code>:</p>
<pre class="wp-block-code"><code>rename enX0=eth0
rename enX1=eth1</code></pre>
<p>And reboot. </p>
]]></content:encoded><category>Linux</category><category>Networking</category><category>Software</category><category>debian</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><description>&lt;p&gt;This follows the my two other posts about &lt;a href="https://yeri.be/wireguard" target="_blank" aria-label="WireGuard (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link"&gt;WireGuard&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Most of this can be copied from &lt;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"&gt;the amd64 post&lt;/a&gt; -- with a minor change for making it work on RPi4. &lt;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"&gt;This is the full &lt;/a&gt;&lt;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"&gt;g&lt;/a&gt;&lt;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"&gt;it repo&lt;/a&gt; (including both rpi and amd64). &lt;/p&gt;</description><content:encoded><![CDATA[<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><description>&lt;p&gt;I was rebuilding my &lt;a aria-label="WireGuard (opens in a new tab)" href="https://yeri.be/tag/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;WireGuard&lt;/a&gt; &lt;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"&gt;Docker&lt;/a&gt; container today and this error started popping up:&lt;/p&gt;
&lt;pre class="wp-block-code"&gt;&lt;code&gt;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 (&gt;= 0.0.20200121-2) | wireguard-modules (&gt;= 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)&lt;/code&gt;&lt;/pre&gt;
&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'll be adding it to my Dockerfile.&lt;/p&gt;</description><content:encoded><![CDATA[<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><description>&lt;p&gt;This is the 2nd post about &lt;a aria-label="WireGuard (opens in a new tab)" href="https://yeri.be/tag/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;WireGuard&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;So I am running two &lt;a aria-label="WireGuard (opens in a new tab)" href="https://yeri.be/wireguard" target="_blank" rel="noreferrer noopener" class="aioseop-link"&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;
&lt;p&gt;As this container rarely get rebuild, I am running &lt;a aria-label="unattended-upgrades (opens in a new tab)" href="https://wiki.debian.org/UnattendedUpgrades" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;unattended-upgrades&lt;/a&gt; inside the container to make sure security updates are applied. &lt;/p&gt;</description><content:encoded><![CDATA[<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><description>&lt;p&gt;This is the first post of &lt;a href="https://yeri.be/tag/wireguard" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link"&gt;several&lt;/a&gt;. Next posts will focus on running WireGuard inside a Docker container on &lt;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"&gt;amd64 Linux&lt;/a&gt; and a &lt;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"&gt;Raspberry Pi&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I've been running &lt;a aria-label="Wireguard (opens in a new tab)" href="https://www.wireguard.com/" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;WireGuard&lt;/a&gt; for a few months now and I've been loving it. &lt;/p&gt;
&lt;p&gt;I first started using it about a year ago when in &lt;a aria-label="China (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://yeri.be/tag/china" target="_blank"&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="DigitalOcean (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://m.do.co/c/3276c58fdbfd" target="_blank"&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="GFW (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://yeri.be/tag/gfw" target="_blank"&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's a quiet but not a stealthy &lt;a aria-label="protocol (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link" href="https://www.wireguard.com/protocol/" target="_blank"&gt;protocol&lt;/a&gt;. &lt;/p&gt;</description><content:encoded><![CDATA[<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><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;
&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="eggdrop (opens in a new tab)" href="https://eggheads.org/" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;eggdrop&lt;/a&gt; and stuff. OMG am I getting old? Anyhow... &lt;/p&gt;</description><content:encoded><![CDATA[<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><item><title>NextDNS + EdgeRouter + Redirecting DNS requests</title><link>https://yeri.be/nextdns-edgerouter-redirecting-dns-requests/</link><pubDate>Tue, 21 Apr 2020 18:14:00 +0200</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/nextdns-edgerouter-redirecting-dns-requests/</guid><description>&lt;p&gt;Realised I haven't updated this in a long while (life happened).&lt;/p&gt;
&lt;p&gt;Couple of weeks ago I started to play with &lt;a href="http://nextdns.io" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link"&gt;NextDNS&lt;/a&gt; -- and I really recommend anyone that's something privacy minded and cares about the stuff happening on their network. &lt;/p&gt;
&lt;p&gt;I've set up several configs (home, parents, FlatTurtle &lt;a aria-label=" (opens in a new tab)" href="https://blog.flatturtle.com/image/103073818135" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;TurtleBox&lt;/a&gt; (the NUCs controlling the &lt;a aria-label=" (opens in a new tab)" href="https://flatturtle.com/screens" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;screens&lt;/a&gt;)) and Servers. Once it's out of beta and better supported on Unifi and Ubiquiti hardware I might deploy it to our &lt;a aria-label=" (opens in a new tab)" href="https://blog.flatturtle.com/image/101035897937" target="_blank" rel="noreferrer noopener" class="aioseop-link"&gt;public WiFi&lt;/a&gt; (well, most access points don't look like that -- but you get the point) networks too. &lt;/p&gt;</description><content:encoded><![CDATA[<p>Realised I haven't updated this in a long while (life happened).</p>
<p>Couple of weeks ago I started to play with <a href="http://nextdns.io" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">NextDNS</a> -- and I really recommend anyone that's something privacy minded and cares about the stuff happening on their network. </p>
<p>I've set up several configs (home, parents, FlatTurtle <a aria-label=" (opens in a new tab)" href="https://blog.flatturtle.com/image/103073818135" target="_blank" rel="noreferrer noopener" class="aioseop-link">TurtleBox</a> (the NUCs controlling the <a aria-label=" (opens in a new tab)" href="https://flatturtle.com/screens" target="_blank" rel="noreferrer noopener" class="aioseop-link">screens</a>)) and Servers. Once it's out of beta and better supported on Unifi and Ubiquiti hardware I might deploy it to our <a aria-label=" (opens in a new tab)" href="https://blog.flatturtle.com/image/101035897937" target="_blank" rel="noreferrer noopener" class="aioseop-link">public WiFi</a> (well, most access points don't look like that -- but you get the point) networks too. </p>
<p>Looking at the logs was an eye-opener seeing what goes through your network. You can play around and block (or whitelist) certain domains. </p>
<figure class="wp-block-image size-large"><a href="https://static.yeri.be/2020/04/nextdns_0x04.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/04/nextdns_0x04-902x1024.png" alt="" class="wp-image-8310"/></a></figure>
<p>I figured out my <a href="https://www.devialet.com" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Devialet</a> does an insane amount of requests to <a href="http://cache.radioline.fr" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">cache.radioline.fr</a> for example. This domain has a 30s TTL. It shows that the majority of my DNS requests are actually automated pings and not in any way human traffic. </p>
<p>Anyhow -- I've since installed the <a href="https://github.com/nextdns/nextdns/wiki/EdgeOS" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">NextDNS CLI</a> straight on my <a href="https://yeri.be/edgerouter-fritzbox-ipsec" class="aioseop-link">EdgeRouter</a> Lite acting as a caching DNS server and forwarding using <a href="https://en.wikipedia.org/wiki/DNS_over_HTTPS" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">DoH</a>. </p>
<p>I've turned off dnsmasq (<code>/etc/default/dnsmasq</code> =&gt; <code>DNSMASQ_OPTS="-p0"</code>) and have NextDNS listen to :53 directly. </p>
<p>Note that every EdgeOS update seems to wipe out the NextDNS installation, and requires a fresh install... Pain in the ass and doesn't seem like that's fixable. </p>
<p>This is my ERL NextDNS config (<code>/etc/nextdns.conf</code>)</p>
<pre class="wp-block-preformatted">hardened-privacy false
bogus-priv true
log-queries false
cache-size 10MB
cache-max-age 0s
report-client-info true
timeout 5s
listen :53
use-hosts true
setup-router false
auto-activate true
config 34xyz8
detect-captive-portals false
max-ttl 0s</pre>
<p>The explanation of every flag is explain on their <a href="https://github.com/nextdns/nextdns/" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">Github</a> page and they are very responsive via issues or through their chat on <a href="http://my.nextdns.io" target="_blank" aria-label="my.nextdns.io (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">my.nextdns.io</a>.  </p>
<p>All right -- next thing I've noticed is that my Google Home devices are not sending any DNS requests -- which means the devices use hard coded DNS servers. </p>
<p>I have a separate vlan (<code>eth1.90</code>) for Google Home (includes my Android TV, <a aria-label=" (opens in a new tab)" href="https://osmc.tv/" target="_blank" rel="noreferrer noopener" class="aioseop-link">OSMC</a>, Nest Home Hub and all other GHome and Chromecast devices). For this vlan I set up a deflector to be able to cast and ping/ssh from my "main" network/vlan to GHome vlan. </p>
<p>Using <a href="https://iperf.io/2019/12/27/intercept-and-redirect-dns-requests/" target="_blank" aria-label=" (opens in a new tab)" rel="noreferrer noopener" class="aioseop-link">this guide</a> I redirected all external DNS traffic to the ERL so I can monitor what's happening. The important part was the following:</p>
<pre class="wp-block-preformatted">yeri@sg-erl# show service nat rule 4053<br />destination {<br />port 53<br />}<br />inbound-interface eth1.90<br />inside-address {<br />address 10.3.34.1<br />port 53<br />}<br />protocol tcp_udp<br />type destination</pre>
<p>This allows to "catch" all UDP and TCP connections to :53 and redirect them the ERL DNS server (10.3.34.1). The GHome devices were acting a bit weird after committing the change, but a reboot of the device fixed it. </p>
<p>Note that you need to set this up per vlan. If you want to catch DNS requests for your Guest or IoT vlan, you'll need to do the same. </p>
]]></content:encoded><category>Google</category><category>Linux</category><category>Networking</category><category>debian</category><category>dns</category><category>nextdns</category><category>router</category><category>ubiquiti</category></item><item><title>Wheezy Xen Dom0 &amp; RAM</title><link>https://yeri.be/wheezy-xen-dom0-ram/</link><pubDate>Sat, 14 Jun 2014 18:43:03 +0200</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/wheezy-xen-dom0-ram/</guid><description>&lt;p&gt;Note to self: &amp;lt;1Gb of RAM on a Dom0 Wheezy server causes kernel panics.&lt;/p&gt;
&lt;p&gt;Using 2Gb of RAM seems to do the trick.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Note to self: &lt;1Gb of RAM on a Dom0 Wheezy server causes kernel panics.</p>
<p>Using 2Gb of RAM seems to do the trick.</p>
]]></content:encoded><category>Errors</category><category>Hardware</category><category>Linux</category><category>Software</category><category>Virtualisation</category><category>debian</category><category>xen</category></item><item><title>Realtek ethernet card not working on Linux</title><link>https://yeri.be/realtek-ethernet-card-not-working-on-linux/</link><pubDate>Fri, 09 Aug 2013 08:44:44 +0200</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/realtek-ethernet-card-not-working-on-linux/</guid><description>&lt;pre&gt;[ 0.184110] pci 0000:04:04.0: [10ec:8139] type 0 class 0x000200
[ 3.822258] 8139cp: 8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)
[ 3.822281] 8139cp 0000:04:04.0: This (id 10ec:8139 rev 10) is not an 8139C+ compatible chip, use 8139too
[ 3.822574] 8139too: 8139too Fast Ethernet driver 0.9.28
[ 3.822625] 8139too 0000:04:04.0: Chip not responding, ignoring board
[ 3.822675] 8139too: probe of 0000:04:04.0 failed with error -5&lt;/pre&gt;
&lt;p&gt;On a Debian machine.&lt;/p&gt;
&lt;p&gt;The solution was changing PCI slot , blowing away all the dust in the mobo PCI slot and on the pins of the PCI card, and gently inserting and removing it a couple of times.&lt;/p&gt;</description><content:encoded><![CDATA[<pre>[ 0.184110] pci 0000:04:04.0: [10ec:8139] type 0 class 0x000200
[ 3.822258] 8139cp: 8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)
[ 3.822281] 8139cp 0000:04:04.0: This (id 10ec:8139 rev 10) is not an 8139C+ compatible chip, use 8139too
[ 3.822574] 8139too: 8139too Fast Ethernet driver 0.9.28
[ 3.822625] 8139too 0000:04:04.0: Chip not responding, ignoring board
[ 3.822675] 8139too: probe of 0000:04:04.0 failed with error -5</pre>
<p>On a Debian machine.</p>
<p>The solution was changing PCI slot , blowing away all the dust in the mobo PCI slot and on the pins of the PCI card, and gently inserting and removing it a couple of times.</p>
<p>After that it worked correctly.</p>
]]></content:encoded><category>Errors</category><category>Hardware</category><category>Linux</category><category>debian</category><category>realtek</category></item><item><title>First 5 Minutes Troubleshooting A Server</title><link>https://yeri.be/first-5-minutes-troubleshooting-a-server/</link><pubDate>Thu, 14 Mar 2013 06:22:18 +0100</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/first-5-minutes-troubleshooting-a-server/</guid><description>&lt;p&gt;&lt;a href="https://web.archive.org/web/20140401081039/http://devo.ps/blog/2013/03/06/troubleshooting-5minutes-on-a-yet-unknown-box.html" target="_blank" rel="noopener noreferrer"&gt;This&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;p>&lt;a href="https://web.archive.org/web/20140401081039/http://devo.ps/blog/2013/03/06/troubleshooting-5minutes-on-a-yet-unknown-box.html" target="_blank" rel="noopener noreferrer">This&lt;/a>.&lt;/p>
</content:encoded><category>Errors</category><category>Linux</category><category>Networking</category><category>Software</category><category>Ubuntu</category><category>debian</category></item><item><title>Connect different LANs over openVPN</title><link>https://yeri.be/connect-different-lans-over-openvpn/</link><pubDate>Tue, 29 Jan 2013 11:47:50 +0100</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/connect-different-lans-over-openvpn/</guid><description>&lt;p&gt;I now own three &lt;a href="http://www.raspberrypi.org/" target="_blank" rel="noopener noreferrer"&gt;Raspberry Pi&amp;rsquo;s&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Using two of them (and my &lt;a href="https://yeri.be/?s=guruplug&amp;amp;x=0&amp;amp;y=0"&gt;Guruplug&lt;/a&gt; as WiFi AP) I connected my new apartment with my old house (= parents) over VPN.&lt;/p&gt;
&lt;p&gt;This way I can access the printers/scanners and NAS at home.&lt;/p&gt;
&lt;p&gt;The 2 rPI&amp;rsquo;s are used as router (using a Macbook Air USB-to-Ethernet adapter as 2nd ethernet (eth1) port). Basic howto&amp;rsquo;s are easily found using Google to do this (a &lt;a href="https://web.archive.org/web/20131205200223/http://www.gentoo.org:80/doc/en/home-router-howto.xml" target="_blank" rel="noopener noreferrer"&gt;good starting point&lt;/a&gt;).&lt;/p&gt;</description><content:encoded><![CDATA[<p>I now own three <a href="http://www.raspberrypi.org/" target="_blank" rel="noopener noreferrer">Raspberry Pi&rsquo;s</a>.</p>
<p>Using two of them (and my <a href="https://yeri.be/?s=guruplug&amp;x=0&amp;y=0">Guruplug</a> as WiFi AP) I connected my new apartment with my old house (= parents) over VPN.</p>
<p>This way I can access the printers/scanners and NAS at home.</p>
<p>The 2 rPI&rsquo;s are used as router (using a Macbook Air USB-to-Ethernet adapter as 2nd ethernet (eth1) port). Basic howto&rsquo;s are easily found using Google to do this (a <a href="https://web.archive.org/web/20131205200223/http://www.gentoo.org:80/doc/en/home-router-howto.xml" target="_blank" rel="noopener noreferrer">good starting point</a>).</p>
<p>I made my own installation of Raspbian (as the downloadable image contains too much crap), details <a href="http://www.raspbian.org/RaspbianInstaller" target="_blank" rel="noopener noreferrer">here</a> (actually not that easy to find when Googling for bootstrap raspbian etc).</p>
<p> </p>
<p>I&rsquo;ve connected three different LANs over an OpenVPN connection:</p>
<ul>
    <li>LAN1 (home): 192.168.1.0 (Gateway: 192.168.1.1, VPN ip: 10.9.8.254)</li>
    <li>LAN2 (apartment, ethernet): 10.60.111.0 (Gateway: 10.60.111.1, VPN ip: 10.9.8.250)</li>
    <li>LAN3 (apartment, wifi): 10.10.10.0 (Gateway: 10.10.10.1, VPN ip: 10.9.8.246)</li>
</ul>
<p>OpenVPN range: 10.9.8.0. The subnet is 255.255.255.0 in all cases.</p>
<p>LAN3 is connected via LAN2 to the internet. So the default gateway of router 10.10.10.1 is 10.60.111.1.</p>
<p>The gateway/routers are all Debian-based Linux systems. I&rsquo;m using <a href="http://www.edpnet.be/" target="_blank" rel="noopener noreferrer">EDPnet</a> as ISP, and thus need to use those Sagem/Belgacom approved routers (BBox-2 hardware). These Sagems are set in bridged mode, and don&rsquo;t do the PPP stuff. <a href="http://wiki.debian.org/PPPoE" target="_blank" rel="noopener noreferrer">PPPoeconfig</a> on Debian takes care of most of the stuff. As EDPnet provides ipv6, I can ping6 from those routers.</p>
<p>The idea is to connect/ping each and every LAN from any of the clients connected the LANs (without running OpenVPN on the clients; only run it on the gateways).</p>
<p>For example: my PC with ip 10.10.10.15 wants to connect to the NAS with ip 192.168.1.100.</p>
<p>This can easily be achieved by setting a client-config-dir in the openvpn.conf file (or whatever the name of your config):</p>
<pre>client-config-dir /etc/openvpn/tiete</pre>
<p>And don&rsquo;t forget to add route pushes:</p>
<pre>push "route 192.168.1.0 255.255.255.0"
push "route 10.60.111.0 255.255.255.0"
push "route 10.10.10.0 255.255.255.0"</pre>
<p>But here comes the annoying part. As I&rsquo;m pushing routes 10.60.111.0 via VPN, which is supposed to be my Guruplug&rsquo;s default gateway as well (ISP &gt; eth0:RaspberryPi:eth1 &gt; eth0:Guruplug, remember?) this was causing quite some routing fuck ups.</p>
<p>The easiest way to solve this was to turn off VPN on the Guruplug all together, and route 10.10.10.0 over the Raspberry Pi, by adding this line to /etc/network/interfaces:</p>
<pre>up route add -net 10.10.10.0 netmask 255.255.255.0 gw 10.60.111.2 dev eth1</pre>
<p>Then I&rsquo;ll change the client specific configs on the VPN. Create a file in whatever you picked as client-config-dir, and name it the actual VPN name (the name used when creating the key).</p>
<p>As I have three routers, I created three files (sheeva for my guruplug, Pi for my first rPI and Industry for my 2nd. Yep&hellip; Fancy names).</p>
<p>I also want to give a static IP address to the gateways, so I use the option:</p>
<pre>ifconfig-push 10.9.8.&lt;valid-ip&gt; 10.9.8.&lt;valid-ip - 1&gt;</pre>
<p>And I&rsquo;ll also add the iroute option to push routes.</p>
<p>This is what it looks like for the router on the 192.168.1.0 network (&ldquo;Pi&rdquo;):</p>
<pre>ifconfig-push 10.9.8.254 10.9.8.253
iroute 192.168.1.0 255.255.255.0</pre>
<p>For &ldquo;Sheeva&rdquo;, the WiFi AP on 10.10.10.0:</p>
<pre>ifconfig-push 10.9.8.246 10.9.8.245</pre>
<p>And for 10.60.111.0 plus 10.10.10.0 routed over 10.60.111.0 (&ldquo;Industry&rdquo;):</p>
<pre>ifconfig-push 10.9.8.250 10.9.8.249
iroute 10.60.111.0 255.255.255.0
iroute 10.10.10.0 255.255.255.0</pre>
<p>And don&rsquo;t forget to set up masquerading over tun0 (or tun+) with iptables.</p>
<p>Now&hellip; Oddly enough, this didn&rsquo;t require that much configuration, cursing and stress&hellip; And, well, it kind of just works.</p>
<p>From my Mac to my NAS:</p>
<pre>nazgul ~ $ traceroute 192.168.1.100
traceroute to 192.168.1.100 (192.168.1.100), 64 hops max, 52 byte packets
 1 sheeva (10.10.10.1) 1.936 ms 1.159 ms 0.800 ms
 2 10.60.111.1 (10.60.111.1) 1.456 ms 1.776 ms 1.539 ms
 3 10.9.8.254 (10.9.8.254) 55.745 ms 55.046 ms 54.734 ms
 4 192.168.1.100 (192.168.1.100) 62.302 ms 55.327 ms 54.795 ms</pre>
<p>From Pi (gateway 192.168.1.1) to nazgul, my Mac:</p>
<pre>pi ~ # traceroute 10.10.10.15
traceroute to 10.10.10.15 (10.10.10.15), 30 hops max, 60 byte packets
 1 10.9.8.250 (10.9.8.250) 65.892 ms 74.177 ms 73.957 ms
 2 10.60.111.2 (10.60.111.2) 73.441 ms 72.902 ms 72.342 ms
 3 10.10.10.15 (10.10.10.15) 71.780 ms 71.187 ms 70.760 ms</pre>
<p>From Heartbeat (10.9.8.102), my Munin stats server to the printer:</p>
<pre>heartbeat ~/bin # traceroute 192.168.1.90
traceroute to 192.168.1.90 (192.168.1.90), 30 hops max, 60 byte packets
 1 pi (10.9.8.254) 39.835 ms 40.794 ms 41.567 ms
 2 192.168.1.90 (192.168.1.90) 41.541 ms 42.452 ms 43.307 ms</pre>
<p>From Heartbeat to Sheeva&rsquo;s eth0 IP:</p>
<pre>heartbeat ~/bin # traceroute 10.60.111.2
traceroute to 10.60.111.2 (10.60.111.2), 30 hops max, 60 byte packets
 1 industry (10.9.8.250) 32.716 ms 32.615 ms 34.359 ms
 2 sheeva (10.60.111.2) 34.405 ms 34.349 ms 35.014 ms</pre>
<p>From Heartbeat to an Android device (not sure why the latency spike):</p>
<pre>heartbeat ~/bin # traceroute 10.10.10.72
traceroute to 10.10.10.72 (10.10.10.72), 30 hops max, 60 byte packets
 1 industry (10.9.8.250) 31.337 ms 32.269 ms 32.218 ms
 2 sheeva (10.60.111.2) 33.006 ms 33.052 ms 32.996 ms
 3 10.10.10.72 (10.10.10.72) 471.564 ms 472.169 ms 473.082 ms</pre>
<p>Next up (once I have spare time): try to sync local DNS and fix local ipv6.</p>
<p>I&rsquo;ll put most of the configs on Github at some point.</p>
]]></content:encoded><category>Hardware</category><category>Linux</category><category>Networking</category><category>Software</category><category>debian</category><category>raspberrypi</category></item><item><title>Debian MySQL Gem file error</title><link>https://yeri.be/debian-mysql-gem-file-error/</link><pubDate>Mon, 24 Jan 2011 06:19:57 +0100</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/debian-mysql-gem-file-error/</guid><description>&lt;p&gt;When installing the MySQL Gem, I had this error:&lt;/p&gt;
&lt;pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding: 5px; border: 1px dashed #489e06;"&gt;Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-mysql-dir=/usr/include/mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out&lt;/pre&gt;
&lt;p&gt;Can be solved by installing libmysqlclient15-dev&lt;/p&gt;</description><content:encoded><![CDATA[<p>When installing the MySQL Gem, I had this error:</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding: 5px; border: 1px dashed #489e06;">Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-mysql-dir=/usr/include/mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out</pre>
<p>Can be solved by installing libmysqlclient15-dev</p>
<pre style="background-color: #ffffff; line-height: 12pt; margin-right: 5px; padding: 5px; border: 1px dashed #489e06;"># apt-get install libmysqlclient15-dev</pre>
]]></content:encoded><category>Errors</category><category>Linux</category><category>Software</category><category>debian</category><category>gem</category></item><item><title>MRTG</title><link>https://yeri.be/mrtg/</link><pubDate>Wed, 18 Nov 2009 17:14:57 +0100</pubDate><author>Yeri Tiete</author><guid isPermaLink="true">https://yeri.be/mrtg/</guid><description>&lt;p&gt;As I often have people asking for the files I use to make my pretty MRTG graphs; I&amp;rsquo;ll publish them here.&lt;/p&gt;
&lt;p&gt;Here are some examples:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://web.archive.org/web/20100712200524/http://mrtg.rootspirit.com:80/" target="_blank" rel="noopener noreferrer"&gt;Zero&lt;/a&gt; - &lt;a href="http://one.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer"&gt;One&lt;/a&gt; - &lt;a href="http://four.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer"&gt;Four&lt;/a&gt; - &lt;a href="http://vm1.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer"&gt;vm1&lt;/a&gt; - &lt;a href="http://home.tiete.be/mrtg/" target="_blank" rel="noopener noreferrer"&gt;Sauron&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The config files:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://static.yeri.be/2009/11/sauron.tar" target="_blank" rel="noopener noreferrer"&gt;Sauron&lt;/a&gt; (including Squid stats),&lt;/p&gt;
&lt;p&gt;&lt;a href="https://static.yeri.be/2009/11/zero.tar" target="_blank" rel="noopener noreferrer"&gt;Zero&lt;/a&gt; (including fan stats).&lt;/p&gt;
&lt;p&gt;List of files included:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;indexmaker; simple script (included with MRTG) to generate a simple index file with all the graphs&lt;/li&gt;
&lt;li&gt;snmp-if.sh; will show you the IDs of the interfaces on the server/pc. These IDs have to be edited in the mrtg.cfg file; e.g.:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Target[eth0]: &lt;span style="color: #ff0000;"&gt;2&lt;/span&gt;:public@localhost:&lt;/p&gt;</description><content:encoded><![CDATA[<p>As I often have people asking for the files I use to make my pretty MRTG graphs; I&rsquo;ll publish them here.</p>
<p>Here are some examples:</p>
<p><a href="https://web.archive.org/web/20100712200524/http://mrtg.rootspirit.com:80/" target="_blank" rel="noopener noreferrer">Zero</a> - <a href="http://one.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer">One</a> - <a href="http://four.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer">Four</a> - <a href="http://vm1.rootspirit.com/mrtg/" target="_blank" rel="noopener noreferrer">vm1</a> - <a href="http://home.tiete.be/mrtg/" target="_blank" rel="noopener noreferrer">Sauron</a></p>
<p>The config files:</p>
<p><a href="https://static.yeri.be/2009/11/sauron.tar" target="_blank" rel="noopener noreferrer">Sauron</a> (including Squid stats),</p>
<p><a href="https://static.yeri.be/2009/11/zero.tar" target="_blank" rel="noopener noreferrer">Zero</a> (including fan stats).</p>
<p>List of files included:</p>
<ul>
<li>indexmaker; simple script (included with MRTG) to generate a simple index file with all the graphs</li>
<li>snmp-if.sh; will show you the IDs of the interfaces on the server/pc. These IDs have to be edited in the mrtg.cfg file; e.g.:</li>
</ul>
<p>Target[eth0]: <span style="color: #ff0000;">2</span>:public@localhost:</p>
<p>Make sure 2 is indeed the ID of eth0. Be aware that virtual interfaces, like the TUN/TAP interfaces (using by openVPN for example), can change ID each time they are restarted/rebooted.</p>
<ul>
<li>mrtg.cfg; check the config file as an example.</li></ul>
<li>mrtg-&lt;xyz&gt;.sh; bunch of files to generate some data. Not all of  those still work, but I haven't deleted them yet in case. See the config to check those I'm using.
</li>
<li>
<p>mrtg._1 and mrtg.ok can be deleted/ignores. Those files are generated by MRTG and I was to lazy to remove them. :(</p>
</li>
<p>Some day, I&rsquo;ll write a decent howto, but for now, you&rsquo;ll have to do with this.</p>
<p>If there&rsquo;s any question, just leave a comment.</p>
]]></content:encoded><category>Hardware</category><category>Misc</category><category>Networking</category><category>Software</category><category>www</category><category>Linux</category><category>Ubuntu</category><category>debian</category><category>gentoo</category><category>mrtg</category><category>stats</category></item></channel></rss>