<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Ubuntu — LowEndSpirit</title>
        <link>https://staging.lowendspirit.com/index.php?p=/</link>
        <pubDate>Thu, 09 Apr 2026 05:45:03 +0000</pubDate>
        <language>en</language>
            <description>Ubuntu — LowEndSpirit</description>
    <atom:link href="https://staging.lowendspirit.com/index.php?p=/discussions/tagged/ubuntu/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>How to hide ipv4 in squid proxy?</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/3617/how-to-hide-ipv4-in-squid-proxy</link>
        <pubDate>Wed, 08 Dec 2021 22:18:56 +0000</pubDate>
        <category>Help</category>
        <dc:creator>Ruriko</dc:creator>
        <guid isPermaLink="false">3617@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>I have a NAT vps running Ubuntu 20.04 and I want to setup a ipv6 proxy server so I've installed squid proxy. How do I remove ipv4 address so sites that support dual stack can only see your ipv6 address? squid proxy doesn't seem to have an option to hide/disable ipv4 so I don't know what other ways that can remove ipv4.</p>
]]>
        </description>
    </item>
    <item>
        <title>Install Ubuntu from ISO on IPv6-only KVM Server in SolusIO</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/2857/install-ubuntu-from-iso-on-ipv6-only-kvm-server-in-solusio</link>
        <pubDate>Wed, 28 Apr 2021 04:56:30 +0000</pubDate>
        <category>Technical</category>
        <dc:creator>yoursunny</dc:creator>
        <guid isPermaLink="false">2857@/index.php?p=/discussions</guid>
        <description><![CDATA[<blockquote><div>
  <p>This article is originally published on yoursunny.com blog <a href="https://yoursunny.com/t/2021/SolusIO-IPv6-ISO/" rel="nofollow">https://yoursunny.com/t/2021/SolusIO-IPv6-ISO/</a></p>
</div></blockquote>

<p>I recently obtained a KVM virtual server on <a rel="nofollow" href="https://www.solus.io/">SolusIO</a> platform, and I want to install Ubuntu 20.04 Server from the official ISO image.<br />
This is not as easy as I hoped, but I figured it out.</p>

<p>Note: if you are in a hurry, skip the "Background" and start from "Part 1" section.</p>

<h2>Background: SolusIO cannot Mount ISO Image</h2>

<p>SolusIO is a virtual infrastructure management solution published by Plesk International Gmbh, the same company behind the popular SolusVM software.<br />
They describe SolusIO to be the successor of SolusVM, with more focus on the self-service approach for end users.</p>

<p>SolusIO inherits the same clean user interface from SolusVM, and is easy to use.<br />
However, as a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Power_user">power user</a>, I notice several features are missing in SolusIO.<br />
One of these features is the ability to install the operating system from an ISO image.</p>

<p>Presently, SolusIO only supports installing operating systems from the provided templates.<br />
While a template installation is convenient, I prefer to install from official ISO images so that I can have better control over what goes into my system, and avoid vulnerabilities such as the <a rel="nofollow" href="https://www.lowendtalk.com/discussion/169685/vulnerability-in-solusvm-debian-10-template-debianuser-backdoor-default-user/p1">debianuser backdoor</a>.</p>

<p>An easy way to load a ISO installer is through <a rel="nofollow" href="https://netboot.xyz/">netboot.xyz</a>, a hosted service that can boot a server over the Internet and download the installer of many Linux and BSD distributions.<br />
Even if the VPS hosting platform does not support mounting ISO images, it is possible to install iPXE bootloader per <a rel="nofollow" href="https://lowendspirit.com/tip-install-os-via-netboot-xyz-without-iso-support/">Tip: Install OS via netboot.xyz without ISO support</a>, and then start netboot.xyz from there.</p>

<p>However, this method did not work for me.<br />
The iPXE package, as distributed in most operating systems, only supports IPv4.<br />
To make it work on my IPv6-only server, I would have to recompile iPXE with IPv6 enabled, which could be a complicated task.<br />
I need another way.</p>

<h2>Part 1: Boot from ISO on Hard Disk</h2>

<p>I thought: can I download the ISO image and load it from hard disk, and start the installer, just like netboot.xyz does, but without going through the network?<br />
I searched for "how to boot ISO from hard disk", and found a helpful guide from Ubuntu documentation site: <a rel="nofollow" href="https://help.ubuntu.com/community/Grub2/ISOBoot">Grub2/ISOBoot</a>.<br />
Piecing together the information, I found the exact steps to start the Ubuntu installer.</p>

<ol>
<li><p>Install Debian 10 from SolusIO template.</p>

<p>As much as I love Ubuntu, it does not work for some reason.</p></li>
<li><p>SSH into the server as root, and download <a rel="nofollow" href="https://releases.ubuntu.com/focal/">official Ubuntu ISO image</a>.</p>

<pre><code>wget https://releases.ubuntu.com/focal/ubuntu-20.04.2-live-server-amd64.iso
</code></pre></li>
<li><p>Modify <code>/etc/grub.d/40_custom</code> file, and append the following text:</p>

<pre><code>menuentry "Ubuntu 20.04 ISO" {
 set isofile="/root/ubuntu-20.04.2-live-server-amd64.iso"
 rmmod tpm
 loopback loop (hd0,1)$isofile
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject toram
 initrd (loop)/casper/initrd
}
</code></pre>

<p>In this snippet:</p></li>
</ol>

<ul>
<li>The path after <code>isofile=</code> is where we downloaded the ISO image.</li>
<li><code>(hd0,1)</code> is <code>/dev/sda1</code> written in a syntax recognized by the GRUB bootloader.<br />
 If the ISO image file is on a different disk partition, you may need different numbers.<br />
 Search for "drive number" on <a rel="nofollow" href="https://help.ubuntu.com/community/Grub2/ISOBoot">Grub2/ISOBoot</a> page for more information.</li>
<li>The <code>toram</code> option copies the ISO image from the hard drive to the memory, which is necessary because the installer needs to reformat and overwrite the hard drive.<br />
 This implies that this method would only work on a machine with large enough memory to fit the entire ISO image, and would not work on 1GB or smaller systems.</li>
</ul>

<ol start="4">
<li><p>Run <code>update-grub</code>.</p>

<p>This command generates <code>/boot/grub/grub.cfg</code> that is directly used by the GRUB bootloader.<br />
It would include the menuentry entered in the last step.</p></li>
<li><p>Open VNC window in SolusIO.</p></li>
<li><p>Type <code>reboot</code> in SSH session.</p></li>
<li><p>A blue screen titled "GNU GRUB" should appear in VNC, but only for 3 seconds.<br />
Quickly press the ⬇️ key, select "Ubuntu 20.04 ISO" menu, and press ENTER.</p>

<p><img src="https://yoursunny.com/t/2021/SolusIO-IPv6-ISO/grub.png" alt="GNU GRUB version 2.02, Debian GNU/Linux, Advanced Options for Debian GNU/Linux, Ubuntu 20.04 ISO" /></p></li>
<li><p>You might see a message:</p>

<blockquote><div>
  <p>error: no such module.</p>
  
  <p>Press any key to continue..._</p>
</div></blockquote>

<p>This is harmless, and you can press ENTER to bypass it.</p></li>
<li><p>A minute later, the Ubuntu installer should start, and display the "Please choose you preferred language" screen.</p></li>
</ol>

<h2>Part 2: Install Ubuntu from In-Memory ISO</h2>

<p>Now that we have the installer started, but we need to take care of one more detail before proceeding.</p>

<ol>
<li><p>On the very first "Please choose you preferred language" screen, press F2 key, which opens a shell.</p></li>
<li><p>Type the following commands:</p>

<pre><code>losetup -d /dev/loop0
umount /isodevice
</code></pre>

<p>These commands umount the ISO image, so that the same hard drive can be used as an installation target.</p></li>
<li><p>Type <code>exit</code> to return to the installer.</p></li>
<li><p>The installer would attempt to detect the network, and it will probably fail because the KVM server is IPv6-only and the network does not support IPv6 autoconfiguration.</p>

<p>Here I select "Continue without network", because the downloaded ISO image contains all the essential packages.</p>

<p><img src="https://yoursunny.com/t/2021/SolusIO-IPv6-ISO/network.png" alt="Network connections, Configure at least one interface this server can use to talk to other machines, and which preferably provides sufficient access for updates, Continue without network" /></p></li>
<li><p>The rest of installation process is same as any other Ubuntu Server installation.</p></li>
<li><p>The installed system will be without network configuration.<br />
It's necessary to login via VNC, add IP address and routes with <code>ip addr add</code> and <code>ip route add</code> commands, before I can SSH into the server and upload my <a rel="nofollow" href="https://yoursunny.com/t/2021/Virtualizor-VNC-netplan/">expertly written Netplan configuration</a>.</p></li>
</ol>

<h2>Common Errors</h2>

<h3>Temporary failure in name resolution</h3>

<p>When I'm downloading the official Ubuntu ISO image, I encountered this error:</p>

<pre><code># wget https://releases.ubuntu.com/focal/ubuntu-20.04.2-live-server-amd64.iso
--2021-04-28 01:48:26--  https://releases.ubuntu.com/focal/ubuntu-20.04.2-live-server-amd64.iso
Resolving releases.ubuntu.com (releases.ubuntu.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘releases.ubuntu.com’
</code></pre>

<p>It turns out that the Debian 10 template from SolusIO has configured an IPv4 address as the DNS server, which does not work in an IPv6-only network:</p>

<pre><code># cat /etc/resolv.conf
nameserver 10.0.2.3
</code></pre>

<p>To resolve the error, configure an IPv6 DNS server such as <a rel="nofollow" href="https://one.one.one.one/dns/">Cloudflare DNS</a>, before downloading the ISO image:</p>

<pre><code>echo 'nameserver 2606:4700:4700::1111' &gt;/etc/resolv.conf
</code></pre>

<h3>/etc/grub.d/40_custom: menuentry: not found</h3>

<p>When I run <code>update-grub</code> command, I encountered this error:</p>

<pre><code># update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.19.0-16-amd64
Found initrd image: /boot/initrd.img-4.19.0-16-amd64
/etc/grub.d/40_custom: 2: /etc/grub.d/40_custom: menuentry: not found
done
</code></pre>

<p>This is because I mistakenly deleted the original content of <code>/etc/grub.d/40_custom</code> file, which starts with:</p>

<pre><code>#!/bin/sh
exec tail -n +3 $0
</code></pre>

<p>The <code>update-grub</code> command expects every file in <code>/etc/grub.d</code> directory to be a bash script.<br />
What the <code>exec tail</code> line does is that, it prints the content of this file starting from the third line, which happens to be our menuentry.<br />
If this line is deleted, bash would interpret <code>menuentry</code> as a command name, which does not exist, thus causing the error.</p>

<p>To resolve the error, put these two lines back to the top of <code>/etc/grub.d/40_custom</code>.</p>

<h3>Block probing did not discover any disks</h3>

<p>The Ubuntu installer fails with this message:</p>

<pre><code>Guided storage configuration

Block probing did not discover any disks. Unfortunately this means that
installation will not be possible.
</code></pre>

<p>This is because I did not run the commands to umount the ISO, so that the installer is unable to write to the hard drive that contains the ISO image.<br />
Apparently this is <a rel="nofollow" href="https://askubuntu.com/a/1305972">a decade old bug</a>.</p>

<p>To resolve the error, restart the server, enter the installer again, and remember to run the <code>umount</code> commands in a shell on the first screen.</p>

<h2>Final Words</h2>

<p>This article describes how to install Ubuntu 20.04 Server from the official ISO image on an IPv6-only KVM server managed by SolusIO platform.<br />
The steps are verified on <a rel="nofollow" href="https://hosterlabs.net/onlyv6/">Hosterlabs IPv6 only servers - IPv6 Plus plan</a>.</p>
]]>
        </description>
    </item>
    <item>
        <title>Disabling VNC in Virtualizor ⇒ Lost Connectivity?</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/2779/disabling-vnc-in-virtualizor-lost-connectivity</link>
        <pubDate>Sun, 11 Apr 2021 17:46:50 +0000</pubDate>
        <category>Technical</category>
        <dc:creator>yoursunny</dc:creator>
        <guid isPermaLink="false">2779@/index.php?p=/discussions</guid>
        <description><![CDATA[<blockquote><div>
  <p>This post is originally published on yoursunny.com blog <a href="https://yoursunny.com/t/2021/Virtualizor-VNC-netplan/" rel="nofollow">https://yoursunny.com/t/2021/Virtualizor-VNC-netplan/</a></p>
</div></blockquote>

<p>The KVM server hosting my website went offline last month.<br />
Thinking the server might have crashed, I went to Virtualizor, the VPS control panel, to reboot the VPS.<br />
It did not solve the problem, so I proceeded with my <a rel="nofollow" href="https://yoursunny.com/t/2021/disaster-recovery-no-tears/">disaster recovery plan</a>.</p>

<p>The hosting provider, <a rel="nofollow" href="https://spartanhost.org/">Spartan Host</a>, explained that it was a router bug.<br />
They <a rel="nofollow" href="https://status.spartanhost.net/incident/234">fixed the router</a> after 4 hours, but my server did not come online.</p>

<h2>Symptom</h2>

<p>To investigate what went wrong with my VPS, I came back to Virtualizor to enable VNC access.<br />
Having VNC access is like attaching a monitor and a keyboard to the server.<br />
It would allow me to see any error messages printed on the screen and login to check whether there are configuration errors.</p>

<p>I didn't see any error through VNC connection.<br />
Thinking it might be a routing problem, I logged in with username and password, and ran a <code>traceroute</code>.<br />
To my surprise, the <code>traceroute</code> was able to reach Internet destination.<br />
Moreover, I can SSH into this server again.</p>

<p>Seeing the problem went away, I disabled VNC access in Virtualizor.<br />
Then, I pressed the reboot button in Virtualizor, so that the hypervisor would apply the VNC settings; rebooting via SSH would not be effective.</p>

<p>Then, I started a <code>ping</code> to the server from my desktop, and eagerly waited.<br />
One minute, two minutes, &hellip;, the server did not come online.<br />
What went wrong again?</p>

<p>I repeated the process, re-enabled VNC access, and saw nothing wrong.<br />
I disabled VNC again, and the VPS lost connectivity again.<br />
Clearly, there's a correlation between the VNC toggle and network connectivity.</p>

<h2>Diagnostics Ⅰ</h2>

<p>Virtualizor is known to <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/2439/virtualizor-updates-gives-vps-providers-grey-hair-and-sleep-deprevation/p1">push feature updates in patch releases</a> that sometimes breaks things, so I asked whether there was a Virtualizor update recently, but <a rel="nofollow" href="https://www.lowendtalk.com/discussion/comment/3217921/#Comment_3217921">the answer was no</a>.<br />
I couldn't figure out the problem, so I opened a support ticket with Spartan Host, and sent over the Netplan configuration file in this Ubuntu 20.04 server.</p>

<pre><code>network:
  version: 2
  ethernets:
    ens3:
      dhcp4: true
      addresses:
        - 2001:db8:2604:9cc0::1/64
        - 2001:db8:2604:9cc0::80/64:
            lifetime: 0
      routes:
        - to: ::/0
          via: 2001:db8:2604::1
          on-link: true
</code></pre>

<p>In this configuration:</p>

<ul>
<li>IPv4 address is acquired from DHCP, which is provided by the hypervisor.</li>
<li>IPv6 is statically configured.</li>
<li>NIC name <code>ens3</code> is hard-coded, because it never changes.</li>
</ul>

<p>I've been using similar Netplan configuration files in several other KVM servers, and never had a problem.</p>

<p><a rel="nofollow" href="https://www.linkedin.com/in/ryan-mccully-195b71101/">Ryan McCully</a>, the managing director at Spartan Host, performed some tests on my KVM.<br />
He found that, if VNC is disabled, the network interface on the VPS seems to be "completely dead", as there's no ARP or any other traffic seen at the hypervisor side.<br />
He was also puzzled why VNC would affect network interface, but offered an explanation of why my VPS was working in the past few months:</p>

<ul>
<li>As mentioned above, setting changes in Virtualizor are applied to the hypervisor only after the reboot button in Virtualizor is pressed.</li>
<li>Most likely, when I finished the initial setup, I disabled VNC but didn't reboot in Virtualizor.</li>
<li>In this case, VNC tabs are hidden in Virtualizor, but VNC is still enabled on the hypervisor.</li>
</ul>

<h2>Diagnostics Ⅱ</h2>

<p>Ryan spent a few more hours of extensive testing, and was able to reproduce this issue.<br />
It turned out that <strong>disabling VNC in Virtualizor changes the network interface name</strong>.</p>

<p>The KVM hypervisor realizes VNC through an emulated VGA monitor.<br />
Enabling VNC attaches a VGA controller to the virtual server, while disabling VNC detaches it.<br />
To see this effect, we can schedule to run <code>lspci</code> command <a rel="nofollow" href="https://phoenixnap.com/kb/crontab-reboot">upon reboot in crontab</a>, and look at the output file when we regain access.</p>

<pre><code>$ : VNC enabled
$ lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:04.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
00:05.0 SCSI storage controller: Red Hat, Inc. Virtio block device
00:06.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon

$ : VNC disabled
$ lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:03.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
00:04.0 SCSI storage controller: Red Hat, Inc. Virtio block device
00:05.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon
</code></pre>

<p>More importantly, addition or removal of the VGA controller changes the PCI address of the Ethernet controller.<br />
This, in turn, changes the network interface name, because Ubuntu adopts <a rel="nofollow" href="https://en.wikipedia.org/wiki/Consistent_Network_Device_Naming">Consistent Network Device Naming</a>, in which the name of a network interface is derived from its PCI address.</p>

<table>
<thead>
<tr>
  <th>VNC</th>
  <th>PCI address</th>
  <th>interface name</th>
</tr>
</thead>
<tbody>
<tr>
  <td>enabled</td>
  <td>03:00.0</td>
  <td>ens3</td>
</tr>
<tr>
  <td>disabled</td>
  <td>02:00.0</td>
  <td>ens2</td>
</tr>
</tbody>
</table>

<p>Therefore, "consistent" network device naming scheme is consistent only if the PCI address doesn't change.<br />
However, PCI addresses aren't always stable.<br />
I've seen PCI address changing on a dedicated server when I configure PCI bifurcation in BIOS settings.<br />
Now I've seen PCI address changing on a KVM virtual server.</p>

<h2>Treatment</h2>

<p>My Netplan configuration assumes the Ethernet adapter on the KVM server is always "ens3".<br />
Disabling VNC changes the network interface name to "ens2", and Netplan would not bring up an interface that it doesn't know about.<br />
This caused the VPS to lose connectivity.</p>

<p>To solve this problem, the Netplan configuration should identify the network interface by its MAC address.<br />
MAC address can be considered a stable identifier of the network interface, because it's one of the outputs from <a rel="nofollow" href="https://www.virtualizor.com/docs/admin-api/create-vps/">Virtualizor's Create VPS API</a>.</p>

<p>Therefore, I changed Netplan configuration to this:</p>

<pre><code>network:
  version: 2
  ethernets:
    uplink:
      match:
        macaddress: 6a:ed:d6:3b:49:f4
      set-name: uplink
      dhcp4: true
      addresses:
        - 2001:db8:2604:9cc0::1/64
        - 2001:db8:2604:9cc0::80/64:
            lifetime: 0
      routes:
        - to: ::/0
          via: 2001:db8:2604::1
          on-link: true
</code></pre>

<p>Unless the VPS is deleted and re-created with a different MAC address, this should continue to work.<br />
I also <a rel="nofollow" href="https://yoursunny.com/t/2021/WiFi-rename/">renamed the network interface</a> to "uplink", so that I don't need to check whether it's "ens3" or "ens2" when I type commands.</p>

<h2>Elsewhere</h2>

<p>I checked the VNC situation on several other KVM servers that I have.</p>

<p>WebHorizon and Evolution Host both modified Virtualizor such that there isn't an option to disable VNC.<br />
This prevents the issue, but increases the risk of my VPS being compromised via VNC.</p>

<p>WebHosting24 kept the VNC option intact in Virtualizor.<br />
Disabling VNC would lead to changed network interface names, but my new Netplan configuration works.</p>

<p>SolusVM, the VPS control panel used at VirMach and Nexril, keeps the VGA controller attached at all times.<br />
Disabling VNC blocks the VNC port so that nobody can connect to it, but does not affect the KVM server itself.<br />
I think this is a better approach.</p>

<h2>Acknowledgement</h2>

<p>Kudos to Ryan McCully at <a rel="nofollow" href="https://spartanhost.org/">Spartan Host</a> for helping me hunt down this issue.<br />
I wouldn't have anticipated the root cause without his help.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to Select Default IPv6 Source Address for Outbound Traffic with Netplan</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/2219/how-to-select-default-ipv6-source-address-for-outbound-traffic-with-netplan</link>
        <pubDate>Mon, 07 Dec 2020 02:20:03 +0000</pubDate>
        <category>Technical</category>
        <dc:creator>yoursunny</dc:creator>
        <guid isPermaLink="false">2219@/index.php?p=/discussions</guid>
        <description><![CDATA[<blockquote><div>
  <p>This post is originally published on yoursunny.com blog <a href="https://yoursunny.com/t/2020/preferred-lft-netplan/" rel="nofollow">https://yoursunny.com/t/2020/preferred-lft-netplan/</a></p>
</div></blockquote>

<p>I bought a few Virtual Private Servers (VPS) on Black Friday, and have been busy setting them up.<br />
Nowadays, most VPS comes with an IPv6 <em>subnet</em> that contains millions of possible addresses.<br />
Initially, only one IPv6 address is assigned to the server, but the user can assign additional addresses as desired.<br />
Given that I plan to run multiple services within a server, I added a few more IPv6 addresses so that each service can have a unique IPv6 address.</p>

<p>One of my servers is using KVM virtualization technology, in which I installed Ubuntu 20.04 operating system manually from an ISO image.<br />
Unlike a template-based installation, an ISO-installed Ubuntu 20.04 system manages its networks using <a rel="nofollow" href="https://netplan.io/">Netplan</a>, a backend-agnostic network configuration utility that generates network configuration from YAML files.<br />
Most VPS control panels, including SolusVM and Virtualizer, are unable to generate the YAML files needed by Netplan.<br />
IPv4 works out of box via DHCP, but IPv6 has to be configured manually.<br />
To assign two IPv6 addresses to my server, I need to write the following in <code>/etc/netplan/01-netcfg.yaml</code>:</p>

<pre><code>network:
  version: 2
  ethernets:
    ens3:
      dhcp4: true
      addresses:
        - 2001:db8:30fa:5877::1/64
        - 2001:db8:30fa:5877::beef/64
      routes:
        - to: ::/0
          via: 2001:db8:30fa::1
          on-link: true
      nameservers:
        addresses:
        - 2001:4860:4860::8888
        - 2606:4700:4700::1111
</code></pre>

<p>I intend to host my secret beef recipes on its unique IPv6 address <code>2001:db8:30fa:5877::beef</code>, and use the other address <code>2001:db8:30fa:5877::1</code> for outbound traffic such as pings and traceroutes.<br />
However, I noticed that the wrong address is being selected for outgoing packets:</p>

<pre><code>$ ping 2001:db8:57eb:8479::2

$ sudo tcpdump -n icmp6
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on venet0, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
00:44:48.704099 IP6 2001:db8:30fa:5877::beef &gt; 2001:db8:57eb:8479::2: ICMP6, echo request, seq 1, length 64
00:44:48.704188 IP6 2001:db8:57eb:8479::2 &gt; 2001:db8:30fa:5877::beef: ICMP6, echo reply, seq 1, length 64
00:44:49.704011 IP6 2001:db8:30fa:5877::beef &gt; 2001:db8:57eb:8479::2: ICMP6, echo request, seq 2, length 64
00:44:49.704099 IP6 2001:db8:57eb:8479::2 &gt; 2001:db8:30fa:5877::beef: ICMP6, echo reply, seq 2, length 64
</code></pre>

<p>I started searching for a solution, and learned that:</p>

<ul>
<li><a rel="nofollow" href="https://tools.ietf.org/html/rfc3484">Default Address Selection for Internet Protocol version 6 (IPv6)</a> is a very complicated topic.</li>
<li><p>An application can explicitly specify a source address.<br />
For example, I can invoke <code>ping -I 2001:db8:30fa:5877::1 2001:db8:57eb:8479::2</code> to use the desired source address.</p></li>
<li><p>Each local IPv6 address can be either "preferred" or "deprecated".<br />
If the application does not specify a source address, the system would prefer to use a "preferred" address instead of a "deprecated" address.</p></li>
</ul>

<p>Currently, both addresses are "preferred" on my server:</p>

<pre><code>$ ip addr show dev ens3
2: ens3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 92:b6:ab:eb:04:00 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.30/24 brd 192.0.2.255 scope global dynamic ens3
       valid_lft 21599977sec preferred_lft 21599977sec
    inet6 2001:db8:30fa:5877::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 2001:db8:30fa:5877::beef/64 scope global
       valid_lft forever preferred_lft forever
</code></pre>

<p>This means, both addresses are equally possible of being used as the default source address.<br />
If I can make <code>2001:db8:30fa:5877::1</code> "preferred" and all other addresses "deprecated", I would achieve my goal of making <code>2001:db8:30fa:5877::1</code> the default source address for outbound traffic.</p>

<p>How can I set an IPv6 address as "deprecated"?<br />
After some digging, I found that it is controlled by the <code>preferred_lft</code> (preferred lifetime) attribute.<br />
This attribute indicates the remaining time an IP address is to remain "preferred".<br />
Unless it is set to "forever", <code>preferred_lft</code> counts down every second, and the IP address becomes "deprecated" when it reaches zero.<br />
If the IP address was added with <code>preferred_lft</code> set to zero, it would be "deprecated" since the beginning.</p>

<p>Netplan gained support for <code>preferred_lft</code> setting <a rel="nofollow" href="https://bugs.launchpad.net/netplan/+bug/1803203">very recently</a> since version <code>0.100-0ubuntu4</code>.<br />
The syntax to specify <code>preferred_lft</code> of an IPv6 address is:</p>

<pre><code>addresses:
  - 2001:db8:30fa:5877::1/64
  - 2001:db8:30fa:5877::beef/64:
      lifetime: 0
</code></pre>

<p>Notice that there is a colon (<code>:</code>) after the IPv6 address <code>2001:db8:30fa:5877::beef/64</code>, because it is syntactically a map key instead of a string value.<br />
The equivalent structure in JSON looks like:</p>

<pre><code>{
  "addresses": [
    "2001:db8:30fa:5877::1/64",
    {
      "2001:db8:30fa:5877::beef/64": {
        "lifetime": 0
      }
    }
  ]
}
</code></pre>

<p>After applying this change, the IPv6 address <code>2001:db8:30fa:5877::beef</code> is correctly marked as "deprecated" and no longer selected as the default source address.<br />
Now I can securely host my secret beef recipes on <code>2001:db8:30fa:5877::beef</code> without worrying about others discovering this "deprecated" IPv6 address through my outbound network traffic.</p>

<pre><code>$ sudo netplan apply

$ ip addr show dev ens3
2: ens3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 92:b6:ab:eb:04:00 brd ff:ff:ff:ff:ff:ff
    inet 192.0.2.30/24 brd 192.0.2.255 scope global dynamic ens3
       valid_lft 21598263sec preferred_lft 21598263sec
    inet6 2001:db8:30fa:5877::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 2001:db8:30fa:5877::beef/64 scope global deprecated
       valid_lft forever preferred_lft 0sec

$ ping 2001:db8:57eb:8479::2

$ sudo tcpdump -n icmp6
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on venet0, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
00:44:48.704099 IP6 2001:db8:30fa:5877::1 &gt; 2001:db8:57eb:8479::2: ICMP6, echo request, seq 1, length 64
00:44:48.704188 IP6 2001:db8:57eb:8479::2 &gt; 2001:db8:30fa:5877::1: ICMP6, echo reply, seq 1, length 64
00:44:49.704011 IP6 2001:db8:30fa:5877::1 &gt; 2001:db8:57eb:8479::2: ICMP6, echo request, seq 2, length 64
00:44:49.704099 IP6 2001:db8:57eb:8479::2 &gt; 2001:db8:30fa:5877::1: ICMP6, echo reply, seq 2, length 64
</code></pre>

<p>This article explained how to change default IPv6 source address selection by marking an IPv6 address "deprecated" via Netplan.<br />
The described technique works in KVM and Ubuntu 20.04, and has been tested in a VPS provided by Spartan Host.<br />
If you are using a OpenVZ 7 container, check out <a rel="nofollow" href="https://yoursunny.com/t/2020/preferred-lft-vz7/">How to Select Default IPv6 Source Address for Outbound Traffic in OpenVZ 7</a>.</p>
]]>
        </description>
    </item>
    <item>
        <title>FATAL -&gt; Failed to fork. (Ubuntu 18.04 / OVZ)</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/2205/fatal-failed-to-fork-ubuntu-18-04-ovz</link>
        <pubDate>Sat, 05 Dec 2020 13:14:10 +0000</pubDate>
        <category>Help</category>
        <dc:creator>Xenic</dc:creator>
        <guid isPermaLink="false">2205@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Hello, i rented from InceptionHosting some NAT VPSses and the one from London makes Problems right now. If i run "apt-get update" or "apt-get install ..." it will don't install the Package, it displays me directly after the normal process "FATAL -&gt; Failed to fork.<br />
" Have someone here also the Issue? I'm using Ubuntu 18.04.5 LTS<br />
Thanks for Help,<br />
Xenic</p>
]]>
        </description>
    </item>
    <item>
        <title>Wireguard now in Ubuntu distro repos across 16.04, 18.04, 19.10, 20.04</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/1671/wireguard-now-in-ubuntu-distro-repos-across-16-04-18-04-19-10-20-04</link>
        <pubDate>Mon, 24 Aug 2020 13:58:59 +0000</pubDate>
        <category>Technical</category>
        <dc:creator>vimalware</dc:creator>
        <guid isPermaLink="false">1671@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Ref: my discovery post about wireguard on Ubuntu no longer needing a 3rd party PPA for installation : <a href="https://talk.lowendspirit.com/discussion/comment/35886/#Comment_35886" rel="nofollow">https://talk.lowendspirit.com/discussion/comment/35886/#Comment_35886</a></p>

<blockquote><div>
  <p>Wireguard is now in bionic-updates.<br />
  PPA+dkms no longer required for bionic users.</p>
</div></blockquote>

<p>Apparently, there was an official announce by Jason Donenfeld (author) on the mailing list on the next  day : Aug 3, 2020.</p>

<p>You can safely remove the PPA config from /etc/apt/sources.d/ if you were previously on it on the supported OSes.<br />
<a href="https://lists.zx2c4.com/pipermail/wireguard/2020-August/005737.html" rel="nofollow">https://lists.zx2c4.com/pipermail/wireguard/2020-August/005737.html</a></p>

<blockquote><div>
  <p>Hi folks,</p>
  
  <p>At long last, Ubuntu now supports WireGuard on releases 20.04, 19.10,<br />
  18.04, and 16.04, which means we've got all currently supported LTS<br />
  releases covered. For that reason, we're in the process of sunsetting<br />
  the PPA that previously provided packages to some users. This email<br />
  details possible changes users might consider.</p>
  
  <p>The right way to install WireGuard on Ubuntu now consists of a single<br />
  command:</p>

<pre><code>$ sudo apt install wireguard
</code></pre>
  
  <p>This "wireguard" package will <em>automatically</em> pull in either one or two<br />
  packages with it:</p>
  
  <p>1) wireguard-tools: this will always be pulled in and provides wg(8)<br />
       and wg-quick(8).<br />
    2) wireguard-dkms: this will only be pulled in if your kernel doesn't<br />
       already come with WireGuard.</p>
  
  <p>As suggested by (2), most Ubuntu kernels now come with WireGuard out of<br />
  the box, even older releases, to which WireGuard has been backported.<br />
  This is great news and will result in much better reliability during<br />
  upgrades, as well as smoother compatibility with SecureBoot.</p>
  
  <p>--snipped--</p>
