summaryrefslogtreecommitdiff
path: root/gemfeed
diff options
context:
space:
mode:
Diffstat (limited to 'gemfeed')
-rw-r--r--gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi1
-rw-r--r--gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi1
-rw-r--r--gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi1
-rw-r--r--gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi1
-rw-r--r--gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi4
-rw-r--r--gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl2
-rw-r--r--gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi4
-rw-r--r--gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl2
-rw-r--r--gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi2
-rw-r--r--gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi4
-rw-r--r--gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi.tpl2
-rw-r--r--gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi.tpl (renamed from gemfeed/DRAFT-kubernetes-with-freebsd-part-5.gmi.tpl)135
-rw-r--r--gemfeed/DRAFT-kubernetes-with-freebsd-part-5.gmi902
-rw-r--r--gemfeed/atom.xml1212
-rw-r--r--gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg2
-rw-r--r--gemfeed/index.gmi1
16 files changed, 1144 insertions, 1132 deletions
diff --git a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi
index 02ce49c0..67e7d8df 100644
--- a/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi
+++ b/gemfeed/2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi
@@ -397,6 +397,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-)
Other *BSD related posts are:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
diff --git a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi
index 2a6e72b1..20a64ee1 100644
--- a/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi
+++ b/gemfeed/2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi
@@ -676,6 +676,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-)
Other *BSD related posts are:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
diff --git a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi
index 90af3915..41c0d806 100644
--- a/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi
+++ b/gemfeed/2024-01-13-one-reason-why-i-love-openbsd.gmi
@@ -51,6 +51,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-)
Other *BSD related posts are:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
diff --git a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi
index d15b3d7b..f04602be 100644
--- a/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi
+++ b/gemfeed/2024-04-01-KISS-high-availability-with-OpenBSD.gmi
@@ -300,6 +300,7 @@ E-Mail your comments to `paul@nospam.buetow.org` :-)
Other *BSD and KISS related posts are:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
diff --git a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi
index 91d6eef9..1716dba0 100644
--- a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi
+++ b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi
@@ -12,10 +12,11 @@ These are all the posts so far:
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
-> Logo was generated by ChatGPT.
+> ChatGPT generated logo..
Let's begin...
@@ -160,6 +161,7 @@ Read the next post of this series:
Other *BSD-related posts:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
diff --git a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl
index 3bc41675..3330cca1 100644
--- a/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl
+++ b/gemfeed/2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi.tpl
@@ -12,7 +12,7 @@ These are all the posts so far:
=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
-> Logo was generated by ChatGPT.
+> ChatGPT generated logo..
Let's begin...
diff --git a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi
index dc774440..8f362270 100644
--- a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi
+++ b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi
@@ -12,10 +12,11 @@ These are all the posts so far:
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
-> Logo was generated by ChatGPT.
+> ChatGPT generated logo..
Let's continue...
@@ -299,6 +300,7 @@ Read the next post of this series:
Other *BSD-related posts:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)
diff --git a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl
index eb385d9d..59f65186 100644
--- a/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl
+++ b/gemfeed/2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi.tpl
@@ -12,7 +12,7 @@ These are all the posts so far:
=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
-> Logo was generated by ChatGPT.
+> ChatGPT generated logo..
Let's continue...
diff --git a/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi
index 2babbc19..b32d4dc0 100644
--- a/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi
+++ b/gemfeed/2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi
@@ -8,6 +8,7 @@ This is the third blog post about my f3s series for my self-hosting demands in m
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
@@ -360,6 +361,7 @@ See you in the next post of this series!
Other BSD related posts are:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
diff --git a/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi b/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi
index c315d017..18e6b182 100644
--- a/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi
+++ b/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi
@@ -8,6 +8,7 @@ This is the fourth blog post about the f3s series for self-hosting demands in a
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs (You are currently reading this)
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
@@ -502,10 +503,11 @@ Future uses (out of scope for this blog series) would be additional VMs for diff
This flexibility is great for keeping options open and managing different workloads without overcomplicating things. Overall, it's a nice setup for getting the most out of my hardware and keeping things running smoothly.
-See you in the next blog post of this series. Maybe we will be installing highly available storage with HAST or we start setting up k3s on the Rocky Linux VMs.
+See you in the next post of this series!
Other *BSD-related posts:
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs (You are currently reading this)
=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
diff --git a/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi.tpl b/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi.tpl
index 50ea4564..e69a0ded 100644
--- a/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi.tpl
+++ b/gemfeed/2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi.tpl
@@ -474,7 +474,7 @@ Future uses (out of scope for this blog series) would be additional VMs for diff
This flexibility is great for keeping options open and managing different workloads without overcomplicating things. Overall, it's a nice setup for getting the most out of my hardware and keeping things running smoothly.
-See you in the next blog post of this series. Maybe we will be installing highly available storage with HAST or we start setting up k3s on the Rocky Linux VMs.
+See you in the next post of this series!
Other *BSD-related posts:
diff --git a/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.gmi.tpl b/gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi.tpl
index b2c60c29..cc0a7eff 100644
--- a/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.gmi.tpl
+++ b/gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi.tpl
@@ -1,6 +1,8 @@
# f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
-This is the fith blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.
+> Published at 2025-05-11T11:35:57+03:00
+
+This is the fifth blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.
I will post a new entry every month or so (there are too many other side projects for more frequent updates — I bet you can understand).
@@ -10,7 +12,7 @@ These are all the posts so far:
=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
-> Logo was generated by ChatGPT.
+> ChatGPT generated logo.
Let's begin...
@@ -18,7 +20,7 @@ Let's begin...
## Introduction
-By default, traffic within my home LAN, including traffic inside a k3s cluster, is not encrypted. While it resides in the "secure" home LAN, adopting a zero-trust policy means encryption is still preferable to ensure confidentiality and security. So we decide to secure all the traffic of all f3s participating hosts by building a mesh network of all participating hosts.
+By default, traffic within my home LAN, including traffic inside a k3s cluster, is not encrypted. While it resides in the "secure" home LAN, adopting a zero-trust policy means encryption is still preferable to ensure confidentiality and security. So we decide to secure all the traffic of all f3s participating hosts by building a mesh network of all participating hosts:
=> ./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg Full mesh network
@@ -26,39 +28,42 @@ Whereas `f0`, `f1`, and `f2` are the FreeBSD base hosts, `r0`, `r1`, and `r2` ar
As we can see from the graph, it is a true full-mesh network, where every host has a VPN tunnel to every other host. The benefit is that we do not need to route traffic through intermediate hosts (significantly simplifying the routing configuration). However, the downside is that there is some overhead in configuring and managing all the tunnels.
-For simplicity, we also establish VPN tunnels between `f0 <-> r0`, `f1 <-> r1`, and `f2 <-> r2`. Technically, this wouldn't be strictly required since the VMs `rN` are running on the hosts `fN`, and there is no network traffic leaving the box. However, it simplifies the configuration as we don't have to account for exceptions, and we are going to automate the mesh network configuration anyway (read on).
+For simplicity, we also establish VPN tunnels between `f0 <-> r0`, `f1 <-> r1`, and `f2 <-> r2`. Technically, this wouldn't be strictly required since the VMs `rN` are running on the hosts `fN`, and no network traffic is leaving the box. However, it simplifies the configuration as we don't have to account for exceptions, and we are going to automate the mesh network configuration anyway (read on).
### Expected traffic flow
-The traffic is expected to flow as follows between the host groups through the mesh network.
+The traffic is expected to flow between the host groups through the mesh network as follows:
-* `fN <-> rN`: The traffic between the FreeBSD hosts and the Rocky Linux VMs will be routed through the VPN tunnels for persistent storage. In a later post in this series, we will be setting up a NFS server on the `fN` hosts.
-* `fN <-> blowfish,fishfinger`: The traffic between the FreeBSD hosts and the OpenBSD host `blowfish,fishfinger` will be routed through the VPN tunnels for management. I may want to login via the internet to the setup to remotely manage it. It will also be used for monitoring purposes.
+* `fN <-> rN`: The traffic between the FreeBSD hosts and the Rocky Linux VMs will be routed through the VPN tunnels for persistent storage. In a later post in this series, we will set up an NFS server on the `fN` hosts.
+* `fN <-> blowfish,fishfinger`: The traffic between the FreeBSD hosts and the OpenBSD host `blowfish,fishfinger` will be routed through the VPN tunnels for management. We may want to log in via the internet to set it up remotely. The VPN tunnel will also be used for monitoring purposes.
* `rN <-> blowfish,fishfinger`: The traffic between the Rocky Linux VMs and the OpenBSD host `blowfish,fishfinger` will be routed through the VPN tunnels for usage traffic. Since `k3s` will be running on the `rN` hosts, the OpenBSD servers will route the traffic through `relayd` to the services running in Kubernetes.
* `fN <-> fM`: The traffic between the FreeBSD hosts may be later used for data replication for the NFS storage.
* `rN <-> rM`: The traffic between the Rocky Linux VMs will later be used by the `k3s` cluster itself, as every `rN` will be a Kubernetes worker node.
* `blowfish <-> fishfinger`: The traffic between the OpenBSD hosts isn't strictly required for this setup, but I set it up anyway for future use cases.
-We won't cover all the details in this blog post, as in this blog post we only focus on setting up the Mesh network. The details will be covered in subsequent posts of this series.
+We won't cover all the details in this blog post, as we only focus on setting up the Mesh network in this blog post. Subsequent posts in this series will cover the other details.
## Deciding on WireGuard
-I have decided on using WireGuard as the VPN technology for this purpose.
+I have decided to use WireGuard as the VPN technology for this purpose.
WireGuard is a lightweight, modern, and secure VPN protocol designed for simplicity, speed, and strong cryptography. It is an excellent choice due to its minimal codebase, ease of configuration, high performance, and robust security, utilizing state-of-the-art encryption standards. WireGuard is supported on various operating systems, and its implementations are compatible with each other. Therefore, establishing WireGuard VPN tunnels between FreeBSD, Linux, and OpenBSD is seamless. This cross-platform availability makes it suitable for setups like the one described in this blog series.
-We could have used Tailscale for an easy to setup and manage a WireGuard network, but the benefits of creating our own mesh network are:
+We could have used Tailscale for an easy to set up and manage the WireGuard network, but the benefits of creating our own mesh network are:
* Learning about WireGuard configuration details
* Have full control over the setup
* Don't rely on an external provider like Tailscale (even if some of the components are open-source)
* Have even more fun along the way
-* WireGuard is easy to configure on my target operating systems, and therefore easier to maintain in the longer run.
+* WireGuard is easy to configure on my target operating systems and, therefore, easier to maintain in the long run.
+* There are no official Tailscale packages available for OpenBSD and FreeBSD. However, getting Tailscale running on these systems is still possible, though some tinkering would be required. Instead, we use that tinkering time to set up WireGuard tunnels ourselves.
=> https://en.wikipedia.org/wiki/WireGuard
=> https://www.wireguard.com/
=> https://tailscale.com/
+=> ./f3s-kubernetes-with-freebsd-part-5/wireguard.svg WireGuard Logo
+
## Base configuration
In the following, we prepare the base configuration for the WireGuard mesh network. We will use a similar configuration on all participating hosts, with the exception of the host IP addresses and the private keys.
@@ -98,7 +103,7 @@ interface: wg0
listening port: 20246
```
-For now, we have wireguard up and running, but without any useful configuration yet. We will come back to that later.
+We now have the WireGuard up and running, but it is not yet in any functional configuration. We will come back to that later.
Next, we add all the participating WireGuard IPs to the `hosts` file. This is only convenience, so we don't have to manage an external DNS server for this:
@@ -122,11 +127,11 @@ paul@f0:~ % cat <<END | doas tee -a /etc/hosts
END
```
-As you can see, `192.168.1.0/24` is the network used in my LAN (with the `fN` and `rN` hosts) and `192.168.2.0/24` the network used for the WireGuard mesh network. The `wg0` interface will be used for all WireGuard traffic.
+As you can see, `192.168.1.0/24` is the network used in my LAN (with the `fN` and `rN` hosts) and `192.168.2.0/24` is the network used for the WireGuard mesh network. The `wg0` interface will be used for all WireGuard traffic.
### Rocky Linux
-We bring the Rocky Linux VMs up to date as well as following:
+We bring the Rocky Linux VMs up to date as well with the following:
```sh
[root@r0 ~] dnf update -y
@@ -178,7 +183,7 @@ Unfortunately, the SELinux policy on Rocky Linux blocks WireGuard's operation. B
### OpenBSD
-Other than the FreeBSD and Rocky Linux hosts involved, my OpenBSD hosts (`blowfish` and `fishfinger`, which are running at OpenBSD Amsterdam and Hetzner in the internet) exist already for longer, so I can't provide you with the "from scratch" installation details here. In the following, we will only focus on the additional configuration needed to set up WireGuard:
+Other than the FreeBSD and Rocky Linux hosts involved, my OpenBSD hosts (`blowfish` and `fishfinger`, which are running at OpenBSD Amsterdam and Hetzner on the internet) have been running already for longer, so I can't provide you with the "from scratch" installation details here. In the following, we will only focus on the additional configuration needed to set up WireGuard:
```sh
blowfish$ doas pkg_add wireguard-tools
@@ -191,7 +196,7 @@ up
END
```
-Note, that on `blowfish` we configure `192.168.2.110` here in the `hostname.wg`, on `fishfinger` we configure `192.168.2.111`. Those are the IP addresses of the WireGuard interfaces on those hosts.
+Note that on `blowfish`, we configure `192.168.2.110` here in the `hostname.wg`, and on `fishfinger`, we configure `192.168.2.111`. Those are the IP addresses of the WireGuard interfaces on those hosts.
And here, we also update the `hosts` file accordingly:
@@ -213,7 +218,7 @@ END
## WireGuard configuration
-So far, we only started WireGuard on all participating hosts but without any useful configuration. Means, there aren't any VPN connetion established yet between any of the hosts.
+So far, we have only started WireGuard on all participating hosts without any useful configuration. This means that no VPN tunnel has been established yet between any of the hosts.
### Example `wg0.conf`
@@ -285,44 +290,60 @@ PersistentKeepalive = 25
Whereas there are two main sections. One is `[Interface]`, which configures the current host (here: `f0`):
-* Address: Local virtual IP address on the WireGuard interface.
-* PrivateKey: Private key for this node.
-* ListenPort: Port on which this WireGuard interface listens for incoming connections.
+* `Address`: Local virtual IP address on the WireGuard interface.
+* `PrivateKey`: Private key for this node.
+* `ListenPort`: Port on which this WireGuard interface listens for incoming connections.
-And in the following there is one `[Peer]` section for every peer node on the mesh network:
+And in the following, there is one `[Peer]` section for every peer node on the mesh network:
-* PublicKey: Public key of the remote peer to authenticate their identity.
-* PresharedKey: Optional symmetric key to enhance security (used in addition to PublicKey).
-* AllowedIPs: IPs or subnets routed through this peer (traffic is allowed to/from these IPs).
-* Endpoint: The public IP:port combination of the remote peer for connection.
-* PersistentKeepalive: Keeps the connection alive by sending periodic packets; used for NAT traversal.
+* `PublicKey`: The public key of the remote peer is used to authenticate their identity.
+* `PresharedKey`: An optional symmetric key is used to enhance security (used in addition to PublicKey).
+* `AllowedIPs`: IPs or subnets routed through this peer (traffic is allowed to/from these IPs).
+* `Endpoint`: The public IP:port combination of the remote peer for connection.
+* `PersistentKeepalive`: Keeps the tunnel alive by sending periodic packets; used for NAT traversal.
-### NAT traversal
+### NAT traversal and keepalive
-As all participating hosts, except for `blowfish` and `fishfinger` (which are on the internet), are behind a NAT gateway (my home router), we need to use `PersistentKeepalive` to establish and maintain the VPN connection from the LAN to the internet because:
+As all participating hosts, except for `blowfish` and `fishfinger` (which are on the internet), are behind a NAT gateway (my home router), we need to use `PersistentKeepalive` to establish and maintain the VPN tunnel from the LAN to the internet because:
> By default, WireGuard tries to be as silent as possible when not being used; it is not a chatty protocol. For the most part, it only transmits data when a peer wishes to send packets. When it's not being asked to send packets, it stops sending packets until it is asked again. In the majority of configurations, this works well. However, when a peer is behind NAT or a firewall, it might wish to be able to receive incoming packets even when it is not sending any packets. Because NAT and stateful firewalls keep track of "connections", if a peer behind NAT or a firewall wishes to receive incoming packets, he must keep the NAT/firewall mapping valid, by periodically sending keepalive packets. This is called persistent keepalives. When this option is enabled, a keepalive packet is sent to the server endpoint once every interval seconds. A sensible interval that works with a wide variety of firewalls is 25 seconds. Setting it to 0 turns the feature off, which is the default, since most users will not need this, and it makes WireGuard slightly more chatty. This feature may be specified by adding the PersistentKeepalive = field to a peer in the configuration file, or setting persistent-keepalive at the command line. If you don't need this feature, don't enable it. But if you're behind NAT or a firewall and you want to receive incoming connections long after network traffic has gone silent, this option will keep the "connection" open in the eyes of NAT.
-That's why you see `PersistentKeepAlive = 25` in the `blowfish` and `fishfinger` peer configurations. This means that every 25 seconds, a keep-alive signal is sent over the tunnel to maintain its connection. Additionally, if the tunnel is not yet established, it will be created within 25 seconds at most.
+That's why you see `PersistentKeepAlive = 25` in the `blowfish` and `fishfinger` peer configurations. This means that every 25 seconds, a keep-alive signal is sent over the tunnel to maintain its connection. If the tunnel is not yet established, it will be created within 25 seconds latest.
+
+Without this, we might never have a VPN tunnel open, as the systems in the LAN may not actively attempt to contact `blowfish` and `fishfinger` on their own. In fact, the opposite would likely occur, with the traffic flowing inward instead of outward (this is beyond the scope of this blog post but will be covered in a later post in this series!).
+
+### Preshared key
+
+In a WireGuard configuration, the PSK (preshared key) is an optional additional layer of symmetric encryption used alongside the standard public key cryptography. It is a shared secret known to both peers that enhances security by requiring an attacker to compromise both the private keys and the PSK to decrypt communication. While optional, using a PSK is better as it strengthens the cryptographic security, mitigating risks of potential vulnerabilities in the key exchange process.
-Without this configuration, we might never have a VPN connection open, as the systems in the LAN may not actively attempt to contact `blowfish` and `fishfinger` on their own. In fact, the opposite would likely occur, with the traffic flowing inward instead of outward (this is beyond the scope of this blog post but will be covered in a later post in this series!).
+So, because it's better, we are using it.
## Mesh network generator
-Manually generating `wg0.conf` files for every peer in a mesh network setup is cumbersome because each peer requires its own unique public/private key pair and a preshared key for each VPN connection (resulting in 29 preshared keys for 8 hosts). This complexity scales exponentially with the number of peers as the relationships between all peers must be explicitly defined, including their unique configurations such as `AllowedIPs`, `Endpoint`, and optional settings like `PersistentKeepalive`. Automating the process ensures consistency, reduces human error, saves considerable time, and allows for centralized management of configuration files.
+Manually generating `wg0.conf` files for every peer in a mesh network setup is cumbersome because each peer requires its own unique public/private key pair and a preshared key for each VPN tunnel (resulting in 29 preshared keys for 8 hosts). This complexity scales exponentially with the number of peers as the relationships between all peers must be explicitly defined, including their unique configurations such as `AllowedIPs` and `Endpoint` and optional settings like `PersistentKeepalive`. Automating the process ensures consistency, reduces human error, saves considerable time, and allows for centralized management of configuration files.
Instead, a script can handle key generation, coordinate relationships, and generate all necessary configuration files simultaneously, making it scalable and far less error-prone.
-I have written `wireguardmeshgenerator.rb` (a Ruby script) to do this for our purposes:
+I have written a Ruby script `wireguardmeshgenerator.rb` to do this for our purposes:
=> https://codeberg.org/snonux/wireguardmeshgenerator
-I use Fedora Linux as my main driver on my personal Laptop, so the script was developed and tested only on Fedora Linux, but should also work on other Linux and Unix-like systems.
+I use Fedora Linux as my main driver on my personal Laptop, so the script was developed and tested only on Fedora Linux. However, it should also work on other Linux and Unix-like systems.
+To set up the mesh generator on Fedora Linux, we run the following:
+
+```sh
+> git clone https://codeberg.org/snonux/wireguardmeshgenerator
+> cd ./wireguardmeshgenerator
+> bundle install
+> sudo dnf install -y wireguard-tools
+```
+
+This assumes that Ruby and the `bundler` gem are already installed. If not, refer to the docs of your distribution.
### `wireguardmeshgenerator.yaml`
-The file `wireguardmeshgenerator.yaml` configures the Mesh Generator script.
+The file `wireguardmeshgenerator.yaml` configures the mesh generator script.
```
---
@@ -439,12 +460,12 @@ The file specifies details such as SSH user settings, configuration directories,
The `wireguardmeshgenerator.rb` script consists of the following base classes:
-* `KeyTool`: Manages WireGuard key generation and retrieval. It ensures the presence of public/private key pairs and preshared keys (PSKs). If keys are missing, it generates them using the `wg` tool. It provides methods to read the public/private keys and to retrieve or generate a PSK for communication with a peer. The keys are stored in a temp directory on the system from where the generator is run from.
-* `PeerSnippet`: A `Struct` that represents the configuration for a single WireGuard peer in the mesh. It generates the peer's WireGuard configuration, including public key, PSK, allowed IPs, endpoint, and keepalive settings, based on the provided attributes and configuration.
-* `WireguardConfig`: Generates WireGuard configuration files for the specified host in the mesh network. It includes the `[Interface]` section for the host itself and the `[Peer]` sections for all other peers. It can also clean up generated files and directories and create the required directory structure for storing configuration files locally on the server from where the script is run from.
-* `InstallConfig`: Handles uploading, installing, and restarting the WireGuard service on remote hosts using SSH and SCP. It ensures that the configuration file is uploaded to the remote machine, the necessary directories are present and correctly configured, and the WireGuard service is reloaded with the new configuration.
+* `KeyTool`: Manages WireGuard key generation and retrieval. It ensures the presence of public/private key pairs and preshared keys (PSKs). If keys are missing, it generates them using the `wg` tool. It provides methods to read the public/private keys and retrieve or generate a PSK for communication with a peer. The keys are stored in a temp directory on the system from where the generator is run.
+* `PeerSnippet`: A `Struct` representing the configuration for a single WireGuard peer in the mesh. Based on the provided attributes and configuration, it generates the peer's WireGuard configuration, including public key, PSK, allowed IPs, endpoint, and keepalive settings.
+* `WireguardConfig`: This function generates WireGuard configuration files for the specified host in the mesh network. It includes the `[Interface]` section for the host itself and the `[Peer]` sections for all other peers. It can also clean up generated files and directories and create the required directory structure for storing configuration files locally on the system from which the script is run.
+* `InstallConfig`: Handles uploading, installing, and restarting the WireGuard service on remote hosts using SSH and SCP. It ensures the configuration file is uploaded to the remote machine, the necessary directories are present and correctly configured, and the WireGuard service reloads with the new configuration.
-At the end (if you want to see the code for the stuff listed above, go to the Git repo and have a look), we just glue all together in this block:
+At the end (if you want to see the code for the stuff listed above, go to the Git repo and have a look), we glue it all together in this block:
```ruby
begin
@@ -468,7 +489,7 @@ begin
conf = YAML.load_file('wireguardmeshgenerator.yaml').freeze
conf['hosts'].keys.select { options[:hosts].empty? || options[:hosts].include?(_1) }
.each do |host|
- # Generate Wireguard configuration for the hostreload!
+ # Generate Wireguard configuration for the host reload!
WireguardConfig.new(host, conf['hosts']).generate! if options[:generate]
# Install Wireguard configuration for the host.
InstallConfig.new(host, conf['hosts']).upload!.install!.reload! if options[:install]
@@ -505,7 +526,7 @@ task default: :generate
### Generating the `wg0.conf` files and keys
-To generate everything (the `wg0.conf` of all participating hosts including all keys involved), we simply run:
+To generate everything (the `wg0.conf` of all participating hosts, including all keys involved), we run the following:
```sh
> rake generate
@@ -570,11 +591,11 @@ keys/fishfinger/priv.key
keys/fishfinger/pub.key
```
-Those keys are embedded in the resulting `wg0.conf`, so later, we only need to install the `wg0.conf` files instead of the keys individually.
+Those keys are embedded in the resulting `wg0.conf`, so later, we only need to install the `wg0.conf` files and not all the keys individually.
### Installing the `wg0.conf` files
-Uploading the `wg0.conf` files to the participating hosts and reloading WireGuard on them then is just a matter of executing (this expects, that all participating hosts are up and running):
+Uploading the `wg0.conf` files to the participating hosts and reloading WireGuard on them is then just a matter of executing (this expects, that all participating hosts are up and running):
```sh
> rake install
@@ -685,7 +706,19 @@ Uploading cmd.sh to fishfinger.buetow.org:.
+ rm cmd.sh
```
-## Happy WireGuarding
+### Re-generating mesh and installing the `wg0.conf` files again
+
+The mesh network can be re-generated and re-installed as follows:
+
+```sh
+> rake clean
+> rake generate
+> rake install
+```
+
+That would also delete and re-generate all the keys involved.
+
+## Happy WireGuard-ing
All is set up now. E.g. on `f0`:
@@ -738,7 +771,7 @@ peer: SlGVsACE1wiaRoGvCR3f7AuHfRS+1jjhS+YwEJ2HvF0=
allowed ips: 192.168.2.132/32
```
-And all the hosts are pingable as well, e.g.:
+All the hosts are pingable as well, e.g.:
```sh
paul@f0:~ % foreach peer ( f1 f2 r0 r1 r2 blowfish fishfinger )
@@ -802,9 +835,9 @@ PING fishfinger.wg0 (192.168.2.111): 56 data bytes
round-trip min/avg/max/stddev = 33.751/33.872/33.992/0.120 ms
```
-Note, that the loop above is a `tcsh` loop, the default shell used in FreeBSD. Of course, all other peers can ping their peers as well!
+Note that the loop above is a `tcsh` loop, the default shell used in FreeBSD. Of course, all other peers can ping their peers as well!
-After the first ping, VPN connections now also show handshakes and amount of data transferred through them:
+After the first ping, VPN tunnels now also show handshakes and the amount of data transferred through them:
```sh
paul@f0:~ % doas wg show
@@ -863,9 +896,11 @@ peer: 2htXdNcxzpI2FdPDJy4T4VGtm1wpMEQu1AkQHjNY6F8=
allowed ips: 192.168.2.131/32
```
-TODO: Add steps to install wireguard-tools on Fedora Linux as well
-TODO: Describe the PSK
-TODO: Add WireGuard logo somewhere, under happy WiregGuarding?
+## Conclusion
+
+Having a mesh network on our hosts is great for securing all the traffic between them for our future `k3s` setup. A self-managed WireGuard mesh network is better than Tailscale as it eliminates reliance on a third party and provides full control over the configuration. It reduces unnecessary abstraction and "magic," enabling easier debugging and ensuring full ownership of our network.
+
+I look forward to the next blog post in this series. We may start setting up `k3s` or take a first look at the NFS server (for persistent storage) side of things. I hope you liked all the posts so far in this series.
Other *BSD-related posts:
diff --git a/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.gmi b/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.gmi
deleted file mode 100644
index 8a46030e..00000000
--- a/gemfeed/DRAFT-kubernetes-with-freebsd-part-5.gmi
+++ /dev/null
@@ -1,902 +0,0 @@
-# f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
-
-This is the fith blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.
-
-I will post a new entry every month or so (there are too many other side projects for more frequent updates — I bet you can understand).
-
-These are all the posts so far:
-
-=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage
-=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
-=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
-=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
-
-=> ./f3s-kubernetes-with-freebsd-part-1/f3slogo.png f3s logo
-
-> Logo was generated by ChatGPT.
-
-Let's begin...
-
-## Table of Contents
-
-* ⇢ f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
-* ⇢ ⇢ Introduction
-* ⇢ ⇢ ⇢ Expected traffic flow
-* ⇢ ⇢ Deciding on WireGuard
-* ⇢ ⇢ Base configuration
-* ⇢ ⇢ ⇢ FreeBSD
-* ⇢ ⇢ ⇢ Rocky Linux
-* ⇢ ⇢ ⇢ OpenBSD
-* ⇢ ⇢ WireGuard configuration
-* ⇢ ⇢ ⇢ Example `wg0.conf`
-* ⇢ ⇢ ⇢ NAT traversal
-* ⇢ ⇢ Mesh network generator
-* ⇢ ⇢ ⇢ `wireguardmeshgenerator.yaml`
-* ⇢ ⇢ ⇢ `wireguardmeshgenerator.rb` overview
-* ⇢ ⇢ Invoking the mesh network generator
-* ⇢ ⇢ ⇢ Generating the `wg0.conf` files and keys
-* ⇢ ⇢ ⇢ Installing the `wg0.conf` files
-* ⇢ ⇢ Happy WireGuarding
-
-## Introduction
-
-By default, traffic within my home LAN, including traffic inside a k3s cluster, is not encrypted. While it resides in the "secure" home LAN, adopting a zero-trust policy means encryption is still preferable to ensure confidentiality and security. So we decide to secure all the traffic of all f3s participating hosts by building a mesh network of all participating hosts.
-
-=> ./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg Full mesh network
-
-Whereas `f0`, `f1`, and `f2` are the FreeBSD base hosts, `r0`, `r1`, and `r2` are the Rocky Linux Bhyve VMs, and `blowfish` and `fishfinger` are two OpenBSD systems running on the internet (as mentioned in the first blog of this series—these systems are already built; in fact, this very blog is served by those OpenBSD systems).
-
-As we can see from the graph, it is a true full-mesh network, where every host has a VPN tunnel to every other host. The benefit is that we do not need to route traffic through intermediate hosts (significantly simplifying the routing configuration). However, the downside is that there is some overhead in configuring and managing all the tunnels.
-
-For simplicity, we also establish VPN tunnels between `f0 <-> r0`, `f1 <-> r1`, and `f2 <-> r2`. Technically, this wouldn't be strictly required since the VMs `rN` are running on the hosts `fN`, and there is no network traffic leaving the box. However, it simplifies the configuration as we don't have to account for exceptions, and we are going to automate the mesh network configuration anyway (read on).
-
-### Expected traffic flow
-
-The traffic is expected to flow as follows between the host groups through the mesh network.
-
-* `fN <-> rN`: The traffic between the FreeBSD hosts and the Rocky Linux VMs will be routed through the VPN tunnels for persistent storage. In a later post in this series, we will be setting up a NFS server on the `fN` hosts.
-* `fN <-> blowfish,fishfinger`: The traffic between the FreeBSD hosts and the OpenBSD host `blowfish,fishfinger` will be routed through the VPN tunnels for management. I may want to login via the internet to the setup to remotely manage it. It will also be used for monitoring purposes.
-* `rN <-> blowfish,fishfinger`: The traffic between the Rocky Linux VMs and the OpenBSD host `blowfish,fishfinger` will be routed through the VPN tunnels for usage traffic. Since `k3s` will be running on the `rN` hosts, the OpenBSD servers will route the traffic through `relayd` to the services running in Kubernetes.
-* `fN <-> fM`: The traffic between the FreeBSD hosts may be later used for data replication for the NFS storage.
-* `rN <-> rM`: The traffic between the Rocky Linux VMs will later be used by the `k3s` cluster itself, as every `rN` will be a Kubernetes worker node.
-* `blowfish <-> fishfinger`: The traffic between the OpenBSD hosts isn't strictly required for this setup, but I set it up anyway for future use cases.
-
-We won't cover all the details in this blog post, as in this blog post we only focus on setting up the Mesh network. The details will be covered in subsequent posts of this series.
-
-## Deciding on WireGuard
-
-I have decided on using WireGuard as the VPN technology for this purpose.
-
-WireGuard is a lightweight, modern, and secure VPN protocol designed for simplicity, speed, and strong cryptography. It is an excellent choice due to its minimal codebase, ease of configuration, high performance, and robust security, utilizing state-of-the-art encryption standards. WireGuard is supported on various operating systems, and its implementations are compatible with each other. Therefore, establishing WireGuard VPN tunnels between FreeBSD, Linux, and OpenBSD is seamless. This cross-platform availability makes it suitable for setups like the one described in this blog series.
-
-We could have used Tailscale for an easy to setup and manage a WireGuard network, but the benefits of creating our own mesh network are:
-
-* Learning about WireGuard configuration details
-* Have full control over the setup
-* Don't rely on an external provider like Tailscale (even if some of the components are open-source)
-* Have even more fun along the way
-* WireGuard is easy to configure on my target operating systems, and therefore easier to maintain in the longer run.
-
-=> https://en.wikipedia.org/wiki/WireGuard
-=> https://www.wireguard.com/
-=> https://tailscale.com/
-
-## Base configuration
-
-In the following, we prepare the base configuration for the WireGuard mesh network. We will use a similar configuration on all participating hosts, with the exception of the host IP addresses and the private keys.
-
-### FreeBSD
-
-On the FreeBSD hosts `f0`, `f1` and `f2`, similar as last time, first, we bring the system up to date:
-
-```sh
-paul@f0:~ % doas freebsd-update fetch
-paul@f0:~ % doas freebsd-update install
-paul@f0:~ % doas freebsd-update -r 14.2-RELEASE upgrade
-paul@f0:~ % doas freebsd-update install
-paul@f0:~ % doas shutdown -r now
-..
-..
-paul@f0:~ % doas pkg update
-paul@f0:~ % doas pkg upgrade
-paul@f0:~ % reboot
-```
-
-Next, we install `wireguard-tools` and configure the WireGuard service:
-
-```sh
-paul@f0:~ % doas pkg install wireguard-tools
-paul@f0:~ % doas sysrc wireguard_interfaces=wg0
-wireguard_interfaces: -> wg0
-paul@f0:~ % doas sysrc wireguard_enable=YES
-wireguard_enable: -> YES
-paul@f0:~ % doas mkdir -p /usr/local/etc/wireguard
-paul@f0:~ % doas touch /usr/local/etc/wireguard/wg0.conf
-paul@f0:~ % doas service wireguard start
-paul@f0:~ % doas wg show
-interface: wg0
- public key: L+V9o0fNYkMVKNqsX7spBzD/9oSvxM/C7ZCZX1jLO3Q=
- private key: (hidden)
- listening port: 20246
-```
-
-For now, we have wireguard up and running, but without any useful configuration yet. We will come back to that later.
-
-Next, we add all the participating WireGuard IPs to the `hosts` file. This is only convenience, so we don't have to manage an external DNS server for this:
-
-```sh
-paul@f0:~ % cat <<END | doas tee -a /etc/hosts
-
-192.168.1.120 r0 r0.lan r0.lan.buetow.org
-192.168.1.121 r1 r1.lan r1.lan.buetow.org
-192.168.1.122 r2 r2.lan r2.lan.buetow.org
-
-192.168.2.130 f0.wg0 f0.wg0.wan.buetow.org
-192.168.2.131 f1.wg0 f1.wg0.wan.buetow.org
-192.168.2.132 f2.wg0 f2.wg0.wan.buetow.org
-
-192.168.2.120 r0.wg0 r0.wg0.wan.buetow.org
-192.168.2.121 r1.wg0 r1.wg0.wan.buetow.org
-192.168.2.122 r2.wg0 r2.wg0.wan.buetow.org
-
-192.168.2.110 blowfish.wg0 blowfish.wg0.wan.buetow.org
-192.168.2.111 fishfinger.wg0 fishfinger.wg0.wan.buetow.org
-END
-```
-
-As you can see, `192.168.1.0/24` is the network used in my LAN (with the `fN` and `rN` hosts) and `192.168.2.0/24` the network used for the WireGuard mesh network. The `wg0` interface will be used for all WireGuard traffic.
-
-### Rocky Linux
-
-We bring the Rocky Linux VMs up to date as well as following:
-
-```sh
-[root@r0 ~] dnf update -y
-[root@r0 ~] reboot
-```
-
-Next, we prepare WireGuard on them. Same as on the FreeBSD hosts, we will only prepare WireGuard without any useful configuration yet:
-
-```sh
-[root@r0 ~] dnf install -y wireguard-tools
-[root@r0 ~] mkdir -p /etc/wireguard
-[root@r0 ~] touch /etc/wireguard/wg0.conf
-[root@r0 ~] systemctl enable wg-quick@wg0.service
-[root@r0 ~] systemctl start wg-quick@wg0.service
-[root@r0 ~] systemctl disable firewalld
-```
-
-We also update the `hosts` file accordingly:
-
-```sh
-[root@r0 ~] cat <<END >>/etc/hosts
-
-192.168.1.130 f0 f0.lan f0.lan.buetow.org
-192.168.1.131 f1 f1.lan f1.lan.buetow.org
-192.168.1.132 f2 f2.lan f2.lan.buetow.org
-
-192.168.2.130 f0.wg0 f0.wg0.wan.buetow.org
-192.168.2.131 f1.wg0 f1.wg0.wan.buetow.org
-192.168.2.132 f2.wg0 f2.wg0.wan.buetow.org
-
-192.168.2.120 r0.wg0 r0.wg0.wan.buetow.org
-192.168.2.121 r1.wg0 r1.wg0.wan.buetow.org
-192.168.2.122 r2.wg0 r2.wg0.wan.buetow.org
-
-192.168.2.110 blowfish.wg0 blowfish.wg0.wan.buetow.org
-192.168.2.111 fishfinger.wg0 fishfinger.wg0.wan.buetow.org
-END
-```
-
-Unfortunately, the SELinux policy on Rocky Linux blocks WireGuard's operation. By making the `wireguard_t` domain permissive using `semanage permissive -a wireguard_t`, SELinux will no longer enforce restrictions for WireGuard, allowing it to work as intended:
-
-```sh
-[root@r0 ~] dnf install -y policycoreutils-python-utils
-[root@r0 ~] semanage permissive -a wireguard_t
-[root@r0 ~] reboot
-```
-
-=> https://github.com/angristan/wireguard-install/discussions/499
-
-### OpenBSD
-
-Other than the FreeBSD and Rocky Linux hosts involved, my OpenBSD hosts (`blowfish` and `fishfinger`, which are running at OpenBSD Amsterdam and Hetzner in the internet) exist already for longer, so I can't provide you with the "from scratch" installation details here. In the following, we will only focus on the additional configuration needed to set up WireGuard:
-
-```sh
-blowfish$ doas pkg_add wireguard-tools
-blowfish$ doas mkdir /etc/wireguard
-blowfish$ doas touch /etc/wireguard/wg0.conf
-blowsish$ cat <<END | doas tee /etc/hostname.wg0
-inet 192.168.2.110 255.255.255.0 NONE
-up
-!/usr/local/bin/wg setconf wg0 /etc/wireguard/wg0.conf
-END
-```
-
-Note, that on `blowfish` we configure `192.168.2.110` here in the `hostname.wg`, on `fishfinger` we configure `192.168.2.111`. Those are the IP addresses of the WireGuard interfaces on those hosts.
-
-And here, we also update the `hosts` file accordingly:
-
-```sh
-blowfish$ cat <<END | doas tee -a /etc/hosts
-
-192.168.2.130 f0.wg0 f0.wg0.wan.buetow.org
-192.168.2.131 f1.wg0 f1.wg0.wan.buetow.org
-192.168.2.132 f2.wg0 f2.wg0.wan.buetow.org
-
-192.168.2.120 r0.wg0 r0.wg0.wan.buetow.org
-192.168.2.121 r1.wg0 r1.wg0.wan.buetow.org
-192.168.2.122 r2.wg0 r2.wg0.wan.buetow.org
-
-192.168.2.110 blowfish.wg0 blowfish.wg0.wan.buetow.org
-192.168.2.111 fishfinger.wg0 fishfinger.wg0.wan.buetow.org
-END
-```
-
-## WireGuard configuration
-
-So far, we only started WireGuard on all participating hosts but without any useful configuration. Means, there aren't any VPN connetion established yet between any of the hosts.
-
-### Example `wg0.conf`
-
-Generally speaking, a `wg0.conf` looks like this (example from `f0` host):
-
-```
-[Interface]
-# f0.wg0.wan.buetow.org
-Address = 192.168.2.130
-PrivateKey = **************************
-ListenPort = 56709
-
-[Peer]
-# f1.lan.buetow.org as f1.wg0.wan.buetow.org
-PublicKey = **************************
-PresharedKey = **************************
-AllowedIPs = 192.168.2.131/32
-Endpoint = 192.168.1.131:56709
-# No KeepAlive configured
-
-[Peer]
-# f2.lan.buetow.org as f2.wg0.wan.buetow.org
-PublicKey = **************************
-PresharedKey = **************************
-AllowedIPs = 192.168.2.132/32
-Endpoint = 192.168.1.132:56709
-# No KeepAlive configured
-
-[Peer]
-# r0.lan.buetow.org as r0.wg0.wan.buetow.org
-PublicKey = **************************
-PresharedKey = **************************
-AllowedIPs = 192.168.2.120/32
-Endpoint = 192.168.1.120:56709
-# No KeepAlive configured
-
-[Peer]
-# r1.lan.buetow.org as r1.wg0.wan.buetow.org
-PublicKey = **************************
-PresharedKey = **************************
-AllowedIPs = 192.168.2.121/32
-Endpoint = 192.168.1.121:56709
-# No KeepAlive configured
-
-[Peer]
-# r2.lan.buetow.org as r2.wg0.wan.buetow.org
-PublicKey = **************************
-PresharedKey = **************************
-AllowedIPs = 192.168.2.122/32
-Endpoint = 192.168.1.122:56709
-# No KeepAlive configured
-
-[Peer]
-# blowfish.buetow.org as blowfish.wg0.wan.buetow.org
-PublicKey = **************************
-PresharedKey = **************************
-AllowedIPs = 192.168.2.110/32
-Endpoint = 23.88.35.144:56709
-PersistentKeepalive = 25
-
-[Peer]
-# fishfinger.buetow.org as fishfinger.wg0.wan.buetow.org
-PublicKey = **************************
-PresharedKey = **************************
-AllowedIPs = 192.168.2.111/32
-Endpoint = 46.23.94.99:56709
-PersistentKeepalive = 25
-```
-
-Whereas there are two main sections. One is `[Interface]`, which configures the current host (here: `f0`):
-
-* Address: Local virtual IP address on the WireGuard interface.
-* PrivateKey: Private key for this node.
-* ListenPort: Port on which this WireGuard interface listens for incoming connections.
-
-And in the following there is one `[Peer]` section for every peer node on the mesh network:
-
-* PublicKey: Public key of the remote peer to authenticate their identity.
-* PresharedKey: Optional symmetric key to enhance security (used in addition to PublicKey).
-* AllowedIPs: IPs or subnets routed through this peer (traffic is allowed to/from these IPs).
-* Endpoint: The public IP:port combination of the remote peer for connection.
-* PersistentKeepalive: Keeps the connection alive by sending periodic packets; used for NAT traversal.
-
-### NAT traversal
-
-As all participating hosts, except for `blowfish` and `fishfinger` (which are on the internet), are behind a NAT gateway (my home router), we need to use `PersistentKeepalive` to establish and maintain the VPN connection from the LAN to the internet because:
-
-> By default, WireGuard tries to be as silent as possible when not being used; it is not a chatty protocol. For the most part, it only transmits data when a peer wishes to send packets. When it's not being asked to send packets, it stops sending packets until it is asked again. In the majority of configurations, this works well. However, when a peer is behind NAT or a firewall, it might wish to be able to receive incoming packets even when it is not sending any packets. Because NAT and stateful firewalls keep track of "connections", if a peer behind NAT or a firewall wishes to receive incoming packets, he must keep the NAT/firewall mapping valid, by periodically sending keepalive packets. This is called persistent keepalives. When this option is enabled, a keepalive packet is sent to the server endpoint once every interval seconds. A sensible interval that works with a wide variety of firewalls is 25 seconds. Setting it to 0 turns the feature off, which is the default, since most users will not need this, and it makes WireGuard slightly more chatty. This feature may be specified by adding the PersistentKeepalive = field to a peer in the configuration file, or setting persistent-keepalive at the command line. If you don't need this feature, don't enable it. But if you're behind NAT or a firewall and you want to receive incoming connections long after network traffic has gone silent, this option will keep the "connection" open in the eyes of NAT.
-
-That's why you see `PersistentKeepAlive = 25` in the `blowfish` and `fishfinger` peer configurations. This means that every 25 seconds, a keep-alive signal is sent over the tunnel to maintain its connection. Additionally, if the tunnel is not yet established, it will be created within 25 seconds at most.
-
-Without this configuration, we might never have a VPN connection open, as the systems in the LAN may not actively attempt to contact `blowfish` and `fishfinger` on their own. In fact, the opposite would likely occur, with the traffic flowing inward instead of outward (this is beyond the scope of this blog post but will be covered in a later post in this series!).
-
-## Mesh network generator
-
-Manually generating `wg0.conf` files for every peer in a mesh network setup is cumbersome because each peer requires its own unique public/private key pair and a preshared key for each VPN connection (resulting in 29 preshared keys for 8 hosts). This complexity scales exponentially with the number of peers as the relationships between all peers must be explicitly defined, including their unique configurations such as `AllowedIPs`, `Endpoint`, and optional settings like `PersistentKeepalive`. Automating the process ensures consistency, reduces human error, saves considerable time, and allows for centralized management of configuration files.
-
-Instead, a script can handle key generation, coordinate relationships, and generate all necessary configuration files simultaneously, making it scalable and far less error-prone.
-
-I have written `wireguardmeshgenerator.rb` (a Ruby script) to do this for our purposes:
-
-=> https://codeberg.org/snonux/wireguardmeshgenerator
-
-I use Fedora Linux as my main driver on my personal Laptop, so the script was developed and tested only on Fedora Linux, but should also work on other Linux and Unix-like systems.
-
-
-### `wireguardmeshgenerator.yaml`
-
-The file `wireguardmeshgenerator.yaml` configures the Mesh Generator script.
-
-```
----
-hosts:
- f0:
- os: FreeBSD
- ssh:
- user: paul
- conf_dir: /usr/local/etc/wireguard
- sudo_cmd: doas
- reload_cmd: service wireguard reload
- lan:
- domain: 'lan.buetow.org'
- ip: '192.168.1.130'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.130'
- f1:
- os: FreeBSD
- ssh:
- user: paul
- conf_dir: /usr/local/etc/wireguard
- sudo_cmd: doas
- reload_cmd: service wireguard reload
- lan:
- domain: 'lan.buetow.org'
- ip: '192.168.1.131'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.131'
- f2:
- os: FreeBSD
- ssh:
- user: paul
- conf_dir: /usr/local/etc/wireguard
- sudo_cmd: doas
- reload_cmd: service wireguard reload
- lan:
- domain: 'lan.buetow.org'
- ip: '192.168.1.132'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.132'
- r0:
- os: Linux
- ssh:
- user: root
- conf_dir: /etc/wireguard
- sudo_cmd:
- reload_cmd: systemctl reload wg-quick@wg0.service
- lan:
- domain: 'lan.buetow.org'
- ip: '192.168.1.120'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.120'
- r1:
- os: Linux
- ssh:
- user: root
- conf_dir: /etc/wireguard
- sudo_cmd:
- reload_cmd: systemctl reload wg-quick@wg0.service
- lan:
- domain: 'lan.buetow.org'
- ip: '192.168.1.121'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.121'
- r2:
- os: Linux
- ssh:
- user: root
- conf_dir: /etc/wireguard
- sudo_cmd:
- reload_cmd: systemctl reload wg-quick@wg0.service
- lan:
- domain: 'lan.buetow.org'
- ip: '192.168.1.122'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.122'
- blowfish:
- os: OpenBSD
- ssh:
- user: rex
- conf_dir: /etc/wireguard
- sudo_cmd: doas
- reload_cmd: sh /etc/netstart wg0
- internet:
- domain: 'buetow.org'
- ip: '23.88.35.144'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.110'
- fishfinger:
- os: OpenBSD
- ssh:
- user: rex
- conf_dir: /etc/wireguard
- sudo_cmd: doas
- reload_cmd: sh /etc/netstart wg0
- internet:
- domain: 'buetow.org'
- ip: '46.23.94.99'
- wg0:
- domain: 'wg0.wan.buetow.org'
- ip: '192.168.2.111'
-```
-
-The file specifies details such as SSH user settings, configuration directories, sudo or reload commands, and IP/domain assignments for both internal LAN-facing interfaces and WireGuard (`wg0`) interfaces. Each host is assigned specific roles, including internal participants and publicly accessible nodes with internet-facing IPs, enabling the creation of a fully connected mesh VPN.
-
-### `wireguardmeshgenerator.rb` overview
-
-The `wireguardmeshgenerator.rb` script consists of the following base classes:
-
-* `KeyTool`: Manages WireGuard key generation and retrieval. It ensures the presence of public/private key pairs and preshared keys (PSKs). If keys are missing, it generates them using the `wg` tool. It provides methods to read the public/private keys and to retrieve or generate a PSK for communication with a peer. The keys are stored in a temp directory on the system from where the generator is run from.
-* `PeerSnippet`: A `Struct` that represents the configuration for a single WireGuard peer in the mesh. It generates the peer's WireGuard configuration, including public key, PSK, allowed IPs, endpoint, and keepalive settings, based on the provided attributes and configuration.
-* `WireguardConfig`: Generates WireGuard configuration files for the specified host in the mesh network. It includes the `[Interface]` section for the host itself and the `[Peer]` sections for all other peers. It can also clean up generated files and directories and create the required directory structure for storing configuration files locally on the server from where the script is run from.
-* `InstallConfig`: Handles uploading, installing, and restarting the WireGuard service on remote hosts using SSH and SCP. It ensures that the configuration file is uploaded to the remote machine, the necessary directories are present and correctly configured, and the WireGuard service is reloaded with the new configuration.
-
-At the end (if you want to see the code for the stuff listed above, go to the Git repo and have a look), we just glue all together in this block:
-
-```ruby
-begin
- options = { hosts: [] }
- OptionParser.new do |opts|
- opts.banner = 'Usage: wireguardmeshgenerator.rb [options]'
- opts.on('--generate', 'Generate Wireguard configs') do
- options[:generate] = true
- end
- opts.on('--install', 'Install Wireguard configs') do
- options[:install] = true
- end
- opts.on('--clean', 'Clean Wireguard configs') do
- options[:clean] = true
- end
- opts.on('--hosts=HOSTS', 'Comma separated hosts to configure') do |hosts|
- options[:hosts] = hosts.split(',')
- end
- end.parse!
-
- conf = YAML.load_file('wireguardmeshgenerator.yaml').freeze
- conf['hosts'].keys.select { options[:hosts].empty? || options[:hosts].include?(_1) }
- .each do |host|
- # Generate Wireguard configuration for the hostreload!
- WireguardConfig.new(host, conf['hosts']).generate! if options[:generate]
- # Install Wireguard configuration for the host.
- InstallConfig.new(host, conf['hosts']).upload!.install!.reload! if options[:install]
- # Clean Wireguard configuration for the host.
- WireguardConfig.new(host, conf['hosts']).clean! if options[:clean]
- end
-rescue StandardError => e
- puts "Error: #{e.message}"
- puts e.backtrace.join("\n")
- exit 2
-end
-```
-
-And we also have a `Rakefile`:
-
-```ruby
-task :generate do
- ruby 'wireguardmeshgenerator.rb', '--generate'
-end
-
-task :clean do
- ruby 'wireguardmeshgenerator.rb', '--clean'
-end
-
-task :install do
- ruby 'wireguardmeshgenerator.rb', '--install'
-end
-
-task default: :generate
-```
-
-
-## Invoking the mesh network generator
-
-### Generating the `wg0.conf` files and keys
-
-To generate everything (the `wg0.conf` of all participating hosts including all keys involved), we simply run:
-
-```sh
-> rake generate
-/usr/bin/ruby wireguardmeshgenerator.rb --generate
-Generating dist/f0/etc/wireguard/wg0.conf
-Generating dist/f1/etc/wireguard/wg0.conf
-Generating dist/f2/etc/wireguard/wg0.conf
-Generating dist/r0/etc/wireguard/wg0.conf
-Generating dist/r1/etc/wireguard/wg0.conf
-Generating dist/r2/etc/wireguard/wg0.conf
-Generating dist/blowfish/etc/wireguard/wg0.conf
-Generating dist/fishfinger/etc/wireguard/wg0.conf
-```
-
-It generated all the `wg0.conf` files listed in the output, plus those keys:
-
-```sh
-> find keys/ -type f
-keys/f0/priv.key
-keys/f0/pub.key
-keys/psk/f0_f1.key
-keys/psk/f0_f2.key
-keys/psk/f0_r0.key
-keys/psk/f0_r1.key
-keys/psk/f0_r2.key
-keys/psk/blowfish_f0.key
-keys/psk/f0_fishfinger.key
-keys/psk/f1_f2.key
-keys/psk/f1_r0.key
-keys/psk/f1_r1.key
-keys/psk/f1_r2.key
-keys/psk/blowfish_f1.key
-keys/psk/f1_fishfinger.key
-keys/psk/f2_r0.key
-keys/psk/f2_r1.key
-keys/psk/f2_r2.key
-keys/psk/blowfish_f2.key
-keys/psk/f2_fishfinger.key
-keys/psk/r0_r1.key
-keys/psk/r0_r2.key
-keys/psk/blowfish_r0.key
-keys/psk/fishfinger_r0.key
-keys/psk/r1_r2.key
-keys/psk/blowfish_r1.key
-keys/psk/fishfinger_r1.key
-keys/psk/blowfish_r2.key
-keys/psk/fishfinger_r2.key
-keys/psk/blowfish_fishfinger.key
-keys/f1/priv.key
-keys/f1/pub.key
-keys/f2/priv.key
-keys/f2/pub.key
-keys/r0/priv.key
-keys/r0/pub.key
-keys/r1/priv.key
-keys/r1/pub.key
-keys/r2/priv.key
-keys/r2/pub.key
-keys/blowfish/priv.key
-keys/blowfish/pub.key
-keys/fishfinger/priv.key
-keys/fishfinger/pub.key
-```
-
-Those keys are embedded in the resulting `wg0.conf`, so later, we only need to install the `wg0.conf` files instead of the keys individually.
-
-### Installing the `wg0.conf` files
-
-Uploading the `wg0.conf` files to the participating hosts and reloading WireGuard on them then is just a matter of executing (this expects, that all participating hosts are up and running):
-
-```sh
-> rake install
-/usr/bin/ruby wireguardmeshgenerator.rb --install
-Uploading dist/f0/etc/wireguard/wg0.conf to f0.lan.buetow.org:.
-Installing Wireguard config on f0
-Uploading cmd.sh to f0.lan.buetow.org:.
-+ [ ! -d /usr/local/etc/wireguard ]
-+ doas chmod 700 /usr/local/etc/wireguard
-+ doas mv -v wg0.conf /usr/local/etc/wireguard
-wg0.conf -> /usr/local/etc/wireguard/wg0.conf
-+ doas chmod 644 /usr/local/etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on f0
-Uploading cmd.sh to f0.lan.buetow.org:.
-+ doas service wireguard reload
-+ rm cmd.sh
-Uploading dist/f1/etc/wireguard/wg0.conf to f1.lan.buetow.org:.
-Installing Wireguard config on f1
-Uploading cmd.sh to f1.lan.buetow.org:.
-+ [ ! -d /usr/local/etc/wireguard ]
-+ doas chmod 700 /usr/local/etc/wireguard
-+ doas mv -v wg0.conf /usr/local/etc/wireguard
-wg0.conf -> /usr/local/etc/wireguard/wg0.conf
-+ doas chmod 644 /usr/local/etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on f1
-Uploading cmd.sh to f1.lan.buetow.org:.
-+ doas service wireguard reload
-+ rm cmd.sh
-Uploading dist/f2/etc/wireguard/wg0.conf to f2.lan.buetow.org:.
-Installing Wireguard config on f2
-Uploading cmd.sh to f2.lan.buetow.org:.
-+ [ ! -d /usr/local/etc/wireguard ]
-+ doas chmod 700 /usr/local/etc/wireguard
-+ doas mv -v wg0.conf /usr/local/etc/wireguard
-wg0.conf -> /usr/local/etc/wireguard/wg0.conf
-+ doas chmod 644 /usr/local/etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on f2
-Uploading cmd.sh to f2.lan.buetow.org:.
-+ doas service wireguard reload
-+ rm cmd.sh
-Uploading dist/r0/etc/wireguard/wg0.conf to r0.lan.buetow.org:.
-Installing Wireguard config on r0
-Uploading cmd.sh to r0.lan.buetow.org:.
-+ '[' '!' -d /etc/wireguard ']'
-+ chmod 700 /etc/wireguard
-+ mv -v wg0.conf /etc/wireguard
-renamed 'wg0.conf' -> '/etc/wireguard/wg0.conf'
-+ chmod 644 /etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on r0
-Uploading cmd.sh to r0.lan.buetow.org:.
-+ systemctl reload wg-quick@wg0.service
-+ rm cmd.sh
-Uploading dist/r1/etc/wireguard/wg0.conf to r1.lan.buetow.org:.
-Installing Wireguard config on r1
-Uploading cmd.sh to r1.lan.buetow.org:.
-+ '[' '!' -d /etc/wireguard ']'
-+ chmod 700 /etc/wireguard
-+ mv -v wg0.conf /etc/wireguard
-renamed 'wg0.conf' -> '/etc/wireguard/wg0.conf'
-+ chmod 644 /etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on r1
-Uploading cmd.sh to r1.lan.buetow.org:.
-+ systemctl reload wg-quick@wg0.service
-+ rm cmd.sh
-Uploading dist/r2/etc/wireguard/wg0.conf to r2.lan.buetow.org:.
-Installing Wireguard config on r2
-Uploading cmd.sh to r2.lan.buetow.org:.
-+ '[' '!' -d /etc/wireguard ']'
-+ chmod 700 /etc/wireguard
-+ mv -v wg0.conf /etc/wireguard
-renamed 'wg0.conf' -> '/etc/wireguard/wg0.conf'
-+ chmod 644 /etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on r2
-Uploading cmd.sh to r2.lan.buetow.org:.
-+ systemctl reload wg-quick@wg0.service
-+ rm cmd.sh
-Uploading dist/blowfish/etc/wireguard/wg0.conf to blowfish.buetow.org:.
-Installing Wireguard config on blowfish
-Uploading cmd.sh to blowfish.buetow.org:.
-+ [ ! -d /etc/wireguard ]
-+ doas chmod 700 /etc/wireguard
-+ doas mv -v wg0.conf /etc/wireguard
-wg0.conf -> /etc/wireguard/wg0.conf
-+ doas chmod 644 /etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on blowfish
-Uploading cmd.sh to blowfish.buetow.org:.
-+ doas sh /etc/netstart wg0
-+ rm cmd.sh
-Uploading dist/fishfinger/etc/wireguard/wg0.conf to fishfinger.buetow.org:.
-Installing Wireguard config on fishfinger
-Uploading cmd.sh to fishfinger.buetow.org:.
-+ [ ! -d /etc/wireguard ]
-+ doas chmod 700 /etc/wireguard
-+ doas mv -v wg0.conf /etc/wireguard
-wg0.conf -> /etc/wireguard/wg0.conf
-+ doas chmod 644 /etc/wireguard/wg0.conf
-+ rm cmd.sh
-Reloading Wireguard on fishfinger
-Uploading cmd.sh to fishfinger.buetow.org:.
-+ doas sh /etc/netstart wg0
-+ rm cmd.sh
-```
-
-## Happy WireGuarding
-
-All is set up now. E.g. on `f0`:
-
-```sh
-paul@f0:~ % doas wg show
-interface: wg0
- public key: Jm6YItMt94++dIeOyVi1I9AhNt2qQcryxCZezoX7X2Y=
- private key: (hidden)
- listening port: 56709
-
-peer: 8PvGZH1NohHpZPVJyjhctBX9xblsNvYBhpg68FsFcns=
- preshared key: (hidden)
- endpoint: 46.23.94.99:56709
- allowed ips: 192.168.2.111/32
- latest handshake: 1 minute, 46 seconds ago
- transfer: 124 B received, 1.75 KiB sent
- persistent keepalive: every 25 seconds
-
-peer: Xow+d3qVXgUMk4pcRSQ6Fe+vhYBa3VDyHX/4jrGoKns=
- preshared key: (hidden)
- endpoint: 23.88.35.144:56709
- allowed ips: 192.168.2.110/32
- latest handshake: 1 minute, 52 seconds ago
- transfer: 124 B received, 1.60 KiB sent
- persistent keepalive: every 25 seconds
-
-peer: s3e93XoY7dPUQgLiVO4d8x/SRCFgEew+/wP7+zwgehI=
- preshared key: (hidden)
- endpoint: 192.168.1.120:56709
- allowed ips: 192.168.2.120/32
-
-peer: 2htXdNcxzpI2FdPDJy4T4VGtm1wpMEQu1AkQHjNY6F8=
- preshared key: (hidden)
- endpoint: 192.168.1.131:56709
- allowed ips: 192.168.2.131/32
-
-peer: 0Y/H20W8YIbF7DA1sMwMacLI8WS9yG+1/QO7m2oyllg=
- preshared key: (hidden)
- endpoint: 192.168.1.122:56709
- allowed ips: 192.168.2.122/32
-
-peer: Hhy9kMPOOjChXV2RA5WeCGs+J0FE3rcNPDw/TLSn7i8=
- preshared key: (hidden)
- endpoint: 192.168.1.121:56709
- allowed ips: 192.168.2.121/32
-
-peer: SlGVsACE1wiaRoGvCR3f7AuHfRS+1jjhS+YwEJ2HvF0=
- preshared key: (hidden)
- endpoint: 192.168.1.132:56709
- allowed ips: 192.168.2.132/32
-```
-
-And all the hosts are pingable as well, e.g.:
-
-```sh
-paul@f0:~ % foreach peer ( f1 f2 r0 r1 r2 blowfish fishfinger )
-foreach? ping -c2 $peer.wg0
-foreach? echo
-foreach? end
-PING f1.wg0 (192.168.2.131): 56 data bytes
-64 bytes from 192.168.2.131: icmp_seq=0 ttl=64 time=0.334 ms
-64 bytes from 192.168.2.131: icmp_seq=1 ttl=64 time=0.260 ms
-
---- f1.wg0 ping statistics ---
-2 packets transmitted, 2 packets received, 0.0% packet loss
-round-trip min/avg/max/stddev = 0.260/0.297/0.334/0.037 ms
-
-PING f2.wg0 (192.168.2.132): 56 data bytes
-64 bytes from 192.168.2.132: icmp_seq=0 ttl=64 time=0.323 ms
-64 bytes from 192.168.2.132: icmp_seq=1 ttl=64 time=0.303 ms
-
---- f2.wg0 ping statistics ---
-2 packets transmitted, 2 packets received, 0.0% packet loss
-round-trip min/avg/max/stddev = 0.303/0.313/0.323/0.010 ms
-
-PING r0.wg0 (192.168.2.120): 56 data bytes
-64 bytes from 192.168.2.120: icmp_seq=0 ttl=64 time=0.716 ms
-64 bytes from 192.168.2.120: icmp_seq=1 ttl=64 time=0.406 ms
-
---- r0.wg0 ping statistics ---
-2 packets transmitted, 2 packets received, 0.0% packet loss
-round-trip min/avg/max/stddev = 0.406/0.561/0.716/0.155 ms
-
-PING r1.wg0 (192.168.2.121): 56 data bytes
-64 bytes from 192.168.2.121: icmp_seq=0 ttl=64 time=0.639 ms
-64 bytes from 192.168.2.121: icmp_seq=1 ttl=64 time=0.629 ms
-
---- r1.wg0 ping statistics ---
-2 packets transmitted, 2 packets received, 0.0% packet loss
-round-trip min/avg/max/stddev = 0.629/0.634/0.639/0.005 ms
-
-PING r2.wg0 (192.168.2.122): 56 data bytes
-64 bytes from 192.168.2.122: icmp_seq=0 ttl=64 time=0.569 ms
-64 bytes from 192.168.2.122: icmp_seq=1 ttl=64 time=0.479 ms
-
---- r2.wg0 ping statistics ---
-2 packets transmitted, 2 packets received, 0.0% packet loss
-round-trip min/avg/max/stddev = 0.479/0.524/0.569/0.045 ms
-
-PING blowfish.wg0 (192.168.2.110): 56 data bytes
-64 bytes from 192.168.2.110: icmp_seq=0 ttl=255 time=35.745 ms
-64 bytes from 192.168.2.110: icmp_seq=1 ttl=255 time=35.481 ms
-
---- blowfish.wg0 ping statistics ---
-2 packets transmitted, 2 packets received, 0.0% packet loss
-round-trip min/avg/max/stddev = 35.481/35.613/35.745/0.132 ms
-
-PING fishfinger.wg0 (192.168.2.111): 56 data bytes
-64 bytes from 192.168.2.111: icmp_seq=0 ttl=255 time=33.992 ms
-64 bytes from 192.168.2.111: icmp_seq=1 ttl=255 time=33.751 ms
-
---- fishfinger.wg0 ping statistics ---
-2 packets transmitted, 2 packets received, 0.0% packet loss
-round-trip min/avg/max/stddev = 33.751/33.872/33.992/0.120 ms
-```
-
-Note, that the loop above is a `tcsh` loop, the default shell used in FreeBSD. Of course, all other peers can ping their peers as well!
-
-After the first ping, VPN connections now also show handshakes and amount of data transferred through them:
-
-```sh
-paul@f0:~ % doas wg show
-interface: wg0
- public key: Jm6YItMt94++dIeOyVi1I9AhNt2qQcryxCZezoX7X2Y=
- private key: (hidden)
- listening port: 56709
-
-peer: 0Y/H20W8YIbF7DA1sMwMacLI8WS9yG+1/QO7m2oyllg=
- preshared key: (hidden)
- endpoint: 192.168.1.122:56709
- allowed ips: 192.168.2.122/32
- latest handshake: 10 seconds ago
- transfer: 440 B received, 532 B sent
-
-peer: Hhy9kMPOOjChXV2RA5WeCGs+J0FE3rcNPDw/TLSn7i8=
- preshared key: (hidden)
- endpoint: 192.168.1.121:56709
- allowed ips: 192.168.2.121/32
- latest handshake: 12 seconds ago
- transfer: 440 B received, 564 B sent
-
-peer: s3e93XoY7dPUQgLiVO4d8x/SRCFgEew+/wP7+zwgehI=
- preshared key: (hidden)
- endpoint: 192.168.1.120:56709
- allowed ips: 192.168.2.120/32
- latest handshake: 14 seconds ago
- transfer: 440 B received, 564 B sent
-
-peer: SlGVsACE1wiaRoGvCR3f7AuHfRS+1jjhS+YwEJ2HvF0=
- preshared key: (hidden)
- endpoint: 192.168.1.132:56709
- allowed ips: 192.168.2.132/32
- latest handshake: 17 seconds ago
- transfer: 472 B received, 564 B sent
-
-peer: Xow+d3qVXgUMk4pcRSQ6Fe+vhYBa3VDyHX/4jrGoKns=
- preshared key: (hidden)
- endpoint: 23.88.35.144:56709
- allowed ips: 192.168.2.110/32
- latest handshake: 55 seconds ago
- transfer: 472 B received, 596 B sent
- persistent keepalive: every 25 seconds
-
-peer: 8PvGZH1NohHpZPVJyjhctBX9xblsNvYBhpg68FsFcns=
- preshared key: (hidden)
- endpoint: 46.23.94.99:56709
- allowed ips: 192.168.2.111/32
- latest handshake: 55 seconds ago
- transfer: 472 B received, 596 B sent
- persistent keepalive: every 25 seconds
-
-peer: 2htXdNcxzpI2FdPDJy4T4VGtm1wpMEQu1AkQHjNY6F8=
- preshared key: (hidden)
- endpoint: 192.168.1.131:56709
- allowed ips: 192.168.2.131/32
-```
-
-Other *BSD-related posts:
-
-=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs
-=> ./2025-02-01-f3s-kubernetes-with-freebsd-part-3.gmi 2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts
-=> ./2024-12-03-f3s-kubernetes-with-freebsd-part-2.gmi 2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation
-=> ./2024-11-17-f3s-kubernetes-with-freebsd-part-1.gmi 2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage
-=> ./2024-04-01-KISS-high-availability-with-OpenBSD.gmi 2024-04-01 KISS high-availability with OpenBSD
-=> ./2024-01-13-one-reason-why-i-love-openbsd.gmi 2024-01-13 One reason why I love OpenBSD
-=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD
-=> ./2022-07-30-lets-encrypt-with-openbsd-and-rex.gmi 2022-07-30 Let's Encrypt with OpenBSD and Rex
-=> ./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.gmi 2016-04-09 Jails and ZFS with Puppet on FreeBSD
-
-E-Mail your comments to `paul@nospam.buetow.org`
-
-=> ../ Back to the main site
diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml
index 1106794d..c84dd44a 100644
--- a/gemfeed/atom.xml
+++ b/gemfeed/atom.xml
@@ -1,12 +1,1036 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
- <updated>2025-05-05T22:21:05+03:00</updated>
+ <updated>2025-05-11T11:38:56+03:00</updated>
<title>foo.zone feed</title>
<subtitle>To be in the .zone!</subtitle>
<link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" />
<link href="gemini://foo.zone/" />
<id>gemini://foo.zone/</id>
<entry>
+ <title>f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</title>
+ <link href="gemini://foo.zone/gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi" />
+ <id>gemini://foo.zone/gemfeed/2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi</id>
+ <updated>2025-05-11T11:35:57+03:00</updated>
+ <author>
+ <name>Paul Buetow aka snonux</name>
+ <email>paul@dev.buetow.org</email>
+ </author>
+ <summary>This is the fifth blog post about my f3s series for my self-hosting demands in my home lab. f3s? The 'f' stands for FreeBSD, and the '3s' stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.</summary>
+ <content type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ <h1 style='display: inline' id='f3s-kubernetes-with-freebsd---part-5-wireguard-mesh-network'>f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</h1><br />
+<br />
+<span class='quote'>Published at 2025-05-11T11:35:57+03:00</span><br />
+<br />
+<span>This is the fifth blog post about my f3s series for my self-hosting demands in my home lab. f3s? The "f" stands for FreeBSD, and the "3s" stands for k3s, the Kubernetes distribution I will use on FreeBSD-based physical machines.</span><br />
+<br />
+<span>I will post a new entry every month or so (there are too many other side projects for more frequent updates — I bet you can understand).</span><br />
+<br />
+<span>These are all the posts so far:</span><br />
+<br />
+<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br />
+<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
+<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
+<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network (You are currently reading this)</a><br />
+<br />
+<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br />
+<br />
+<span class='quote'>ChatGPT generated logo.</span><br />
+<br />
+<span>Let&#39;s begin...</span><br />
+<br />
+<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br />
+<br />
+<ul>
+<li><a href='#f3s-kubernetes-with-freebsd---part-5-wireguard-mesh-network'>f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a></li>
+<li>⇢ <a href='#introduction'>Introduction</a></li>
+<li>⇢ ⇢ <a href='#expected-traffic-flow'>Expected traffic flow</a></li>
+<li>⇢ <a href='#deciding-on-wireguard'>Deciding on WireGuard</a></li>
+<li>⇢ <a href='#base-configuration'>Base configuration</a></li>
+<li>⇢ ⇢ <a href='#freebsd'>FreeBSD</a></li>
+<li>⇢ ⇢ <a href='#rocky-linux'>Rocky Linux</a></li>
+<li>⇢ ⇢ <a href='#openbsd'>OpenBSD</a></li>
+<li>⇢ <a href='#wireguard-configuration'>WireGuard configuration</a></li>
+<li>⇢ ⇢ <a href='#example-wg0conf'>Example <span class='inlinecode'>wg0.conf</span></a></li>
+<li>⇢ ⇢ <a href='#nat-traversal-and-keepalive'>NAT traversal and keepalive</a></li>
+<li>⇢ ⇢ <a href='#preshared-key'>Preshared key</a></li>
+<li>⇢ <a href='#mesh-network-generator'>Mesh network generator</a></li>
+<li>⇢ ⇢ <a href='#wireguardmeshgeneratoryaml'><span class='inlinecode'>wireguardmeshgenerator.yaml</span></a></li>
+<li>⇢ ⇢ <a href='#wireguardmeshgeneratorrb-overview'><span class='inlinecode'>wireguardmeshgenerator.rb</span> overview</a></li>
+<li>⇢ <a href='#invoking-the-mesh-network-generator'>Invoking the mesh network generator</a></li>
+<li>⇢ ⇢ <a href='#generating-the-wg0conf-files-and-keys'>Generating the <span class='inlinecode'>wg0.conf</span> files and keys</a></li>
+<li>⇢ ⇢ <a href='#installing-the-wg0conf-files'>Installing the <span class='inlinecode'>wg0.conf</span> files</a></li>
+<li>⇢ ⇢ <a href='#re-generating-mesh-and-installing-the-wg0conf-files-again'>Re-generating mesh and installing the <span class='inlinecode'>wg0.conf</span> files again</a></li>
+<li>⇢ <a href='#happy-wireguard-ing'>Happy WireGuard-ing</a></li>
+<li>⇢ <a href='#conclusion'>Conclusion</a></li>
+</ul><br />
+<h2 style='display: inline' id='introduction'>Introduction</h2><br />
+<br />
+<span>By default, traffic within my home LAN, including traffic inside a k3s cluster, is not encrypted. While it resides in the "secure" home LAN, adopting a zero-trust policy means encryption is still preferable to ensure confidentiality and security. So we decide to secure all the traffic of all f3s participating hosts by building a mesh network of all participating hosts:</span><br />
+<br />
+<a href='./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg'><img alt='Full mesh network' title='Full mesh network' src='./f3s-kubernetes-with-freebsd-part-5/wireguard-full-mesh.svg' /></a><br />
+<br />
+<span>Whereas <span class='inlinecode'>f0</span>, <span class='inlinecode'>f1</span>, and <span class='inlinecode'>f2</span> are the FreeBSD base hosts, <span class='inlinecode'>r0</span>, <span class='inlinecode'>r1</span>, and <span class='inlinecode'>r2</span> are the Rocky Linux Bhyve VMs, and <span class='inlinecode'>blowfish</span> and <span class='inlinecode'>fishfinger</span> are two OpenBSD systems running on the internet (as mentioned in the first blog of this series—these systems are already built; in fact, this very blog is served by those OpenBSD systems).</span><br />
+<br />
+<span>As we can see from the graph, it is a true full-mesh network, where every host has a VPN tunnel to every other host. The benefit is that we do not need to route traffic through intermediate hosts (significantly simplifying the routing configuration). However, the downside is that there is some overhead in configuring and managing all the tunnels.</span><br />
+<br />
+<span>For simplicity, we also establish VPN tunnels between <span class='inlinecode'>f0 &lt;-&gt; r0</span>, <span class='inlinecode'>f1 &lt;-&gt; r1</span>, and <span class='inlinecode'>f2 &lt;-&gt; r2</span>. Technically, this wouldn&#39;t be strictly required since the VMs <span class='inlinecode'>rN</span> are running on the hosts <span class='inlinecode'>fN</span>, and no network traffic is leaving the box. However, it simplifies the configuration as we don&#39;t have to account for exceptions, and we are going to automate the mesh network configuration anyway (read on).</span><br />
+<br />
+<h3 style='display: inline' id='expected-traffic-flow'>Expected traffic flow</h3><br />
+<br />
+<span>The traffic is expected to flow between the host groups through the mesh network as follows: </span><br />
+<br />
+<ul>
+<li><span class='inlinecode'>fN &lt;-&gt; rN</span>: The traffic between the FreeBSD hosts and the Rocky Linux VMs will be routed through the VPN tunnels for persistent storage. In a later post in this series, we will set up an NFS server on the <span class='inlinecode'>fN</span> hosts. </li>
+<li><span class='inlinecode'>fN &lt;-&gt; blowfish,fishfinger</span>: The traffic between the FreeBSD hosts and the OpenBSD host <span class='inlinecode'>blowfish,fishfinger</span> will be routed through the VPN tunnels for management. We may want to log in via the internet to set it up remotely. The VPN tunnel will also be used for monitoring purposes.</li>
+<li><span class='inlinecode'>rN &lt;-&gt; blowfish,fishfinger</span>: The traffic between the Rocky Linux VMs and the OpenBSD host <span class='inlinecode'>blowfish,fishfinger</span> will be routed through the VPN tunnels for usage traffic. Since <span class='inlinecode'>k3s</span> will be running on the <span class='inlinecode'>rN</span> hosts, the OpenBSD servers will route the traffic through <span class='inlinecode'>relayd</span> to the services running in Kubernetes.</li>
+<li><span class='inlinecode'>fN &lt;-&gt; fM</span>: The traffic between the FreeBSD hosts may be later used for data replication for the NFS storage.</li>
+<li><span class='inlinecode'>rN &lt;-&gt; rM</span>: The traffic between the Rocky Linux VMs will later be used by the <span class='inlinecode'>k3s</span> cluster itself, as every <span class='inlinecode'>rN</span> will be a Kubernetes worker node.</li>
+<li><span class='inlinecode'>blowfish &lt;-&gt; fishfinger</span>: The traffic between the OpenBSD hosts isn&#39;t strictly required for this setup, but I set it up anyway for future use cases.</li>
+</ul><br />
+<span>We won&#39;t cover all the details in this blog post, as we only focus on setting up the Mesh network in this blog post. Subsequent posts in this series will cover the other details.</span><br />
+<br />
+<h2 style='display: inline' id='deciding-on-wireguard'>Deciding on WireGuard</h2><br />
+<br />
+<span>I have decided to use WireGuard as the VPN technology for this purpose.</span><br />
+<br />
+<span>WireGuard is a lightweight, modern, and secure VPN protocol designed for simplicity, speed, and strong cryptography. It is an excellent choice due to its minimal codebase, ease of configuration, high performance, and robust security, utilizing state-of-the-art encryption standards. WireGuard is supported on various operating systems, and its implementations are compatible with each other. Therefore, establishing WireGuard VPN tunnels between FreeBSD, Linux, and OpenBSD is seamless. This cross-platform availability makes it suitable for setups like the one described in this blog series.</span><br />
+<br />
+<span>We could have used Tailscale for an easy to set up and manage the WireGuard network, but the benefits of creating our own mesh network are:</span><br />
+<br />
+<ul>
+<li>Learning about WireGuard configuration details</li>
+<li>Have full control over the setup</li>
+<li>Don&#39;t rely on an external provider like Tailscale (even if some of the components are open-source)</li>
+<li>Have even more fun along the way</li>
+<li>WireGuard is easy to configure on my target operating systems and, therefore, easier to maintain in the long run.</li>
+<li>There are no official Tailscale packages available for OpenBSD and FreeBSD. However, getting Tailscale running on these systems is still possible, though some tinkering would be required. Instead, we use that tinkering time to set up WireGuard tunnels ourselves.</li>
+</ul><br />
+<a class='textlink' href='https://en.wikipedia.org/wiki/WireGuard'>https://en.wikipedia.org/wiki/WireGuard</a><br />
+<a class='textlink' href='https://www.wireguard.com/'>https://www.wireguard.com/</a><br />
+<a class='textlink' href='https://tailscale.com/'>https://tailscale.com/</a><br />
+<br />
+<a href='./f3s-kubernetes-with-freebsd-part-5/wireguard.svg'><img alt='WireGuard Logo' title='WireGuard Logo' src='./f3s-kubernetes-with-freebsd-part-5/wireguard.svg' /></a><br />
+<br />
+<h2 style='display: inline' id='base-configuration'>Base configuration</h2><br />
+<br />
+<span>In the following, we prepare the base configuration for the WireGuard mesh network. We will use a similar configuration on all participating hosts, with the exception of the host IP addresses and the private keys.</span><br />
+<br />
+<h3 style='display: inline' id='freebsd'>FreeBSD</h3><br />
+<br />
+<span>On the FreeBSD hosts <span class='inlinecode'>f0</span>, <span class='inlinecode'>f1</span> and <span class='inlinecode'>f2</span>, similar as last time, first, we bring the system up to date:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>paul@f0:~ % doas freebsd-update fetch
+paul@f0:~ % doas freebsd-update install
+paul@f0:~ % doas freebsd-update -r <font color="#000000">14.2</font>-RELEASE upgrade
+paul@f0:~ % doas freebsd-update install
+paul@f0:~ % doas shutdown -r now
+..
+..
+paul@f0:~ % doas pkg update
+paul@f0:~ % doas pkg upgrade
+paul@f0:~ % reboot
+</pre>
+<br />
+<span>Next, we install <span class='inlinecode'>wireguard-tools</span> and configure the WireGuard service:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>paul@f0:~ % doas pkg install wireguard-tools
+paul@f0:~ % doas sysrc wireguard_interfaces=wg0
+wireguard_interfaces: -&gt; wg0
+paul@f0:~ % doas sysrc wireguard_enable=YES
+wireguard_enable: -&gt; YES
+paul@f0:~ % doas mkdir -p /usr/local/etc/wireguard
+paul@f0:~ % doas touch /usr/local/etc/wireguard/wg<font color="#000000">0</font>.conf
+paul@f0:~ % doas service wireguard start
+paul@f0:~ % doas wg show
+interface: wg0
+ public key: L+V9o0fNYkMVKNqsX7spBzD/9oSvxM/C7ZCZX1jLO3Q=
+ private key: (hidden)
+ listening port: <font color="#000000">20246</font>
+</pre>
+<br />
+<span>We now have the WireGuard up and running, but it is not yet in any functional configuration. We will come back to that later.</span><br />
+<br />
+<span>Next, we add all the participating WireGuard IPs to the <span class='inlinecode'>hosts</span> file. This is only convenience, so we don&#39;t have to manage an external DNS server for this:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>paul@f0:~ % cat &lt;&lt;END | doas tee -a /etc/hosts
+
+<font color="#000000">192.168</font>.<font color="#000000">1.120</font> r0 r0.lan r0.lan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">1.121</font> r1 r1.lan r1.lan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">1.122</font> r2 r2.lan r2.lan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.130</font> f0.wg0 f0.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.131</font> f1.wg0 f1.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.132</font> f2.wg0 f2.wg0.wan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.120</font> r0.wg0 r0.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.121</font> r1.wg0 r1.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.122</font> r2.wg0 r2.wg0.wan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.110</font> blowfish.wg0 blowfish.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.111</font> fishfinger.wg0 fishfinger.wg0.wan.buetow.org
+END
+</pre>
+<br />
+<span>As you can see, <span class='inlinecode'>192.168.1.0/24</span> is the network used in my LAN (with the <span class='inlinecode'>fN</span> and <span class='inlinecode'>rN</span> hosts) and <span class='inlinecode'>192.168.2.0/24</span> is the network used for the WireGuard mesh network. The <span class='inlinecode'>wg0</span> interface will be used for all WireGuard traffic.</span><br />
+<br />
+<h3 style='display: inline' id='rocky-linux'>Rocky Linux</h3><br />
+<br />
+<span>We bring the Rocky Linux VMs up to date as well with the following:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>[root@r0 ~] dnf update -y
+[root@r0 ~] reboot
+</pre>
+<br />
+<span>Next, we prepare WireGuard on them. Same as on the FreeBSD hosts, we will only prepare WireGuard without any useful configuration yet:</span><br />
+<span> </span><br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>[root@r0 ~] dnf install -y wireguard-tools
+[root@r0 ~] mkdir -p /etc/wireguard
+[root@r0 ~] touch /etc/wireguard/wg<font color="#000000">0</font>.conf
+[root@r0 ~] systemctl <b><u><font color="#000000">enable</font></u></b> wg-quick@wg0.service
+[root@r0 ~] systemctl start wg-quick@wg0.service
+[root@r0 ~] systemctl disable firewalld
+</pre>
+<br />
+<span>We also update the <span class='inlinecode'>hosts</span> file accordingly:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>[root@r0 ~] cat &lt;&lt;END &gt;&gt;/etc/hosts
+
+<font color="#000000">192.168</font>.<font color="#000000">1.130</font> f0 f0.lan f0.lan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">1.131</font> f1 f1.lan f1.lan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">1.132</font> f2 f2.lan f2.lan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.130</font> f0.wg0 f0.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.131</font> f1.wg0 f1.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.132</font> f2.wg0 f2.wg0.wan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.120</font> r0.wg0 r0.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.121</font> r1.wg0 r1.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.122</font> r2.wg0 r2.wg0.wan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.110</font> blowfish.wg0 blowfish.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.111</font> fishfinger.wg0 fishfinger.wg0.wan.buetow.org
+END
+</pre>
+<br />
+<span>Unfortunately, the SELinux policy on Rocky Linux blocks WireGuard&#39;s operation. By making the <span class='inlinecode'>wireguard_t</span> domain permissive using <span class='inlinecode'>semanage permissive -a wireguard_t</span>, SELinux will no longer enforce restrictions for WireGuard, allowing it to work as intended:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>[root@r0 ~] dnf install -y policycoreutils-python-utils
+[root@r0 ~] semanage permissive -a wireguard_t
+[root@r0 ~] reboot
+</pre>
+<br />
+<a class='textlink' href='https://github.com/angristan/wireguard-install/discussions/499'>https://github.com/angristan/wireguard-install/discussions/499</a><br />
+<br />
+<h3 style='display: inline' id='openbsd'>OpenBSD</h3><br />
+<br />
+<span>Other than the FreeBSD and Rocky Linux hosts involved, my OpenBSD hosts (<span class='inlinecode'>blowfish</span> and <span class='inlinecode'>fishfinger</span>, which are running at OpenBSD Amsterdam and Hetzner on the internet) have been running already for longer, so I can&#39;t provide you with the "from scratch" installation details here. In the following, we will only focus on the additional configuration needed to set up WireGuard:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>blowfish$ doas pkg_add wireguard-tools
+blowfish$ doas mkdir /etc/wireguard
+blowfish$ doas touch /etc/wireguard/wg<font color="#000000">0</font>.conf
+blowsish$ cat &lt;&lt;END | doas tee /etc/hostname.wg0
+inet <font color="#000000">192.168</font>.<font color="#000000">2.110</font> <font color="#000000">255.255</font>.<font color="#000000">255.0</font> NONE
+up
+!/usr/local/bin/wg setconf wg0 /etc/wireguard/wg<font color="#000000">0</font>.conf
+END
+</pre>
+<br />
+<span>Note that on <span class='inlinecode'>blowfish</span>, we configure <span class='inlinecode'>192.168.2.110</span> here in the <span class='inlinecode'>hostname.wg</span>, and on <span class='inlinecode'>fishfinger</span>, we configure <span class='inlinecode'>192.168.2.111</span>. Those are the IP addresses of the WireGuard interfaces on those hosts.</span><br />
+<br />
+<span>And here, we also update the <span class='inlinecode'>hosts</span> file accordingly:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>blowfish$ cat &lt;&lt;END | doas tee -a /etc/hosts
+
+<font color="#000000">192.168</font>.<font color="#000000">2.130</font> f0.wg0 f0.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.131</font> f1.wg0 f1.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.132</font> f2.wg0 f2.wg0.wan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.120</font> r0.wg0 r0.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.121</font> r1.wg0 r1.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.122</font> r2.wg0 r2.wg0.wan.buetow.org
+
+<font color="#000000">192.168</font>.<font color="#000000">2.110</font> blowfish.wg0 blowfish.wg0.wan.buetow.org
+<font color="#000000">192.168</font>.<font color="#000000">2.111</font> fishfinger.wg0 fishfinger.wg0.wan.buetow.org
+END
+</pre>
+<br />
+<h2 style='display: inline' id='wireguard-configuration'>WireGuard configuration</h2><br />
+<br />
+<span>So far, we have only started WireGuard on all participating hosts without any useful configuration. This means that no VPN tunnel has been established yet between any of the hosts.</span><br />
+<br />
+<h3 style='display: inline' id='example-wg0conf'>Example <span class='inlinecode'>wg0.conf</span></h3><br />
+<br />
+<span>Generally speaking, a <span class='inlinecode'>wg0.conf</span> looks like this (example from <span class='inlinecode'>f0</span> host):</span><br />
+<br />
+<pre>
+[Interface]
+# f0.wg0.wan.buetow.org
+Address = 192.168.2.130
+PrivateKey = **************************
+ListenPort = 56709
+
+[Peer]
+# f1.lan.buetow.org as f1.wg0.wan.buetow.org
+PublicKey = **************************
+PresharedKey = **************************
+AllowedIPs = 192.168.2.131/32
+Endpoint = 192.168.1.131:56709
+# No KeepAlive configured
+
+[Peer]
+# f2.lan.buetow.org as f2.wg0.wan.buetow.org
+PublicKey = **************************
+PresharedKey = **************************
+AllowedIPs = 192.168.2.132/32
+Endpoint = 192.168.1.132:56709
+# No KeepAlive configured
+
+[Peer]
+# r0.lan.buetow.org as r0.wg0.wan.buetow.org
+PublicKey = **************************
+PresharedKey = **************************
+AllowedIPs = 192.168.2.120/32
+Endpoint = 192.168.1.120:56709
+# No KeepAlive configured
+
+[Peer]
+# r1.lan.buetow.org as r1.wg0.wan.buetow.org
+PublicKey = **************************
+PresharedKey = **************************
+AllowedIPs = 192.168.2.121/32
+Endpoint = 192.168.1.121:56709
+# No KeepAlive configured
+
+[Peer]
+# r2.lan.buetow.org as r2.wg0.wan.buetow.org
+PublicKey = **************************
+PresharedKey = **************************
+AllowedIPs = 192.168.2.122/32
+Endpoint = 192.168.1.122:56709
+# No KeepAlive configured
+
+[Peer]
+# blowfish.buetow.org as blowfish.wg0.wan.buetow.org
+PublicKey = **************************
+PresharedKey = **************************
+AllowedIPs = 192.168.2.110/32
+Endpoint = 23.88.35.144:56709
+PersistentKeepalive = 25
+
+[Peer]
+# fishfinger.buetow.org as fishfinger.wg0.wan.buetow.org
+PublicKey = **************************
+PresharedKey = **************************
+AllowedIPs = 192.168.2.111/32
+Endpoint = 46.23.94.99:56709
+PersistentKeepalive = 25
+</pre>
+<br />
+<span>Whereas there are two main sections. One is <span class='inlinecode'>[Interface]</span>, which configures the current host (here: <span class='inlinecode'>f0</span>):</span><br />
+<br />
+<ul>
+<li><span class='inlinecode'>Address</span>: Local virtual IP address on the WireGuard interface.</li>
+<li><span class='inlinecode'>PrivateKey</span>: Private key for this node.</li>
+<li><span class='inlinecode'>ListenPort</span>: Port on which this WireGuard interface listens for incoming connections.</li>
+</ul><br />
+<span>And in the following, there is one <span class='inlinecode'>[Peer]</span> section for every peer node on the mesh network:</span><br />
+<br />
+<ul>
+<li><span class='inlinecode'>PublicKey</span>: The public key of the remote peer is used to authenticate their identity.</li>
+<li><span class='inlinecode'>PresharedKey</span>: An optional symmetric key is used to enhance security (used in addition to PublicKey).</li>
+<li><span class='inlinecode'>AllowedIPs</span>: IPs or subnets routed through this peer (traffic is allowed to/from these IPs).</li>
+<li><span class='inlinecode'>Endpoint</span>: The public IP:port combination of the remote peer for connection.</li>
+<li><span class='inlinecode'>PersistentKeepalive</span>: Keeps the tunnel alive by sending periodic packets; used for NAT traversal.</li>
+</ul><br />
+<h3 style='display: inline' id='nat-traversal-and-keepalive'>NAT traversal and keepalive</h3><br />
+<br />
+<span>As all participating hosts, except for <span class='inlinecode'>blowfish</span> and <span class='inlinecode'>fishfinger</span> (which are on the internet), are behind a NAT gateway (my home router), we need to use <span class='inlinecode'>PersistentKeepalive</span> to establish and maintain the VPN tunnel from the LAN to the internet because:</span><br />
+<br />
+<span class='quote'>By default, WireGuard tries to be as silent as possible when not being used; it is not a chatty protocol. For the most part, it only transmits data when a peer wishes to send packets. When it&#39;s not being asked to send packets, it stops sending packets until it is asked again. In the majority of configurations, this works well. However, when a peer is behind NAT or a firewall, it might wish to be able to receive incoming packets even when it is not sending any packets. Because NAT and stateful firewalls keep track of "connections", if a peer behind NAT or a firewall wishes to receive incoming packets, he must keep the NAT/firewall mapping valid, by periodically sending keepalive packets. This is called persistent keepalives. When this option is enabled, a keepalive packet is sent to the server endpoint once every interval seconds. A sensible interval that works with a wide variety of firewalls is 25 seconds. Setting it to 0 turns the feature off, which is the default, since most users will not need this, and it makes WireGuard slightly more chatty. This feature may be specified by adding the PersistentKeepalive = field to a peer in the configuration file, or setting persistent-keepalive at the command line. If you don&#39;t need this feature, don&#39;t enable it. But if you&#39;re behind NAT or a firewall and you want to receive incoming connections long after network traffic has gone silent, this option will keep the "connection" open in the eyes of NAT.</span><br />
+<br />
+<span>That&#39;s why you see <span class='inlinecode'>PersistentKeepAlive = 25</span> in the <span class='inlinecode'>blowfish</span> and <span class='inlinecode'>fishfinger</span> peer configurations. This means that every 25 seconds, a keep-alive signal is sent over the tunnel to maintain its connection. If the tunnel is not yet established, it will be created within 25 seconds latest.</span><br />
+<br />
+<span>Without this, we might never have a VPN tunnel open, as the systems in the LAN may not actively attempt to contact <span class='inlinecode'>blowfish</span> and <span class='inlinecode'>fishfinger</span> on their own. In fact, the opposite would likely occur, with the traffic flowing inward instead of outward (this is beyond the scope of this blog post but will be covered in a later post in this series!).</span><br />
+<br />
+<h3 style='display: inline' id='preshared-key'>Preshared key</h3><br />
+<br />
+<span>In a WireGuard configuration, the PSK (preshared key) is an optional additional layer of symmetric encryption used alongside the standard public key cryptography. It is a shared secret known to both peers that enhances security by requiring an attacker to compromise both the private keys and the PSK to decrypt communication. While optional, using a PSK is better as it strengthens the cryptographic security, mitigating risks of potential vulnerabilities in the key exchange process.</span><br />
+<br />
+<span>So, because it&#39;s better, we are using it.</span><br />
+<br />
+<h2 style='display: inline' id='mesh-network-generator'>Mesh network generator</h2><br />
+<br />
+<span>Manually generating <span class='inlinecode'>wg0.conf</span> files for every peer in a mesh network setup is cumbersome because each peer requires its own unique public/private key pair and a preshared key for each VPN tunnel (resulting in 29 preshared keys for 8 hosts). This complexity scales exponentially with the number of peers as the relationships between all peers must be explicitly defined, including their unique configurations such as <span class='inlinecode'>AllowedIPs</span> and <span class='inlinecode'>Endpoint</span> and optional settings like <span class='inlinecode'>PersistentKeepalive</span>. Automating the process ensures consistency, reduces human error, saves considerable time, and allows for centralized management of configuration files.</span><br />
+<br />
+<span>Instead, a script can handle key generation, coordinate relationships, and generate all necessary configuration files simultaneously, making it scalable and far less error-prone.</span><br />
+<br />
+<span>I have written a Ruby script <span class='inlinecode'>wireguardmeshgenerator.rb</span> to do this for our purposes:</span><br />
+<br />
+<a class='textlink' href='https://codeberg.org/snonux/wireguardmeshgenerator'>https://codeberg.org/snonux/wireguardmeshgenerator</a><br />
+<br />
+<span>I use Fedora Linux as my main driver on my personal Laptop, so the script was developed and tested only on Fedora Linux. However, it should also work on other Linux and Unix-like systems.</span><br />
+<br />
+<span>To set up the mesh generator on Fedora Linux, we run the following:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>&gt; git clone https://codeberg.org/snonux/wireguardmeshgenerator
+&gt; cd ./wireguardmeshgenerator
+&gt; bundle install
+&gt; sudo dnf install -y wireguard-tools
+</pre>
+<br />
+<span>This assumes that Ruby and the <span class='inlinecode'>bundler</span> gem are already installed. If not, refer to the docs of your distribution.</span><br />
+<br />
+<h3 style='display: inline' id='wireguardmeshgeneratoryaml'><span class='inlinecode'>wireguardmeshgenerator.yaml</span></h3><br />
+<br />
+<span>The file <span class='inlinecode'>wireguardmeshgenerator.yaml</span> configures the mesh generator script.</span><br />
+<br />
+<pre>
+---
+hosts:
+ f0:
+ os: FreeBSD
+ ssh:
+ user: paul
+ conf_dir: /usr/local/etc/wireguard
+ sudo_cmd: doas
+ reload_cmd: service wireguard reload
+ lan:
+ domain: &#39;lan.buetow.org&#39;
+ ip: &#39;192.168.1.130&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.130&#39;
+ f1:
+ os: FreeBSD
+ ssh:
+ user: paul
+ conf_dir: /usr/local/etc/wireguard
+ sudo_cmd: doas
+ reload_cmd: service wireguard reload
+ lan:
+ domain: &#39;lan.buetow.org&#39;
+ ip: &#39;192.168.1.131&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.131&#39;
+ f2:
+ os: FreeBSD
+ ssh:
+ user: paul
+ conf_dir: /usr/local/etc/wireguard
+ sudo_cmd: doas
+ reload_cmd: service wireguard reload
+ lan:
+ domain: &#39;lan.buetow.org&#39;
+ ip: &#39;192.168.1.132&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.132&#39;
+ r0:
+ os: Linux
+ ssh:
+ user: root
+ conf_dir: /etc/wireguard
+ sudo_cmd:
+ reload_cmd: systemctl reload wg-quick@wg0.service
+ lan:
+ domain: &#39;lan.buetow.org&#39;
+ ip: &#39;192.168.1.120&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.120&#39;
+ r1:
+ os: Linux
+ ssh:
+ user: root
+ conf_dir: /etc/wireguard
+ sudo_cmd:
+ reload_cmd: systemctl reload wg-quick@wg0.service
+ lan:
+ domain: &#39;lan.buetow.org&#39;
+ ip: &#39;192.168.1.121&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.121&#39;
+ r2:
+ os: Linux
+ ssh:
+ user: root
+ conf_dir: /etc/wireguard
+ sudo_cmd:
+ reload_cmd: systemctl reload wg-quick@wg0.service
+ lan:
+ domain: &#39;lan.buetow.org&#39;
+ ip: &#39;192.168.1.122&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.122&#39;
+ blowfish:
+ os: OpenBSD
+ ssh:
+ user: rex
+ conf_dir: /etc/wireguard
+ sudo_cmd: doas
+ reload_cmd: sh /etc/netstart wg0
+ internet:
+ domain: &#39;buetow.org&#39;
+ ip: &#39;23.88.35.144&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.110&#39;
+ fishfinger:
+ os: OpenBSD
+ ssh:
+ user: rex
+ conf_dir: /etc/wireguard
+ sudo_cmd: doas
+ reload_cmd: sh /etc/netstart wg0
+ internet:
+ domain: &#39;buetow.org&#39;
+ ip: &#39;46.23.94.99&#39;
+ wg0:
+ domain: &#39;wg0.wan.buetow.org&#39;
+ ip: &#39;192.168.2.111&#39;
+</pre>
+<br />
+<span>The file specifies details such as SSH user settings, configuration directories, sudo or reload commands, and IP/domain assignments for both internal LAN-facing interfaces and WireGuard (<span class='inlinecode'>wg0</span>) interfaces. Each host is assigned specific roles, including internal participants and publicly accessible nodes with internet-facing IPs, enabling the creation of a fully connected mesh VPN.</span><br />
+<br />
+<h3 style='display: inline' id='wireguardmeshgeneratorrb-overview'><span class='inlinecode'>wireguardmeshgenerator.rb</span> overview</h3><br />
+<br />
+<span>The <span class='inlinecode'>wireguardmeshgenerator.rb</span> script consists of the following base classes:</span><br />
+<br />
+<ul>
+<li><span class='inlinecode'>KeyTool</span>: Manages WireGuard key generation and retrieval. It ensures the presence of public/private key pairs and preshared keys (PSKs). If keys are missing, it generates them using the <span class='inlinecode'>wg</span> tool. It provides methods to read the public/private keys and retrieve or generate a PSK for communication with a peer. The keys are stored in a temp directory on the system from where the generator is run.</li>
+<li><span class='inlinecode'>PeerSnippet</span>: A <span class='inlinecode'>Struct</span> representing the configuration for a single WireGuard peer in the mesh. Based on the provided attributes and configuration, it generates the peer&#39;s WireGuard configuration, including public key, PSK, allowed IPs, endpoint, and keepalive settings.</li>
+<li><span class='inlinecode'>WireguardConfig</span>: This function generates WireGuard configuration files for the specified host in the mesh network. It includes the <span class='inlinecode'>[Interface]</span> section for the host itself and the <span class='inlinecode'>[Peer]</span> sections for all other peers. It can also clean up generated files and directories and create the required directory structure for storing configuration files locally on the system from which the script is run.</li>
+<li><span class='inlinecode'>InstallConfig</span>: Handles uploading, installing, and restarting the WireGuard service on remote hosts using SSH and SCP. It ensures the configuration file is uploaded to the remote machine, the necessary directories are present and correctly configured, and the WireGuard service reloads with the new configuration.</li>
+</ul><br />
+<span>At the end (if you want to see the code for the stuff listed above, go to the Git repo and have a look), we glue it all together in this block:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><b><u><font color="#000000">begin</font></u></b>
+ options = { hosts: [] }
+ OptionParser.new <b><u><font color="#000000">do</font></u></b> |opts|
+ opts.banner = <font color="#808080">'Usage: wireguardmeshgenerator.rb [options]'</font>
+ opts.on(<font color="#808080">'--generate'</font>, <font color="#808080">'Generate Wireguard configs'</font>) <b><u><font color="#000000">do</font></u></b>
+ options[:generate] = <b><u><font color="#000000">true</font></u></b>
+ <b><u><font color="#000000">end</font></u></b>
+ opts.on(<font color="#808080">'--install'</font>, <font color="#808080">'Install Wireguard configs'</font>) <b><u><font color="#000000">do</font></u></b>
+ options[:install] = <b><u><font color="#000000">true</font></u></b>
+ <b><u><font color="#000000">end</font></u></b>
+ opts.on(<font color="#808080">'--clean'</font>, <font color="#808080">'Clean Wireguard configs'</font>) <b><u><font color="#000000">do</font></u></b>
+ options[:clean] = <b><u><font color="#000000">true</font></u></b>
+ <b><u><font color="#000000">end</font></u></b>
+ opts.on(<font color="#808080">'--hosts=HOSTS'</font>, <font color="#808080">'Comma separated hosts to configure'</font>) <b><u><font color="#000000">do</font></u></b> |hosts|
+ options[:hosts] = hosts.split(<font color="#808080">','</font>)
+ <b><u><font color="#000000">end</font></u></b>
+ <b><u><font color="#000000">end</font></u></b>.parse!
+
+ conf = YAML.load_file(<font color="#808080">'wireguardmeshgenerator.yaml'</font>).freeze
+ conf[<font color="#808080">'hosts'</font>].keys.select { options[:hosts].empty? || options[:hosts].<b><u><font color="#000000">include</font></u></b>?(_1) }
+ .each <b><u><font color="#000000">do</font></u></b> |host|
+ <i><font color="silver"># Generate Wireguard configuration for the host reload!</font></i>
+ WireguardConfig.new(host, conf[<font color="#808080">'hosts'</font>]).generate! <b><u><font color="#000000">if</font></u></b> options[:generate]
+ <i><font color="silver"># Install Wireguard configuration for the host.</font></i>
+ InstallConfig.new(host, conf[<font color="#808080">'hosts'</font>]).upload!.install!.reload! <b><u><font color="#000000">if</font></u></b> options[:install]
+ <i><font color="silver"># Clean Wireguard configuration for the host.</font></i>
+ WireguardConfig.new(host, conf[<font color="#808080">'hosts'</font>]).clean! <b><u><font color="#000000">if</font></u></b> options[:clean]
+ <b><u><font color="#000000">end</font></u></b>
+<b><u><font color="#000000">rescue</font></u></b> StandardError =&gt; e
+ puts <font color="#808080">"Error: #{e.message}"</font>
+ puts e.backtrace.join(<font color="#808080">"\n"</font>)
+ exit <font color="#000000">2</font>
+<b><u><font color="#000000">end</font></u></b>
+</pre>
+<br />
+<span>And we also have a <span class='inlinecode'>Rakefile</span>:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>task :generate <b><u><font color="#000000">do</font></u></b>
+ ruby <font color="#808080">'wireguardmeshgenerator.rb'</font>, <font color="#808080">'--generate'</font>
+<b><u><font color="#000000">end</font></u></b>
+
+task :clean <b><u><font color="#000000">do</font></u></b>
+ ruby <font color="#808080">'wireguardmeshgenerator.rb'</font>, <font color="#808080">'--clean'</font>
+<b><u><font color="#000000">end</font></u></b>
+
+task :install <b><u><font color="#000000">do</font></u></b>
+ ruby <font color="#808080">'wireguardmeshgenerator.rb'</font>, <font color="#808080">'--install'</font>
+<b><u><font color="#000000">end</font></u></b>
+
+task default: :generate
+</pre>
+<br />
+<br />
+<h2 style='display: inline' id='invoking-the-mesh-network-generator'>Invoking the mesh network generator</h2><br />
+<br />
+<h3 style='display: inline' id='generating-the-wg0conf-files-and-keys'>Generating the <span class='inlinecode'>wg0.conf</span> files and keys</h3><br />
+<br />
+<span>To generate everything (the <span class='inlinecode'>wg0.conf</span> of all participating hosts, including all keys involved), we run the following:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>&gt; rake generate
+/usr/bin/ruby wireguardmeshgenerator.rb --generate
+Generating dist/f<font color="#000000">0</font>/etc/wireguard/wg<font color="#000000">0</font>.conf
+Generating dist/f<font color="#000000">1</font>/etc/wireguard/wg<font color="#000000">0</font>.conf
+Generating dist/f<font color="#000000">2</font>/etc/wireguard/wg<font color="#000000">0</font>.conf
+Generating dist/r<font color="#000000">0</font>/etc/wireguard/wg<font color="#000000">0</font>.conf
+Generating dist/r<font color="#000000">1</font>/etc/wireguard/wg<font color="#000000">0</font>.conf
+Generating dist/r<font color="#000000">2</font>/etc/wireguard/wg<font color="#000000">0</font>.conf
+Generating dist/blowfish/etc/wireguard/wg<font color="#000000">0</font>.conf
+Generating dist/fishfinger/etc/wireguard/wg<font color="#000000">0</font>.conf
+</pre>
+<br />
+<span>It generated all the <span class='inlinecode'>wg0.conf</span> files listed in the output, plus those keys:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>&gt; find keys/ -type f
+keys/f<font color="#000000">0</font>/priv.key
+keys/f<font color="#000000">0</font>/pub.key
+keys/psk/f0_f1.key
+keys/psk/f0_f2.key
+keys/psk/f0_r0.key
+keys/psk/f0_r1.key
+keys/psk/f0_r2.key
+keys/psk/blowfish_f0.key
+keys/psk/f0_fishfinger.key
+keys/psk/f1_f2.key
+keys/psk/f1_r0.key
+keys/psk/f1_r1.key
+keys/psk/f1_r2.key
+keys/psk/blowfish_f1.key
+keys/psk/f1_fishfinger.key
+keys/psk/f2_r0.key
+keys/psk/f2_r1.key
+keys/psk/f2_r2.key
+keys/psk/blowfish_f2.key
+keys/psk/f2_fishfinger.key
+keys/psk/r0_r1.key
+keys/psk/r0_r2.key
+keys/psk/blowfish_r0.key
+keys/psk/fishfinger_r0.key
+keys/psk/r1_r2.key
+keys/psk/blowfish_r1.key
+keys/psk/fishfinger_r1.key
+keys/psk/blowfish_r2.key
+keys/psk/fishfinger_r2.key
+keys/psk/blowfish_fishfinger.key
+keys/f<font color="#000000">1</font>/priv.key
+keys/f<font color="#000000">1</font>/pub.key
+keys/f<font color="#000000">2</font>/priv.key
+keys/f<font color="#000000">2</font>/pub.key
+keys/r<font color="#000000">0</font>/priv.key
+keys/r<font color="#000000">0</font>/pub.key
+keys/r<font color="#000000">1</font>/priv.key
+keys/r<font color="#000000">1</font>/pub.key
+keys/r<font color="#000000">2</font>/priv.key
+keys/r<font color="#000000">2</font>/pub.key
+keys/blowfish/priv.key
+keys/blowfish/pub.key
+keys/fishfinger/priv.key
+keys/fishfinger/pub.key
+</pre>
+<br />
+<span>Those keys are embedded in the resulting <span class='inlinecode'>wg0.conf</span>, so later, we only need to install the <span class='inlinecode'>wg0.conf</span> files and not all the keys individually.</span><br />
+<br />
+<h3 style='display: inline' id='installing-the-wg0conf-files'>Installing the <span class='inlinecode'>wg0.conf</span> files</h3><br />
+<br />
+<span>Uploading the <span class='inlinecode'>wg0.conf</span> files to the participating hosts and reloading WireGuard on them is then just a matter of executing (this expects, that all participating hosts are up and running):</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>&gt; rake install
+/usr/bin/ruby wireguardmeshgenerator.rb --install
+Uploading dist/f<font color="#000000">0</font>/etc/wireguard/wg<font color="#000000">0</font>.conf to f0.lan.buetow.org:.
+Installing Wireguard config on f0
+Uploading cmd.sh to f0.lan.buetow.org:.
++ [ ! -d /usr/local/etc/wireguard ]
++ doas chmod <font color="#000000">700</font> /usr/local/etc/wireguard
++ doas mv -v wg0.conf /usr/local/etc/wireguard
+wg0.conf -&gt; /usr/local/etc/wireguard/wg<font color="#000000">0</font>.conf
++ doas chmod <font color="#000000">644</font> /usr/local/etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on f0
+Uploading cmd.sh to f0.lan.buetow.org:.
++ doas service wireguard reload
++ rm cmd.sh
+Uploading dist/f<font color="#000000">1</font>/etc/wireguard/wg<font color="#000000">0</font>.conf to f1.lan.buetow.org:.
+Installing Wireguard config on f1
+Uploading cmd.sh to f1.lan.buetow.org:.
++ [ ! -d /usr/local/etc/wireguard ]
++ doas chmod <font color="#000000">700</font> /usr/local/etc/wireguard
++ doas mv -v wg0.conf /usr/local/etc/wireguard
+wg0.conf -&gt; /usr/local/etc/wireguard/wg<font color="#000000">0</font>.conf
++ doas chmod <font color="#000000">644</font> /usr/local/etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on f1
+Uploading cmd.sh to f1.lan.buetow.org:.
++ doas service wireguard reload
++ rm cmd.sh
+Uploading dist/f<font color="#000000">2</font>/etc/wireguard/wg<font color="#000000">0</font>.conf to f2.lan.buetow.org:.
+Installing Wireguard config on f2
+Uploading cmd.sh to f2.lan.buetow.org:.
++ [ ! -d /usr/local/etc/wireguard ]
++ doas chmod <font color="#000000">700</font> /usr/local/etc/wireguard
++ doas mv -v wg0.conf /usr/local/etc/wireguard
+wg0.conf -&gt; /usr/local/etc/wireguard/wg<font color="#000000">0</font>.conf
++ doas chmod <font color="#000000">644</font> /usr/local/etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on f2
+Uploading cmd.sh to f2.lan.buetow.org:.
++ doas service wireguard reload
++ rm cmd.sh
+Uploading dist/r<font color="#000000">0</font>/etc/wireguard/wg<font color="#000000">0</font>.conf to r0.lan.buetow.org:.
+Installing Wireguard config on r0
+Uploading cmd.sh to r0.lan.buetow.org:.
++ <font color="#808080">'['</font> <font color="#808080">'!'</font> -d /etc/wireguard <font color="#808080">']'</font>
++ chmod <font color="#000000">700</font> /etc/wireguard
++ mv -v wg0.conf /etc/wireguard
+renamed <font color="#808080">'wg0.conf'</font> -&gt; <font color="#808080">'/etc/wireguard/wg0.conf'</font>
++ chmod <font color="#000000">644</font> /etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on r0
+Uploading cmd.sh to r0.lan.buetow.org:.
++ systemctl reload wg-quick@wg0.service
++ rm cmd.sh
+Uploading dist/r<font color="#000000">1</font>/etc/wireguard/wg<font color="#000000">0</font>.conf to r1.lan.buetow.org:.
+Installing Wireguard config on r1
+Uploading cmd.sh to r1.lan.buetow.org:.
++ <font color="#808080">'['</font> <font color="#808080">'!'</font> -d /etc/wireguard <font color="#808080">']'</font>
++ chmod <font color="#000000">700</font> /etc/wireguard
++ mv -v wg0.conf /etc/wireguard
+renamed <font color="#808080">'wg0.conf'</font> -&gt; <font color="#808080">'/etc/wireguard/wg0.conf'</font>
++ chmod <font color="#000000">644</font> /etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on r1
+Uploading cmd.sh to r1.lan.buetow.org:.
++ systemctl reload wg-quick@wg0.service
++ rm cmd.sh
+Uploading dist/r<font color="#000000">2</font>/etc/wireguard/wg<font color="#000000">0</font>.conf to r2.lan.buetow.org:.
+Installing Wireguard config on r2
+Uploading cmd.sh to r2.lan.buetow.org:.
++ <font color="#808080">'['</font> <font color="#808080">'!'</font> -d /etc/wireguard <font color="#808080">']'</font>
++ chmod <font color="#000000">700</font> /etc/wireguard
++ mv -v wg0.conf /etc/wireguard
+renamed <font color="#808080">'wg0.conf'</font> -&gt; <font color="#808080">'/etc/wireguard/wg0.conf'</font>
++ chmod <font color="#000000">644</font> /etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on r2
+Uploading cmd.sh to r2.lan.buetow.org:.
++ systemctl reload wg-quick@wg0.service
++ rm cmd.sh
+Uploading dist/blowfish/etc/wireguard/wg<font color="#000000">0</font>.conf to blowfish.buetow.org:.
+Installing Wireguard config on blowfish
+Uploading cmd.sh to blowfish.buetow.org:.
++ [ ! -d /etc/wireguard ]
++ doas chmod <font color="#000000">700</font> /etc/wireguard
++ doas mv -v wg0.conf /etc/wireguard
+wg0.conf -&gt; /etc/wireguard/wg<font color="#000000">0</font>.conf
++ doas chmod <font color="#000000">644</font> /etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on blowfish
+Uploading cmd.sh to blowfish.buetow.org:.
++ doas sh /etc/netstart wg0
++ rm cmd.sh
+Uploading dist/fishfinger/etc/wireguard/wg<font color="#000000">0</font>.conf to fishfinger.buetow.org:.
+Installing Wireguard config on fishfinger
+Uploading cmd.sh to fishfinger.buetow.org:.
++ [ ! -d /etc/wireguard ]
++ doas chmod <font color="#000000">700</font> /etc/wireguard
++ doas mv -v wg0.conf /etc/wireguard
+wg0.conf -&gt; /etc/wireguard/wg<font color="#000000">0</font>.conf
++ doas chmod <font color="#000000">644</font> /etc/wireguard/wg<font color="#000000">0</font>.conf
++ rm cmd.sh
+Reloading Wireguard on fishfinger
+Uploading cmd.sh to fishfinger.buetow.org:.
++ doas sh /etc/netstart wg0
++ rm cmd.sh
+</pre>
+<br />
+<h3 style='display: inline' id='re-generating-mesh-and-installing-the-wg0conf-files-again'>Re-generating mesh and installing the <span class='inlinecode'>wg0.conf</span> files again</h3><br />
+<br />
+<span>The mesh network can be re-generated and re-installed as follows:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>&gt; rake clean
+&gt; rake generate
+&gt; rake install
+</pre>
+<br />
+<span>That would also delete and re-generate all the keys involved.</span><br />
+<br />
+<h2 style='display: inline' id='happy-wireguard-ing'>Happy WireGuard-ing</h2><br />
+<br />
+<span>All is set up now. E.g. on <span class='inlinecode'>f0</span>:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>paul@f0:~ % doas wg show
+interface: wg0
+ public key: Jm6YItMt94++dIeOyVi1I9AhNt2qQcryxCZezoX7X2Y=
+ private key: (hidden)
+ listening port: <font color="#000000">56709</font>
+
+peer: 8PvGZH1NohHpZPVJyjhctBX9xblsNvYBhpg68FsFcns=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">46.23</font>.<font color="#000000">94.99</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.111</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">1</font> minute, <font color="#000000">46</font> seconds ago
+ transfer: <font color="#000000">124</font> B received, <font color="#000000">1.75</font> KiB sent
+ persistent keepalive: every <font color="#000000">25</font> seconds
+
+peer: Xow+d3qVXgUMk4pcRSQ6Fe+vhYBa3VDyHX/4jrGoKns=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">23.88</font>.<font color="#000000">35.144</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.110</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">1</font> minute, <font color="#000000">52</font> seconds ago
+ transfer: <font color="#000000">124</font> B received, <font color="#000000">1.60</font> KiB sent
+ persistent keepalive: every <font color="#000000">25</font> seconds
+
+peer: s3e93XoY7dPUQgLiVO4d8x/SRCFgEew+/wP<font color="#000000">7</font>+zwgehI=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.120</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.120</font>/<font color="#000000">32</font>
+
+peer: 2htXdNcxzpI2FdPDJy4T4VGtm1wpMEQu1AkQHjNY6F8=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.131</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.131</font>/<font color="#000000">32</font>
+
+peer: 0Y/H20W8YIbF7DA1sMwMacLI8WS9yG+<font color="#000000">1</font>/QO7m2oyllg=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.122</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.122</font>/<font color="#000000">32</font>
+
+peer: Hhy9kMPOOjChXV2RA5WeCGs+J0FE3rcNPDw/TLSn7i8=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.121</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.121</font>/<font color="#000000">32</font>
+
+peer: SlGVsACE1wiaRoGvCR3f7AuHfRS+1jjhS+YwEJ2HvF0=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.132</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.132</font>/<font color="#000000">32</font>
+</pre>
+<br />
+<span>All the hosts are pingable as well, e.g.:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>paul@f0:~ % foreach peer ( f1 f2 r0 r1 r2 blowfish fishfinger )
+foreach? ping -c<font color="#000000">2</font> $peer.wg0
+foreach? echo
+foreach? end
+PING f1.wg0 (<font color="#000000">192.168</font>.<font color="#000000">2.131</font>): <font color="#000000">56</font> data bytes
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.131</font>: icmp_seq=<font color="#000000">0</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.334</font> ms
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.131</font>: icmp_seq=<font color="#000000">1</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.260</font> ms
+
+--- f1.wg0 ping statistics ---
+<font color="#000000">2</font> packets transmitted, <font color="#000000">2</font> packets received, <font color="#000000">0.0</font>% packet loss
+round-trip min/avg/max/stddev = <font color="#000000">0.260</font>/<font color="#000000">0.297</font>/<font color="#000000">0.334</font>/<font color="#000000">0.037</font> ms
+
+PING f2.wg0 (<font color="#000000">192.168</font>.<font color="#000000">2.132</font>): <font color="#000000">56</font> data bytes
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.132</font>: icmp_seq=<font color="#000000">0</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.323</font> ms
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.132</font>: icmp_seq=<font color="#000000">1</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.303</font> ms
+
+--- f2.wg0 ping statistics ---
+<font color="#000000">2</font> packets transmitted, <font color="#000000">2</font> packets received, <font color="#000000">0.0</font>% packet loss
+round-trip min/avg/max/stddev = <font color="#000000">0.303</font>/<font color="#000000">0.313</font>/<font color="#000000">0.323</font>/<font color="#000000">0.010</font> ms
+
+PING r0.wg0 (<font color="#000000">192.168</font>.<font color="#000000">2.120</font>): <font color="#000000">56</font> data bytes
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.120</font>: icmp_seq=<font color="#000000">0</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.716</font> ms
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.120</font>: icmp_seq=<font color="#000000">1</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.406</font> ms
+
+--- r0.wg0 ping statistics ---
+<font color="#000000">2</font> packets transmitted, <font color="#000000">2</font> packets received, <font color="#000000">0.0</font>% packet loss
+round-trip min/avg/max/stddev = <font color="#000000">0.406</font>/<font color="#000000">0.561</font>/<font color="#000000">0.716</font>/<font color="#000000">0.155</font> ms
+
+PING r1.wg0 (<font color="#000000">192.168</font>.<font color="#000000">2.121</font>): <font color="#000000">56</font> data bytes
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.121</font>: icmp_seq=<font color="#000000">0</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.639</font> ms
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.121</font>: icmp_seq=<font color="#000000">1</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.629</font> ms
+
+--- r1.wg0 ping statistics ---
+<font color="#000000">2</font> packets transmitted, <font color="#000000">2</font> packets received, <font color="#000000">0.0</font>% packet loss
+round-trip min/avg/max/stddev = <font color="#000000">0.629</font>/<font color="#000000">0.634</font>/<font color="#000000">0.639</font>/<font color="#000000">0.005</font> ms
+
+PING r2.wg0 (<font color="#000000">192.168</font>.<font color="#000000">2.122</font>): <font color="#000000">56</font> data bytes
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.122</font>: icmp_seq=<font color="#000000">0</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.569</font> ms
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.122</font>: icmp_seq=<font color="#000000">1</font> ttl=<font color="#000000">64</font> time=<font color="#000000">0.479</font> ms
+
+--- r2.wg0 ping statistics ---
+<font color="#000000">2</font> packets transmitted, <font color="#000000">2</font> packets received, <font color="#000000">0.0</font>% packet loss
+round-trip min/avg/max/stddev = <font color="#000000">0.479</font>/<font color="#000000">0.524</font>/<font color="#000000">0.569</font>/<font color="#000000">0.045</font> ms
+
+PING blowfish.wg0 (<font color="#000000">192.168</font>.<font color="#000000">2.110</font>): <font color="#000000">56</font> data bytes
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.110</font>: icmp_seq=<font color="#000000">0</font> ttl=<font color="#000000">255</font> time=<font color="#000000">35.745</font> ms
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.110</font>: icmp_seq=<font color="#000000">1</font> ttl=<font color="#000000">255</font> time=<font color="#000000">35.481</font> ms
+
+--- blowfish.wg0 ping statistics ---
+<font color="#000000">2</font> packets transmitted, <font color="#000000">2</font> packets received, <font color="#000000">0.0</font>% packet loss
+round-trip min/avg/max/stddev = <font color="#000000">35.481</font>/<font color="#000000">35.613</font>/<font color="#000000">35.745</font>/<font color="#000000">0.132</font> ms
+
+PING fishfinger.wg0 (<font color="#000000">192.168</font>.<font color="#000000">2.111</font>): <font color="#000000">56</font> data bytes
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.111</font>: icmp_seq=<font color="#000000">0</font> ttl=<font color="#000000">255</font> time=<font color="#000000">33.992</font> ms
+<font color="#000000">64</font> bytes from <font color="#000000">192.168</font>.<font color="#000000">2.111</font>: icmp_seq=<font color="#000000">1</font> ttl=<font color="#000000">255</font> time=<font color="#000000">33.751</font> ms
+
+--- fishfinger.wg0 ping statistics ---
+<font color="#000000">2</font> packets transmitted, <font color="#000000">2</font> packets received, <font color="#000000">0.0</font>% packet loss
+round-trip min/avg/max/stddev = <font color="#000000">33.751</font>/<font color="#000000">33.872</font>/<font color="#000000">33.992</font>/<font color="#000000">0.120</font> ms
+</pre>
+<br />
+<span>Note that the loop above is a <span class='inlinecode'>tcsh</span> loop, the default shell used in FreeBSD. Of course, all other peers can ping their peers as well!</span><br />
+<br />
+<span>After the first ping, VPN tunnels now also show handshakes and the amount of data transferred through them:</span><br />
+<br />
+<!-- Generator: GNU source-highlight 3.1.9
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre>paul@f0:~ % doas wg show
+interface: wg0
+ public key: Jm6YItMt94++dIeOyVi1I9AhNt2qQcryxCZezoX7X2Y=
+ private key: (hidden)
+ listening port: <font color="#000000">56709</font>
+
+peer: 0Y/H20W8YIbF7DA1sMwMacLI8WS9yG+<font color="#000000">1</font>/QO7m2oyllg=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.122</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.122</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">10</font> seconds ago
+ transfer: <font color="#000000">440</font> B received, <font color="#000000">532</font> B sent
+
+peer: Hhy9kMPOOjChXV2RA5WeCGs+J0FE3rcNPDw/TLSn7i8=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.121</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.121</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">12</font> seconds ago
+ transfer: <font color="#000000">440</font> B received, <font color="#000000">564</font> B sent
+
+peer: s3e93XoY7dPUQgLiVO4d8x/SRCFgEew+/wP<font color="#000000">7</font>+zwgehI=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.120</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.120</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">14</font> seconds ago
+ transfer: <font color="#000000">440</font> B received, <font color="#000000">564</font> B sent
+
+peer: SlGVsACE1wiaRoGvCR3f7AuHfRS+1jjhS+YwEJ2HvF0=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.132</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.132</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">17</font> seconds ago
+ transfer: <font color="#000000">472</font> B received, <font color="#000000">564</font> B sent
+
+peer: Xow+d3qVXgUMk4pcRSQ6Fe+vhYBa3VDyHX/4jrGoKns=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">23.88</font>.<font color="#000000">35.144</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.110</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">55</font> seconds ago
+ transfer: <font color="#000000">472</font> B received, <font color="#000000">596</font> B sent
+ persistent keepalive: every <font color="#000000">25</font> seconds
+
+peer: 8PvGZH1NohHpZPVJyjhctBX9xblsNvYBhpg68FsFcns=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">46.23</font>.<font color="#000000">94.99</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.111</font>/<font color="#000000">32</font>
+ latest handshake: <font color="#000000">55</font> seconds ago
+ transfer: <font color="#000000">472</font> B received, <font color="#000000">596</font> B sent
+ persistent keepalive: every <font color="#000000">25</font> seconds
+
+peer: 2htXdNcxzpI2FdPDJy4T4VGtm1wpMEQu1AkQHjNY6F8=
+ preshared key: (hidden)
+ endpoint: <font color="#000000">192.168</font>.<font color="#000000">1.131</font>:<font color="#000000">56709</font>
+ allowed ips: <font color="#000000">192.168</font>.<font color="#000000">2.131</font>/<font color="#000000">32</font>
+</pre>
+<br />
+<h2 style='display: inline' id='conclusion'>Conclusion</h2><br />
+<br />
+<span>Having a mesh network on our hosts is great for securing all the traffic between them for our future <span class='inlinecode'>k3s</span> setup. A self-managed WireGuard mesh network is better than Tailscale as it eliminates reliance on a third party and provides full control over the configuration. It reduces unnecessary abstraction and "magic," enabling easier debugging and ensuring full ownership of our network.</span><br />
+<br />
+<span>I look forward to the next blog post in this series. We may start setting up <span class='inlinecode'>k3s</span> or take a first look at the NFS server (for persistent storage) side of things. I hope you liked all the posts so far in this series.</span><br />
+<br />
+<span>Other *BSD-related posts:</span><br />
+<br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network (You are currently reading this)</a><br />
+<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
+<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
+<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
+<a class='textlink' href='./2024-11-17-f3s-kubernetes-with-freebsd-part-1.html'>2024-11-17 f3s: Kubernetes with FreeBSD - Part 1: Setting the stage</a><br />
+<a class='textlink' href='./2024-04-01-KISS-high-availability-with-OpenBSD.html'>2024-04-01 KISS high-availability with OpenBSD</a><br />
+<a class='textlink' href='./2024-01-13-one-reason-why-i-love-openbsd.html'>2024-01-13 One reason why I love OpenBSD</a><br />
+<a class='textlink' href='./2022-10-30-installing-dtail-on-openbsd.html'>2022-10-30 Installing DTail on OpenBSD</a><br />
+<a class='textlink' href='./2022-07-30-lets-encrypt-with-openbsd-and-rex.html'>2022-07-30 Let&#39;s Encrypt with OpenBSD and Rex</a><br />
+<a class='textlink' href='./2016-04-09-jails-and-zfs-on-freebsd-with-puppet.html'>2016-04-09 Jails and ZFS with Puppet on FreeBSD</a><br />
+<br />
+<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span></span><br />
+<br />
+<a class='textlink' href='../'>Back to the main site</a><br />
+ </div>
+ </content>
+ </entry>
+ <entry>
<title>Terminal multiplexing with `tmux` - Fish edition</title>
<link href="gemini://foo.zone/gemfeed/2025-05-02-terminal-multiplexing-with-tmux-fish-edition.gmi" />
<id>gemini://foo.zone/gemfeed/2025-05-02-terminal-multiplexing-with-tmux-fish-edition.gmi</id>
@@ -566,6 +1590,7 @@ __ejm\___/________dwb`---`______________________
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs (You are currently reading this)</a><br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br />
<br />
@@ -1136,10 +2161,11 @@ Apr <font color="#000000">4</font> <font color="#000000">23</font>:<font color=
<br />
<span>This flexibility is great for keeping options open and managing different workloads without overcomplicating things. Overall, it&#39;s a nice setup for getting the most out of my hardware and keeping things running smoothly.</span><br />
<br />
-<span>See you in the next blog post of this series. Maybe we will be installing highly available storage with HAST or we start setting up k3s on the Rocky Linux VMs.</span><br />
+<span>See you in the next post of this series!</span><br />
<br />
<span>Other *BSD-related posts:</span><br />
<br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs (You are currently reading this)</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
@@ -1860,6 +2886,7 @@ This is perl, v5.<font color="#000000">8.8</font> built <b><u><font color="#0000
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br />
<br />
@@ -2253,6 +3280,7 @@ Jan 26 17:36:32 f2 apcupsd[2159]: apcupsd shutdown succeeded
<br />
<span>Other BSD related posts are:</span><br />
<br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts (You are currently reading this)</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
@@ -2957,10 +3985,11 @@ http://www.gnu.org/software/src-highlite -->
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br />
<br />
-<span class='quote'>Logo was generated by ChatGPT.</span><br />
+<span class='quote'>ChatGPT generated logo..</span><br />
<br />
<span>Let&#39;s continue...</span><br />
<br />
@@ -3287,6 +4316,7 @@ dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">2922</font>
<br />
<span>Other *BSD-related posts:</span><br />
<br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation (You are currently reading this)</a><br />
@@ -3329,10 +4359,11 @@ dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">2922</font>
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<br />
<a href='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png'><img alt='f3s logo' title='f3s logo' src='./f3s-kubernetes-with-freebsd-part-1/f3slogo.png' /></a><br />
<br />
-<span class='quote'>Logo was generated by ChatGPT.</span><br />
+<span class='quote'>ChatGPT generated logo..</span><br />
<br />
<span>Let&#39;s begin...</span><br />
<br />
@@ -3480,6 +4511,7 @@ dev.cpu.<font color="#000000">0</font>.freq: <font color="#000000">2922</font>
<br />
<span>Other *BSD-related posts:</span><br />
<br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
@@ -5976,6 +7008,7 @@ http://www.gnu.org/software/src-highlite -->
<br />
<span>Other *BSD and KISS related posts are:</span><br />
<br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
@@ -6338,6 +7371,7 @@ $ doas reboot <i><font color="silver"># Just in case, reboot one more time</font
<br />
<span>Other *BSD related posts are:</span><br />
<br />
+<a class='textlink' href='./2025-05-11-f3s-kubernetes-with-freebsd-part-5.html'>2025-05-11 f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network</a><br />
<a class='textlink' href='./2025-04-05-f3s-kubernetes-with-freebsd-part-4.html'>2025-04-05 f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs</a><br />
<a class='textlink' href='./2025-02-01-f3s-kubernetes-with-freebsd-part-3.html'>2025-02-01 f3s: Kubernetes with FreeBSD - Part 3: Protecting from power cuts</a><br />
<a class='textlink' href='./2024-12-03-f3s-kubernetes-with-freebsd-part-2.html'>2024-12-03 f3s: Kubernetes with FreeBSD - Part 2: Hardware and base installation</a><br />
@@ -9494,174 +10528,4 @@ The remaining content of the Gemtext file...
</div>
</content>
</entry>
- <entry>
- <title>Why GrapheneOS rox</title>
- <link href="gemini://foo.zone/gemfeed/2023-01-23-why-grapheneos-rox.gmi" />
- <id>gemini://foo.zone/gemfeed/2023-01-23-why-grapheneos-rox.gmi</id>
- <updated>2023-01-23T15:31:52+02:00</updated>
- <author>
- <name>Paul Buetow aka snonux</name>
- <email>paul@dev.buetow.org</email>
- </author>
- <summary>In 2021 I wrote 'On Being Pedantic about Open-Source', and there was a section 'What about mobile?' where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </summary>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <h1 style='display: inline' id='why-grapheneos-rox'>Why GrapheneOS rox</h1><br />
-<br />
-<span class='quote'>Published at 2023-01-23T15:31:52+02:00</span><br />
-<br />
-<span>In 2021 I wrote "On Being Pedantic about Open-Source", and there was a section "What about mobile?" where I expressed the dilemma about the necessity of using proprietary mobile operating systems. With GrapheneOS, I found my perfect solution for personal mobile phone use. </span><br />
-<br />
-<a class='textlink' href='./2021-08-01-on-being-pedantic-about-open-source.html'>On Being Pedantic about Open-Source</a><br />
-<br />
-<span>What is GrapheneOS?</span><br />
-<br />
-<span class='quote'>GrapheneOS is a privacy and security-focused mobile OS with Android app compatibility developed as a non-profit open-source project. It&#39;s focused on the research and development of privacy and security technologies, including substantial improvements to sandboxing, exploits mitigations and the permission model.</span><br />
-<br />
-<span>GrapheneOS is an independent Android distribution based on the Android Open Source Project (AOSP) but hardened in multiple ways. Other independent Android distributions, like LineageOS, are also based on AOSP, but GrapheneOS takes it further so that it can be my daily driver on my phone.</span><br />
-<br />
-<a class='textlink' href='https://GrapheneOS.org'>https://GrapheneOS.org</a><br />
-<a class='textlink' href='https://LineageOS.org'>https://LineageOS.org</a><br />
-<br />
-<pre>
-Art by Joan Stark
- _.===========================._
- .&#39;` .- - __- - - -- --__--- -. `&#39;.
- __ / ,&#39;` _|--|_________|--|_ `&#39;. \
- /&#39;--| ; _.&#39;\ | &#39; &#39; | /&#39;._ ; |
- // | |_.-&#39; .-&#39;.&#39; ___ &#39;.&#39;-. &#39;-._| |
- (\) \"` _.-` / .-&#39;`_ `&#39;-. \ `-._ `"/
- (\) `-&#39; | .&#39; .-&#39;" "&#39;-. &#39;. | `-`
- (\) | / .&#39;(3)(2)(1)&#39;. \ |
- (\) | / / (4) .-. \ \ |
- (\) | | |(5) ( )&#39;==,J | |
- (\) | \ \ (6) &#39;-&#39; (0) / / |
- (\) | \ &#39;.(7)(8)(9).&#39; / |
- (\) ___| &#39;. &#39;-.._..-&#39; .&#39; |
- (\) /.--| &#39;-._____.-&#39; |
- (\) (\) |\_ _ __ _ __ __/|
- (\) (\) | |
-(\)_._._.__(\) | |
- (\\\\jgs\\\) &#39;.___________________.&#39;
- &#39;-&#39;-&#39;-&#39;--&#39;
-</pre>
-<br />
-<h2 style='display: inline' id='table-of-contents'>Table of Contents</h2><br />
-<br />
-<ul>
-<li><a href='#why-grapheneos-rox'>Why GrapheneOS rox</a></li>
-<li>⇢ <a href='#user-profiles'>User Profiles</a></li>
-<li>⇢ <a href='#proxying-some-of-the-google-offerings-'>Proxying some of the Google offerings </a></li>
-<li>⇢ <a href='#google-play-sandboxing-'>Google Play Sandboxing </a></li>
-<li>⇢ <a href='#the-camera-and-the-cloud-'>The camera and the cloud </a></li>
-<li>⇢ <a href='#fine-granular-permissions'>Fine granular permissions</a></li>
-<li>⇢ <a href='#termux'>Termux</a></li>
-<li>⇢ <a href='#so-why-not-use-a-pure-linux-phone'>So, why not use a pure Linux phone?</a></li>
-<li>⇢ <a href='#small-grapheneos-downsides-'>Small GrapheneOS downsides </a></li>
-</ul><br />
-<h2 style='display: inline' id='user-profiles'>User Profiles</h2><br />
-<br />
-<span>GrapheneOS allows configuring up to 32 user profiles (including a guest profile) on a single phone. A profile is a completely different environment within the phone, and it is possible to switch between them instantly. Sessions of a profile can continue running in the background or be fully terminated. Each profile can have completely different settings and different applications installed.</span><br />
-<br />
-<span>I use my default profile with primarily open-source applications installed, which I trust. I use another profile for banking (PayPal, various proprietary bank apps, Amazon store app, etc.) and another profile for various Google services (which I try to avoid, but I have to use once in a while). Furthermore, I have configured a profile for Social Media use (that one isn&#39;t in my default profile, as otherwise I am tempted to scroll social media all the time, which I try to avoid and only want to do intentionally when switching to the corresponding profile!).</span><br />
-<br />
-<span>The neat thing about the profiles is that some can run a sandboxed version of Google Play (see later in this post), while others don&#39;t. So some profiles can entirely operate without any Google Play, and only some profiles (to which I rarely switch) have Google Play enabled. </span><br />
-<br />
-<span>You notice how much longer (multiple days) your phone can be on a single charge when Google Play Services isn&#39;t running in the background. This tells a lot about the background activities and indicates that using Google Play shouldn&#39;t be the norm.</span><br />
-<br />
-<h2 style='display: inline' id='proxying-some-of-the-google-offerings-'>Proxying some of the Google offerings </h2><br />
-<br />
-<span>There&#39;s also the case that I am using an app from the Google Play store (as the app isn&#39;t available from F-Droid), which doesn&#39;t require Google Play Services to run in the background. Here&#39;s where I use the Aurora Android store. The Aurora store can be installed through F-Droid. Aurora acts as an anonymous proxy from your phone to the Google Play Store and lets you install apps from there. No Google credentials are required for that!</span><br />
-<br />
-<a class='textlink' href='https://f-droid.org'>https://f-droid.org</a><br />
-<br />
-<span>There&#39;s a similar solution for watching videos on YouTube. You can use the NewPipe app (also from F-Droid), which acts as an anonymous proxy for watching videos from YouTube. So there isn&#39;t any need to install the official YouTube app, and there isn&#39;t any need to login to your Google account. What&#39;s so bad about the official app? You don&#39;t know which data it is sending about you to Google, so it is a privacy concern. </span><br />
-<br />
-<h2 style='display: inline' id='google-play-sandboxing-'>Google Play Sandboxing </h2><br />
-<br />
-<span>Before switching to GrapheneOS, I had been using LineageOS on one of my phones for a couple of years. Still, I always had to have a secondary personal phone with all of these proprietary apps which (partially) only work with Google Play on the phone (e.g. Banking, Navigation, various travel apps from various Airlines, etc.) somewhere around as I didn&#39;t install Google Play on my LineageOS phone due to privacy concerns and only installed apps from the F-Droid store on it. When travelling, I always had to carry around a second phone with Google Play on it, as without it; life would become inconvenient pretty soon. </span><br />
-<br />
-<span>With GrapheneOS, it is different. Here, I do not just have a separate user profile, "Google", for various Google apps where Google Play runs, but Google Play also runs in a sandbox!!!</span><br />
-<br />
-<span class='quote'>GrapheneOS has a compatibility layer providing the option to install and use the official releases of Google Play in the standard app sandbox. Google Play receives no special access or privileges on GrapheneOS instead of bypassing the app sandbox and receiving a massive amount of highly privileged access. Instead, the compatibility layer teaches it how to work within the full app sandbox. It also isn&#39;t used as a backend for the OS services as it would be elsewhere since GrapheneOS doesn&#39;t use Google Play even when it&#39;s installed.</span><br />
-<br />
-<span>When I need to access Google Play, I can switch to the "Google" profile. Even there, Google is sandboxed to the absolute minimum permissions required to be operational, which gives additional privacy protection.</span><br />
-<br />
-<span>The sad truth is that Google Maps is still the best navigation app. When driving unknown routes, I can switch to my Google profile to use Google Maps. I don&#39;t need to do that when going streets I know about, but it is crucial (for me) to have Google Maps around when driving to a new destination.</span><br />
-<br />
-<span>Also, Google Translate and Google Lens are still the best translation apps I know. I just recently relocated to another country, where I am still learning the language, so Google Lens has been proven very helpful on various occasions by ad-hoc translating text into English or German for me.</span><br />
-<br />
-<span>The same applies to banking. Many banking apps require Google Play to be available (It might be even more secure to only use banking apps from the Google Play store due to official support and security updates). I rarely need to access my mobile banking app, but once in a while, I need to. As you have guessed by now, I can switch to my banking profile (with Google Play enabled), do what I need to do, and then terminate the session and go back to my default profile, and then my life can go on :-). </span><br />
-<br />
-<span>It is great to have the flexibility to use any proprietary Android app when needed. That only applies to around 1% of my phone usage time, but you often don&#39;t always know when you need "that one app now". So it&#39;s perfect that it&#39;s covered with the phone you always have with you. </span><br />
-<br />
-<h2 style='display: inline' id='the-camera-and-the-cloud-'>The camera and the cloud </h2><br />
-<br />
-<span>I really want my phone to shoot good looking pictures, so that I can later upload them to the Irregular Ninja:</span><br />
-<br />
-<a class='textlink' href='https://irregular.ninja'>https://irregular.ninja</a><br />
-<br />
-<span>The stock camera app of the OASP could be better. Photos usually look washed out, and the app lacks features. With GrapheneOS, there are two options:</span><br />
-<br />
-<ul>
-<li>Use the official Google camera app with sandboxed Google Play Services running. You will get the full Google experience here.</li>
-<li>Or, just use the default GrapheneOS camera app.</li>
-</ul><br />
-<span>The GrapheneOS camera app is much better than the stock OASP camera app. I have been comparing the photo quality of my Pixel phone under LineageOS and GrapheneOS, and the differences are pronounced. I didn&#39;t compare the quality with the official Google camera app, but I have seen some comparison videos and the differences seem like they aren&#39;t groundbreaking. </span><br />
-<br />
-<span>For automatic backups of my photos, I am relying on a self-hosted instance of NextCloud (with a client app available via F-Droid). So there isn&#39;t any need to rely on any Google apps and services (Google Play Photos or Google Camera app) anymore, and that&#39;s great!</span><br />
-<br />
-<a class='textlink' href='https://nextcloud.com'>https://nextcloud.com</a><br />
-<br />
-<span>I also use NextCloud to synchronize my notes (NextCloud Notes), my RSS news feeds (NextCloud News) and contacts (DAVx5). All apps required are available in the F-Droid store.</span><br />
-<br />
-<h2 style='display: inline' id='fine-granular-permissions'>Fine granular permissions</h2><br />
-<br />
-<span>Another great thing about GrapheneOS is that, besides putting your apps into different profiles, you can also restrict network access and configure storage scopes per app individually.</span><br />
-<br />
-<span>For example, let&#39;s say you are installing that one proprietary app from the Google Play Store through the Aurora store, and then you want to ensure that the app doesn&#39;t send data "home" through the internet. Nothing is easier to do than that. Just remove network access permissions from that only app.</span><br />
-<br />
-<span>The app also wants to store and read some data from your phone (e.g. it could be a proprietary app for enhancing photos, and therefore storage access to a photo folder would be required). In GrapheneOS, you can configure a storage scope for that particular app, e.g. only read and write from one folder but still forbid access to all other folders on your phone.</span><br />
-<br />
-<h2 style='display: inline' id='termux'>Termux</h2><br />
-<br />
-<span>Termux can be installed on any Android phone through F-Droid, so it doesn&#39;t need to be a GrapheneOS phone. But I have to mention Termux here as it significantly adds value to my phone experience. </span><br />
-<br />
-<span class='quote'>Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically - additional packages are available using the APT package manager.</span><br />
-<br />
-<a class='textlink' href='https://termux.dev'>https://termux.dev</a><br />
-<br />
-<span>In short, Termux is an entire Linux environment running on your Android phone. Just pair your phone with a Bluetooth keyboard, and you will have the whole Linux experience. I am only using terminal Linux applications with Termux, though. What makes it especially great is that I could write on a new blog post (in Neovim through Termux on my phone) or do some coding whilst travelling (e.g. during a flight), or look up my passwords or some other personal documents (through my terminal-based password manager). All changes I commit to Git can be synced to the server with a simple <span class='inlinecode'>git push</span> once online (e.g. after the plane landed) again.</span><br />
-<br />
-<span>There are Pixel phones with a screen size of 6", and that&#39;s decent enough for occasional use like that, and everything (the phone, the BT keyboard, maybe an external battery pack) all fit nicely in a small travel pocket.</span><br />
-<br />
-<h2 style='display: inline' id='so-why-not-use-a-pure-linux-phone'>So, why not use a pure Linux phone?</h2><br />
-<br />
-<span>Strictly speaking, an Android phone is a Linux phone, but it&#39;s heavily modified and customized. For me, a "pure" Linux phone is a more streamlined Linux kernel running in a distribution like Ubuntu Touch or Mobian. </span><br />
-<br />
-<span>A pure Linux phone, e.g. with Ubuntu Touch installed, e.g. on a PinePhone, Fairphone, the Librem 5 or the Volla phone, is very appealing to me. And they would also provide an even better Linux experience than Termux does. Some support running LineageOS within an Anbox, enabling you to run various proprietary Android apps occasionally within Linux.</span><br />
-<br />
-<a class='textlink' href='https://ubuntu-touch.io/'>Ubuntu Touch</a><br />
-<a class='textlink' href='https://en.wikipedia.org/wiki/Linux_for_mobile_devices'>More Linux distributions for mobile devices </a><br />
-<br />
-<span>But here, Google Play would not be sandboxed; you could not configure individual network permissions and storage scopes like in GrapheneOS. Pure Linux-compatible phones usually come with a crappy camera, and the battery life is generally pretty bad (only a few hours). Also, no big tech company pushes the development of Linux phones. Everything relies on hobbyists, whereas multiple big tech companies put a lot of effort into the Android project, and a lot of code also goes into the Android Open-Source project. </span><br />
-<br />
-<span>Currently, pure Linux phones are only a nice toy to tinker with but are still not ready (will they ever?) to be the daily driver. SailfishOS may be an exception; I played around with it in the past. It is pretty usable, but it&#39;s not an option for me as it is partial a proprietary operating system.</span><br />
-<br />
-<a class='textlink' href='https://sailfishos.org'>SailfishOS</a><br />
-<br />
-<h2 style='display: inline' id='small-grapheneos-downsides-'>Small GrapheneOS downsides </h2><br />
-<br />
-<span>Sometimes, switching a profile to use a different app is annoying, and you can&#39;t copy and paste from the system clipboard from one profile to another. But that&#39;s a small price I am willing to pay!</span><br />
-<br />
-<span>Another thing is that GrapheneOS can only run on Google Pixel phones, whereas LineageOS can be installed on a much larger variety of hardware. But on the other hand, GrapheneOS works very well on Pixel phones. The GrapheneOS team can concentrate their development efforts on a smaller set of hardware which then improves the software&#39;s quality (best example: The camera app).</span><br />
-<br />
-<span>And, of course, GrapheneOS is an open-source project. This is a good thing; however, on the other side, nobody can guarantee that the OS will not break or will not damage your phone. You have to trust the GrapheneOS project and donate to the project so they can keep up with the great work. But I rather trust the GrapheneOS team than big tech. </span><br />
-<br />
-<span>E-Mail your comments to <span class='inlinecode'>paul@nospam.buetow.org</span> :-)</span><br />
-<br />
-<a class='textlink' href='../'>Back to the main site</a><br />
- </div>
- </content>
- </entry>
</feed>
diff --git a/gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg b/gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg
new file mode 100644
index 00000000..dd1e0dd0
--- /dev/null
+++ b/gemfeed/f3s-kubernetes-with-freebsd-part-5/wireguard.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 1874.5 333.14" xmlns="http://www.w3.org/2000/svg"><defs><style>.a{fill:#88171a;}.b{fill:#231f20;}</style></defs><title>wireguard</title><path class="a" transform="translate(-1.5394)" d="m404.23 252.47-65.215-199.99h24.456l49.636 154.34 50.904-154.34h22.282l50.723 153.98 49.817-153.98h23.731l-65.034 199.99h-18.115l-52.715-161.04-52.172 161.04h-18.296z"/><path class="a" transform="translate(-1.5394)" d="m606.1 252.47v-155.07h24.637v155.07h-24.637z"/><path class="a" transform="translate(-1.5394)" d="m687.85 184.9v67.57h-24.274v-154.34h106.52q23.73 0 37.136 11.413 13.404 11.413 13.405 31.702a41.774 41.774 0 0 1-10.598 28.531q-10.597 12.05-27.625 14.764l42.933 67.932h-26.267l-43.839-67.57h-67.389zm0-22.644h82.243q12.5 0 19.112-5.4346 6.6101-5.4346 6.6118-15.579 0-10.143-6.6118-15.488-6.6152-5.3416-19.112-5.3442h-82.243v41.846z"/><path class="a" transform="translate(-1.5394)" d="m843.52 252.47v-154.7h145.1v22.644h-120.83v38.585h79.345v22.282h-79.345v48.911h127.53v22.282h-151.81z"/><path class="a" transform="translate(-1.5394)" d="m1166 198.31v-29.347h-54.527v-23.006h79.345v60.143q-14.495 24.999-37.77 38.313-23.28 13.315-52.806 13.315-44.929 0-74.182-29.619-29.257-29.618-29.256-75.087 0-45.65 29.347-75.269 29.347-29.618 74.091-29.618 27.716 0 50.542 12.137a98.119 98.119 0 0 1 37.136 34.6l-20.833 14.854a68.382 68.382 0 0 0-27.173-28.079 78.549 78.549 0 0 0-39.672-10.145q-33.694 0-55.795 23.097-22.104 23.096-22.101 58.421 0 35.325 22.101 58.331 22.099 23.008 55.795 23.006 21.012 0 37.408-9.0576 16.393-9.0565 28.351-26.992z"/><path class="a" transform="translate(-1.5394)" d="m1217.9 98.133h24.274v99.09q0 22.282 10.507 30.071 10.504 7.7908 41.665 7.7896 31.338 0 41.846-7.7896 10.504-7.7864 10.507-30.071v-99.09h24.093v105.43q0 28.442-18.025 41.122-18.027 12.677-58.784 12.681-40.581 0-58.331-12.5-17.756-12.5-17.753-41.303v-105.43z"/><path class="a" transform="translate(-1.5394)" d="m1367 252.47 78.62-154.7h15.217l79.345 154.7h-25.905l-20.108-39.31h-81.7l-19.927 39.31h-25.542zm55.976-59.78h60.505l-30.071-59.237z"/><path class="a" transform="translate(-1.5394)" d="m1567.1 184.9v67.57h-24.274v-154.34h106.52q23.73 0 37.136 11.413 13.404 11.413 13.405 31.702a41.774 41.774 0 0 1-10.598 28.531q-10.597 12.05-27.625 14.764l42.933 67.932h-26.267l-43.839-67.57h-67.389zm0-22.644h82.243q12.5 0 19.112-5.4346 6.6101-5.4346 6.6118-15.579 0-10.143-6.6118-15.488-6.6152-5.3416-19.112-5.3442h-82.243v41.846z"/><path class="a" transform="translate(-1.5394)" d="m1791.8 97.771q37.86 0 61.048 21.647 23.186 21.65 23.188 56.248 0 34.964-22.735 55.886-22.736 20.922-61.501 20.923h-68.657v-154.7h68.657zm0.3623 22.282h-44.745v110.14h44.745q27.534 0 43.295-14.764 15.76-14.762 15.76-40.125 0-24.456-16.304-39.854-16.304-15.395-42.752-15.398z"/><path class="b" transform="translate(-1.5394)" d="m401.21 304.63v18.614h-6.3467v-40.448h37.37v5.9204h-31.023v10.088h20.035v5.8257h-20.035z"/><path class="b" transform="translate(-1.5394)" d="m426.78 323.24 20.556-40.448h3.9785l20.745 40.448h-6.773l-5.2574-10.278h-21.361l-5.21 10.278h-6.6782zm14.635-15.63h15.819l-7.8623-15.488z"/><path class="b" transform="translate(-1.5394)" d="m476.56 318.08 3.0786-5.3047a35.512 35.512 0 0 0 9.0938 4.3574 31.144 31.144 0 0 0 9.4253 1.563 15.505 15.505 0 0 0 8.7148-2.2022 6.5827 6.5827 0 0 0 3.3154-5.6602 5.5059 5.5059 0 0 0-3.0312-5.1387q-3.0315-1.6809-9.5674-1.8711-11.036-0.14209-15.156-2.5576-4.1206-2.4155-4.1206-8.0044a9.7851 9.7851 0 0 1 4.523-8.3833q4.5227-3.1728 12.149-3.1733a35.061 35.061 0 0 1 10.112 1.4682 37.803 37.803 0 0 1 9.4492 4.3574l-3.1733 5.2573a31.907 31.907 0 0 0-8.1465-3.9546 27.298 27.298 0 0 0-8.3359-1.3975 14.736 14.736 0 0 0-7.3887 1.6104 4.7835 4.7835 0 0 0-2.7944 4.2153 3.9383 3.9383 0 0 0 2.8184 3.8364q2.8169 1.1367 9.7803 1.1367 9.6621 0 14.588 3.2681 4.9255 3.2681 4.9258 9.7095a11.509 11.509 0 0 1-4.9971 9.52q-4.9973 3.7888-12.954 3.7891a41.784 41.784 0 0 1-11.675-1.6812 40.763 40.763 0 0 1-10.633-4.7602z"/><path class="b" transform="translate(-1.5394)" d="m539.6 323.24v-34.812h-17.051v-5.6362h40.448v5.6362h-17.098v34.812h-6.2993z"/><path class="b" transform="translate(-1.5394)" d="m576.06 331.48a38.394 38.394 0 0 0 2.4629-4.1206 27.126 27.126 0 0 0 1.7051-4.1206h-0.37891a3.0036 3.0036 0 0 1-2.4394-1.208 4.718 4.718 0 0 1-0.9707-3.0547 4.8304 4.8304 0 0 1 1.1602-3.3389 3.7377 3.7377 0 0 1 2.9131-1.3027 3.7862 3.7862 0 0 1 3.2207 1.7285 7.8996 7.8996 0 0 1 1.2314 4.6655 11.548 11.548 0 0 1-1.7998 5.7075 34.646 34.646 0 0 1-5.352 6.7017z"/><path class="b" transform="translate(-1.5394)" d="m639.67 323.24v-40.448h5.2573l16.577 23.682 16.577-23.682h5.2573v40.448h-6.2993v-29.081l-15.535 22.498-15.488-22.498v29.081h-6.3466z"/><path class="b" transform="translate(-1.5394)" d="m720.37 324.52q-10.799 0-17.761-6.1099a20.39 20.39 0 0 1-0.02393-30.668q6.9382-6.0381 17.785-6.0386 10.941 0 17.88 6.0151a20.442 20.442 0 0 1-0.02393 30.715q-6.9624 6.0872-17.856 6.0864zm0-5.9204q8.0991 0 13.214-4.3809a14.671 14.671 0 0 0-0.02393-22.285q-5.1394-4.4048-13.19-4.4048-8.0522 0-13.144 4.3809a14.764 14.764 0 0 0 0 22.309q5.0911 4.3814 13.144 4.3809z"/><path class="b" transform="translate(-1.5394)" d="m775.46 282.79q9.8987 0 15.961 5.6602 6.0623 5.6602 6.0625 14.706 0 9.1414-5.9438 14.611-5.9451 5.4712-16.08 5.4707h-17.951v-40.448h17.951zm0.09473 5.8257h-11.699v28.797h11.699q7.199 0 11.32-3.8599 4.1206-3.8599 4.1206-10.491a13.686 13.686 0 0 0-4.2627-10.42q-4.2626-4.0254-11.178-4.0259z"/><path class="b" transform="translate(-1.5394)" d="m809.41 323.24v-40.448h37.938v5.9204h-31.591v10.088h20.745v5.8257h-20.745v12.788h33.344v5.8257h-39.69z"/><path class="b" transform="translate(-1.5394)" d="m866.48 305.57v17.666h-6.3466v-40.354h27.85q6.2044 0 9.7095 2.9839a10.301 10.301 0 0 1 3.5049 8.2886 10.926 10.926 0 0 1-2.7705 7.46 11.756 11.756 0 0 1-7.2231 3.8599l11.225 17.761h-6.8677l-11.462-17.666h-17.619zm0-5.9204h21.503a7.6927 7.6927 0 0 0 4.9966-1.4209 4.9717 4.9717 0 0 0 1.729-4.0732 4.9048 4.9048 0 0 0-1.729-4.0498 7.7901 7.7901 0 0 0-4.9966-1.397h-21.503v10.941z"/><path class="b" transform="translate(-1.5394)" d="m914.65 323.24v-40.448h3.3154l25.718 28.418v-28.418h6.2046v40.448h-3.3154l-25.671-28.323v28.323h-6.252z"/><path class="b" transform="translate(-1.5394)" d="m970.54 331.48a38.394 38.394 0 0 0 2.4629-4.1206 27.126 27.126 0 0 0 1.7051-4.1206h-0.37891a3.0036 3.0036 0 0 1-2.4394-1.208 4.718 4.718 0 0 1-0.9707-3.0547 4.8304 4.8304 0 0 1 1.1602-3.3389 3.7377 3.7377 0 0 1 2.9131-1.3028 3.7862 3.7862 0 0 1 3.2207 1.7285 7.8996 7.8996 0 0 1 1.2314 4.6655 11.548 11.548 0 0 1-1.7998 5.7075 34.646 34.646 0 0 1-5.352 6.7017z"/><path class="b" transform="translate(-1.5394)" d="m1030.7 318.08 3.0786-5.3047a35.512 35.512 0 0 0 9.0938 4.3574 31.144 31.144 0 0 0 9.4253 1.563 15.505 15.505 0 0 0 8.7148-2.2022 6.5827 6.5827 0 0 0 3.3154-5.6602 5.5059 5.5059 0 0 0-3.0312-5.1387q-3.0315-1.6809-9.5674-1.8711-11.036-0.14209-15.156-2.5576-4.1206-2.4155-4.1206-8.0044a9.7851 9.7851 0 0 1 4.523-8.3833q4.5227-3.1728 12.149-3.1733a35.061 35.061 0 0 1 10.112 1.4683 37.803 37.803 0 0 1 9.4492 4.3574l-3.1733 5.2573a31.907 31.907 0 0 0-8.1465-3.9546 27.298 27.298 0 0 0-8.3359-1.3975 14.736 14.736 0 0 0-7.3887 1.6104 4.7835 4.7835 0 0 0-2.7944 4.2153 3.9383 3.9383 0 0 0 2.8184 3.8364q2.8169 1.1367 9.7803 1.1367 9.6621 0 14.588 3.2681 4.9255 3.2681 4.9258 9.7095a11.509 11.509 0 0 1-4.9971 9.52q-4.9973 3.7888-12.954 3.7891a41.784 41.784 0 0 1-11.675-1.6812 40.763 40.763 0 0 1-10.633-4.7602z"/><path class="b" transform="translate(-1.5394)" d="m1084.1 323.24v-40.448h37.938v5.9204h-31.591v10.088h20.745v5.8257h-20.745v12.788h33.344v5.8257h-39.69z"/><path class="b" transform="translate(-1.5394)" d="m1177.6 313.34a22.946 22.946 0 0 1-9.0698 8.312 27.68 27.68 0 0 1-12.765 2.8657q-10.657 0-17.548-6.0386a20.531 20.531 0 0 1 0-30.691q6.8906-6.0857 17.548-6.0864a28.416 28.416 0 0 1 12.03 2.4868 21.89 21.89 0 0 1 8.7148 7.0332l-5.0205 3.5049a16.432 16.432 0 0 0-6.6074-5.3281 21.699 21.699 0 0 0-9.1172-1.8711 18.888 18.888 0 0 0-12.859 4.4287 14.637 14.637 0 0 0 0.02393 22.213 18.906 18.906 0 0 0 12.835 4.4287 20.434 20.434 0 0 0 9.52-2.1314 20.208 20.208 0 0 0 7.2466-6.6309z"/><path class="b" transform="translate(-1.5394)" d="m1190.2 282.89h6.3467v25.908q0 5.8257 2.7471 7.8623 2.7466 2.0369 10.894 2.0366 8.1936 0 10.941-2.0366 2.7466-2.0361 2.7471-7.8623v-25.908h6.2993v27.565q0 7.4363-4.7124 10.751-4.7139 3.3149-15.37 3.3154-10.61 0-15.251-3.2681-4.6421-3.2681-4.6416-10.799v-27.565z"/><path class="b" transform="translate(-1.5394)" d="m1252.4 305.57v17.666h-6.3467v-40.354h27.85q6.2043 0 9.7095 2.9839a10.301 10.301 0 0 1 3.5049 8.2886 10.926 10.926 0 0 1-2.7705 7.46 11.756 11.756 0 0 1-7.2231 3.8599l11.225 17.761h-6.8677l-11.462-17.666h-17.619zm0-5.9204h21.503a7.6927 7.6927 0 0 0 4.9966-1.4209 4.9717 4.9717 0 0 0 1.729-4.0732 4.9048 4.9048 0 0 0-1.729-4.0498 7.7901 7.7901 0 0 0-4.9966-1.397h-21.503v10.941z"/><path class="b" transform="translate(-1.5394)" d="m1300.5 323.24v-40.448h37.938v5.9204h-31.591v10.088h20.745v5.8257h-20.745v12.788h33.344v5.8257h-39.69z"/><path class="b" transform="translate(-1.5394)" d="m1403 323.24h-3.2681l-20.319-40.448h6.7256l15.204 30.265 14.967-30.265h6.9624z"/><path class="b" transform="translate(-1.5394)" d="m1439.6 305.57v17.666h-6.3467v-40.448h29.413q6.252 0 9.7334 2.96a10.32 10.32 0 0 1 3.481 8.3125 10.819 10.819 0 0 1-3.4575 8.2886 12.805 12.805 0 0 1-9.0938 3.2207h-23.729zm0-5.9204h23.066a7.6097 7.6097 0 0 0 4.9492-1.4209 5.6895 5.6895 0 0 0 0.07129-8.0991 7.0721 7.0721 0 0 0-4.7363-1.4209h-23.35v10.941z"/><path class="b" transform="translate(-1.5394)" d="m1486.8 323.24v-40.448h3.3154l25.718 28.418v-28.418h6.2046v40.448h-3.3154l-25.671-28.323v28.323h-6.252z"/><path class="b" transform="translate(-1.5394)" d="m1581.6 323.24v-34.812h-17.051v-5.6362h40.448v5.6362h-17.098v34.812h-6.2993z"/><path class="b" transform="translate(-1.5394)" d="m1613.3 282.89h6.3467v25.908q0 5.8257 2.7471 7.8623 2.7466 2.0369 10.894 2.0366 8.1936 0 10.941-2.0366 2.7466-2.0361 2.7471-7.8623v-25.908h6.2993v27.565q0 7.4363-4.7124 10.751-4.7139 3.3149-15.37 3.3154-10.61 0-15.251-3.2681-4.6421-3.2681-4.6416-10.799v-27.565z"/><path class="b" transform="translate(-1.5394)" d="m1669.2 323.24v-40.448h3.3154l25.718 28.418v-28.418h6.2046v40.448h-3.3154l-25.671-28.323v28.323h-6.252z"/><path class="b" transform="translate(-1.5394)" d="m1720.3 323.24v-40.448h3.3154l25.718 28.418v-28.418h6.2046v40.448h-3.3154l-25.671-28.323v28.323h-6.252z"/><path class="b" transform="translate(-1.5394)" d="m1771.3 323.24v-40.448h37.938v5.9204h-31.591v10.088h20.745v5.8257h-20.745v12.788h33.344v5.8257h-39.69z"/><path class="b" transform="translate(-1.5394)" d="m1822 323.24v-40.448h6.3467v34.623h30.028v5.8257h-36.375z"/><path class="a" transform="translate(-1.5394)" d="m301.28 145.56s6.9396-145.56-153.04-145.56c-141.48 0-145.9 139.63-145.9 139.63s-20.811 160.37 149.16 160.37c163.02 0 149.78-154.44 149.78-154.44zm-197.8-50.863c30.017-18.364 68.366-7.1401 82.735 20.476 2.7233 5.2338 3.0694 13.291 1.3447 18.782-5.9546 18.956-20.014 29.587-39.312 34.103 5.6892-4.8707 10.218-10.394 11.659-18.025a26.402 26.402 0 0 0-4.5425-20.956 26.76 26.76 0 0 0-30.811-9.3892c-11.881 4.5111-18.389 15.354-17.216 28.683 1.0898 12.381 10.484 20.405 28.061 23.453-2.627 1.3904-4.6503 2.4144-6.6299 3.5172a63.918 63.918 0 0 0-20.544 17.868c-1.7839 2.4084-3.0104 2.6024-5.727 0.94116-35.338-21.61-37.609-75.844 0.98226-99.453zm-26.449 133.53c-5.6769 1.441-11.178 3.5742-16.981 5.4775 2.8385-19.151 25.265-36.788 44.23-34.776a48.881 48.881 0 0 0-9.242 25.893c-6.302 1.1606-12.241 1.9414-18.007 3.405zm120.79-186.98c5.6099 0.20612 11.23 0.12091 16.844 0.25378a29.052 29.052 0 0 1 4.1674 0.58069 40.607 40.607 0 0 1-4.2357 5.4332c-2.007 1.8701-4.2745 3.6986-7.1661 0.856-0.6955-0.68372-2.3386-0.52679-3.5487-0.54272-5.5823-0.07336-11.172-0.25177-16.746-0.04132a104.04 104.04 0 0 0-14.425 1.473c-0.89368 0.16046-2.2299 3.1315-1.8191 4.227 0.9693 2.5853 2.3833 5.4363 4.4779 7.0898 7.7403 6.11 15.972 11.596 23.748 17.664 7.556 5.8966 14.589 12.358 18.875 21.253 5.5843 11.59 5.747 23.743 3.3388 35.95-4.0203 20.378-14.333 37.261-31.032 49.524-6.7288 4.941-15.06 7.7451-22.767 11.295-6.778 3.1225-13.755 5.8115-20.549 8.9008-12.249 5.5695-19.133 18.865-17.108 32.688 1.8585 12.685 12.987 23.271 25.735 25.456 15.292 2.6216 31.071-7.3163 34.812-22.86 4.2067-17.478-5.2898-33.083-23.065-37.813-0.78271-0.20831-1.5684-0.40552-3.2012-0.8269 4.7549-2.1245 8.8614-3.6381 12.653-5.7244q9.9213-5.4594 19.481-11.562c1.8742-1.199 2.8868-1.1996 4.4852 0.18225 12.225 10.57 19.518 23.718 21.563 39.839 3.3845 26.684-9.2471 51.198-33.072 63.762-36.86 19.439-81.965-2.6864-90.106-43.552-6.9738-35.003 17.73-66.754 47.462-72.884 12.787-2.6364 24.48-7.9596 33.57-17.807 5.8652-6.3541 8.7084-11.806 9.6772-14.266a39.565 39.565 0 0 0 2.7211-14.469 33.867 33.867 0 0 0-2.9654-12.398c-3.104-7.075-14.995-18.33-17.939-20.704l-28-21.921c-0.98761-0.81256-2.0994-0.75366-4.5079-0.59045-2.8611 0.19391-10.175 0.59888-13.331-0.22815 2.553-1.9321 9.5132-4.7451 12.502-7.007-9.0734-6.1297-19.43-3.9158-28.941-5.7461 2.1992-4.0959 13.081-10.39 19.27-11.091a91.533 91.533 0 0 0-1.6876-10.281c-0.37781-1.3917-1.9312-2.7408-3.2864-3.5355-3.286-1.9267-6.7694-3.5167-10.549-5.4327a21.936 21.936 0 0 1 11.332-3.5055 42.316 42.316 0 0 1 11.348 1.1056c6.7422 1.5405 12.124 0.53491 17.488-4.048-4.222-1.7002-8.4435-3.2535-12.538-5.0907a123.04 123.04 0 0 1-11.779-6.1583c10.622 1.4755 20.896 5.4585 31.757 4.0034q0.1387-0.74048 0.27728-1.4809c-8.1194-1.8899-16.239-3.7798-25.229-5.8724 15.04-1.3769 29.042-1.604 42.301 4.8541 3.731 1.8173 7.6348 3.3215 11.211 5.3972 1.7443 1.0124 2.9186 3.0078 4.3496 4.5594 1.1366 1.2325 2.0495 2.8837 3.446 3.6264 5.3 2.8184 11.134 2.9291 17.078 2.7879 0.04443-0.67694 0.08606-1.3114 0.1308-1.9933 5.9821 1.8693 12.715 8.7679 12.704 13.806-9.6911 0-19.374-0.037-29.056 0.05389-1.0348 0.0097-2.0626 0.76563-3.0936 1.1754 0.97986 0.57067 1.9428 1.5994 2.9423 1.6362z"/><path class="a" transform="translate(-1.5394)" d="m185.32 26.906a1.4806 1.4806 0 0 0-0.18927 2.3686 2.2326 2.2326 0 0 0 3.0724 0.8219c0.9328-0.47052 1.8478-0.97137 2.975-1.5665-0.9079-0.775-1.6362-1.4148-2.3857-2.0324-1.318-1.086-2.411-0.40386-3.4724 0.40833z"/><g transform="translate(293.8 179.57)" stroke-width="1px"><path d="m1566.2-95.856h-1.24c-7.56 0.08-11.84 6.64-11.84 13 0 6.16 3.92 12.32 12.2 12.32h0.56c8.6-0.24 12.36-6.16 12.36-12.24v-0.72c-0.28-6.36-4.84-12.36-12.04-12.36zm-5.52 5.16v14.44h1.8v-12.96h3.4c1.88 0 2.8 1.16 2.8 2.32 0 1.4-1.36 3-3.8 3-0.36 0-0.84-0.08-1.28-0.16l5.44 7.8h2.36l-4.92-6.64c2.4-0.44 4-2.36 4-4.24 0-1.76-1.52-3.56-4.88-3.56zm-3.44 0.28c2.52-2.72 5.16-3.72 8.24-3.72h1.28c5.48 0.24 9.44 5.8 9.44 11.16 0 0.76-0.08 1.64-0.24 2.36-0.84 4.92-5.12 8.36-10.08 8.36-0.12 0-0.36 0.04-0.48 0.04-6.28 0-10.28-5.68-10.28-11.36 0-0.48 0.08-1.12 0.12-1.64 0 0 0.28-3.12 2-5.2z"/></g></svg>
diff --git a/gemfeed/index.gmi b/gemfeed/index.gmi
index b1ab95df..0609cb87 100644
--- a/gemfeed/index.gmi
+++ b/gemfeed/index.gmi
@@ -2,6 +2,7 @@
## To be in the .zone!
+=> ./2025-05-11-f3s-kubernetes-with-freebsd-part-5.gmi 2025-05-11 - f3s: Kubernetes with FreeBSD - Part 5: WireGuard mesh network
=> ./2025-05-02-terminal-multiplexing-with-tmux-fish-edition.gmi 2025-05-02 - Terminal multiplexing with `tmux` - Fish edition
=> ./2025-04-19-when-book-notes.gmi 2025-04-19 - 'When: The Scientific Secrets of Perfect Timing' book notes
=> ./2025-04-05-f3s-kubernetes-with-freebsd-part-4.gmi 2025-04-05 - f3s: Kubernetes with FreeBSD - Part 4: Rocky Linux Bhyve VMs