Mesh Networking
Overview
Durantic provides mesh networks that connect your machines across different physical locations, data centers, and network environments. Traffic between machines travels over WireGuard, which is encrypted, or over Geneve, which is plaintext and is used only between machines that share a private network path. See Tunnel Types.
Mesh networks let machines communicate as if they were on the same local network, regardless of where they are physically located — behind NAT, in different cloud providers, or in on-premises data centers.
How It Works
Setting up a mesh network follows a straightforward process:
- Create a mesh — Define a new mesh network in the dashboard and assign it a CIDR block (for example,
10.100.0.0/16). - Assign machines — Add machines to the mesh. Each machine automatically receives an IP address from the CIDR block.
- Automatic tunnel setup — The agent on each machine configures its mesh interfaces and establishes tunnels to all other machines in the mesh: WireGuard (encrypted) or Geneve (plaintext, private paths only), according to the machines' tunnel types.
- NAT traversal — The agent handles endpoint discovery and NAT traversal automatically, finding the best path between peers.
No manual WireGuard configuration is required. The control plane distributes peer information and the agents handle all tunnel setup, key exchange, and keepalive management.
Tunnel Types
Tunnel type is set per machine (tunnel_type, on the machine's Network settings). Durantic has two data planes:
- WireGuard — encrypted. Works across NAT and the public internet.
- Geneve — a low-overhead overlay that is plaintext by design. Durantic uses it only between two machines that share a private network path, such as a private LAN or the inside of a datacentre.
| Tunnel type | Meaning |
|---|---|
auto (default) |
Geneve with peers on a shared private path, WireGuard with every other peer. |
wireguard |
WireGuard with every peer. |
geneve |
Geneve where the path to a peer is private, WireGuard otherwise. The control plane serves an explicit geneve machine exactly as auto. |
The tunnel used between two machines is resolved from both machines' settings:
| Machine A | Machine B | Tunnel between them |
|---|---|---|
wireguard |
wireguard or auto |
WireGuard |
auto or geneve |
auto or geneve |
Geneve on a shared private path, WireGuard otherwise |
wireguard |
geneve |
None. This is a configuration mistake (see below). |
A shared private path means that one machine has an interface on a private (RFC 1918 or ULA) subnet that contains the other machine's address. Machines in the same datacentre that sit on different, routed private subnets use WireGuard.
Mesh traffic is encrypted only on WireGuard paths. With auto or geneve, traffic between machines on the same private network travels over Geneve in plaintext. If traffic must be encrypted on every path, set the tunnel type to wireguard.
wireguard + geneve is a mistake. The two machines share no data plane, so they get no tunnel to each other. The control plane still saves the change, but it logs a warning and exports the gauge durantic_mesh_incompatible_tunnel_pairs{reason="incompatible_types"}, which is 0 when the mesh is healthy.
Changing a machine's tunnel type
- Do not change tunnel types in a mesh until every agent in that mesh runs a release with the tunnel-switch fixes.
- A direct
wireguard↔genevechange causes a brief cut on the pairs that switch. The cut is bounded by the time both agents take to apply their new configuration, and it fails closed. To avoid thewireguard+genevemismatch in between, change throughauto:wireguard→auto→geneve. - Existing
genevemachines take one dataplane transition when the control plane is upgraded to the release in whichgenevemeans "Geneve on private paths, WireGuard otherwise". On its first configuration after the upgrade, the agent brings up WireGuard next to Geneve. Peers on a shared private path stay on Geneve. Peers without one, which previously used Geneve over a non-private path, move to WireGuard.
Kubernetes pod traffic (official k3s and RKE2 roles)
The official k3s and RKE2 roles run the pod overlay (Flannel VXLAN; Canal on RKE2) over the mesh interface durantic-wg:
- The pod overlay MTU is 1350 outer (VXLAN) and 1300 for pods.
- On RKE2, Canal is bound to
durantic-wg. - TSO and GSO are turned off on Flannel's VXLAN device.
- Pod traffic is encrypted only on WireGuard paths. Where the mesh hop between two nodes is Geneve, pod traffic is plaintext.
Clusters provisioned before these settings do not pick them up by themselves. Rebuilding each node onto the current roles applies all of them. To update a cluster in place instead:
k3s, per node:
- Add
/etc/rancher/k3s/flannel-net-conf.json(flannel"MTU": 1350,Networkequal to the servers'cluster-cidr) and pointflannel-confat it in/etc/rancher/k3s/config.yaml. On servers, also statecluster-cidr: "10.42.0.0/16". kubectl drain <node> --ignore-daemonsets --delete-emptydir-data.- Run
k3s-killall.sh, thensystemctl start k3s(ork3s-agent), or reboot the node. An MTU-only change does not resize an existingflannel.1, so this step is required. kubectl uncordon <node>.- Delete any non-hostNetwork pod on the node that was created before the change.
- Verify:
kubectl exec <pod> -- cat /sys/class/net/eth0/mtureads1300for a pod on that node, andip link show flannel.1readsmtu 1300.
RKE2:
- On one server, add a
HelmChartConfigforrke2-canalat/var/lib/rancher/rke2/server/manifests/rke2-canal-config.yaml(orkubectl applyit) that setsflannel.iface: durantic-wg,calico.ipAutoDetectionMethod: interface=durantic-wg,flannel.mtu: 1350andcalico.vethuMTU: 1300. RKE2 applies it cluster-wide, and every node's flannel restarts. - Per node:
kubectl drain <node> --ignore-daemonsets --delete-emptydir-data, runrke2-killall.shand reboot, thenkubectl uncordon <node>. Delete any non-hostNetwork pod still created before the change, and verify the pod andflannel.1MTU read1300as for k3s. - Treat the roll as a maintenance window: expect brief pod-traffic drops while each node's flannel restarts.
Both: to turn off TSO/GSO, write /etc/udev/rules.d/90-flannel-vxlan-offload.rules (mode 0644) on each node:
ACTION=="add", SUBSYSTEM=="net", KERNEL=="flannel.[0-9]*|flannel-v6.[0-9]*", ENV{ID_NET_DRIVER}=="vxlan", RUN+="/usr/sbin/ethtool -K %k tso off gso off"
Then run ethtool -K flannel.1 tso off gso off once.
Binding the pod overlay to durantic-wg routes pod traffic into the mesh, but it does not encrypt it by itself. Between nodes whose mesh hop is Geneve (auto or geneve on a private path), pod traffic is plaintext. Set the nodes' tunnel type to wireguard if pod traffic must be encrypted on every path.
IP Allocation
When a machine joins a mesh network, Durantic automatically allocates an IP address from the mesh's CIDR block. You can view a machine's mesh IP on its Network tab.
IP addresses are stable — a machine keeps the same mesh IP as long as it remains in the mesh. If a machine is removed and later re-added, it may receive a different address.
Monitoring Mesh Health
Durantic provides detailed visibility into mesh network status through two tabs on each machine's detail page.
Peers Tab
The Peers tab shows the connectivity status between the current machine and every other machine in the mesh.
For each peer, you can see:
| Field | Description |
|---|---|
| Connectivity status | Whether the peer is reachable |
| Path type | Direct, relayed, or transit |
| Handshake age | Time since the last successful WireGuard handshake |
| BGP state | The BGP session state with this peer (if applicable) |
Each peer row is expandable to reveal detailed metrics including latency, packet loss, and throughput statistics.
Endpoints Tab
The Endpoints tab shows how the machine is discovered by and reachable to other peers.
Endpoint types include:
| Type | Description |
|---|---|
| STUN | Public endpoint discovered via STUN servers |
| Peer-observed | Endpoint as seen by other machines in the mesh |
| Mesh-observed | Endpoint detected through mesh network traffic |
NAT Traversal
The Durantic agent handles NAT traversal automatically so machines behind firewalls and NAT devices can participate in the mesh without manual port forwarding.
The NAT traversal process includes:
- STUN endpoint discovery — The agent queries STUN servers to determine its public IP address and port mapping. STUN probing can be enabled or disabled per machine via the
stun_enabledsetting. - Peer-observed endpoint sharing — Machines share the endpoints they observe for each other through the control plane, enabling connections even when STUN alone is insufficient.
- Adaptive keepalive intervals — The agent adjusts WireGuard keepalive timing based on the NAT type to maintain established connections.
- Gossip protocol — A SWIM-based memberlist protocol propagates endpoint changes, VIP updates, and key rotations quickly across the mesh. Gossip can be enabled or disabled per machine via the
gossip_enabledsetting.
This approach works behind most NAT types, including symmetric NAT in many cases.
Connectors
Connectors are reserved for future mesh participants that are not machines, such as Kubernetes CAPI controllers, CI runners, or external services.
Connectors are not usable yet. A connector is never configured: it has no WireGuard tunnel to the mesh, it receives no configuration, and machines never see it as a peer. It does still take up room in its mesh network: it reserves a mesh IP address, counts toward the network's peer limit, and, if marked as a gateway, counts toward the limit of 8 gateways. Adding, changing or removing a connector also makes the machines in its mesh network refresh their configuration. To connect a workload to the mesh today, run it on a machine.
Gateway Nodes
You can designate machines as gateway nodes to enable routing between different mesh networks. Gateway nodes participate in multiple meshes and route traffic between them using eBGP (External Border Gateway Protocol).
This is useful when you have separate mesh networks for different environments or teams but need controlled connectivity between them.
For details on load balancing and route distribution, see Load Balancing.
Route Reflector Mode
For large mesh networks with 250 or more nodes, direct BGP peering between all machines becomes impractical. In this scenario, you can enable route reflector mode on gateway nodes.
Route reflector nodes act as central BGP route distribution points. Instead of every machine exchanging routes with every other machine, machines exchange routes only with the route reflectors, which then distribute routes to all peers. This reduces the total number of BGP sessions from O(n^2) to O(n) and keeps the mesh performant at scale.