</div></blockquote>

<p>As a very good general recommendation for people new to wireguard ,<br />
USE <a href="https://github.com/Nyr/wireguard-install/" rel="nofollow">https://github.com/Nyr/wireguard-install/</a>  (read the README first)</p>

<p>I have reviewed nyr's wireguard-install script and I am satisfied that it is well done.<br />
I compared it with a manually configured wireguard tunnel, and all the defaults seem sensible.<br />
Anything that saves you time should be welcomed.<br />
Shoutout to <a href="https://staging.lowendspirit.com/index.php?p=/profile/nyr" rel="nofollow">@nyr</a>, a long time LET/S MVP.</p>
]]>
        </description>
    </item>
    <item>
        <title>Are distribution upgrades in OVZ7 generally supported?</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/909/are-distribution-upgrades-in-ovz7-generally-supported</link>
        <pubDate>Fri, 17 Apr 2020 09:29:35 +0000</pubDate>
        <category>Technical</category>
        <dc:creator>andreipoe</dc:creator>
        <guid isPermaLink="false">909@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Hello,</p>

<p>For anyone running Debian or Ubuntu in OpenVZ 7 containers, what has your experience been upgrading between OS versions, <em>à la</em> <code>dist-upgrade</code>/<code>do-release-upgrade</code>? Is it safe to assume it works these days, or would you rather reinstall a provided template?</p>

<p><a href="https://staging.lowendspirit.com/index.php?p=/profile/AnthonySmith" rel="nofollow">@AnthonySmith</a> At InceptionHosting in particular, is it safe to upgrade my servers without reinstalling?</p>

<p>Thanks.</p>
]]>
        </description>
    </item>
   </channel>
</rss>
