Virtualize Your Network on FreeBSD with VNET
klarasystems.com
klarasystems.com
e.g . one routing table per interface
add rules in global routing table for each new interface that is started:
ip rule add from/to $IP_OF_IFACE/32\
table $UNIQUE_RT_FOR_IFACE
ip route add default via IP_OF_IFACE_GW/32\
dev $IFACE_NAME table $UNIQUE_RT_FOR_IFACE
Then when something changes on the iface that is not defaul; 1. remove old configs for that iface, 2. open a socket on the new ip on that iface to test internet connection. 3. If ok: change default in main routing table to the GW that iface uses.ZFS, Jails, VNET, and the stellar security track record are very enticing. In-kernel wireguard support was the last missing piece for me.
The elegance and simplicity of the BSDs are becoming increasingly apparent in contrast to the Linux world.
As an example, compare the jails UX to say, LXC/LXD…
Sadly, I got all my network appliances setup and configured with Ubuntu 20.04 LTS a month or so before OpenBSD merged their WireGuard kernel module. I'm too lazy to touch those servers given they're relatively low traffic, especially during Pandemic times as I'm always on my local network.
https://vermaden.wordpress.com/2019/06/19/freebsd-enterprise...
... I recently added Jails there with Minio inside in each of those jails to serve S3 storage.
Works like a charm.
That's kind of a pity, because FreeBSD could be an ideal OS to run containers: a stable system with unified APIs, without 1.8e308 different distros, most of them subtly incompatible with each other.
[0] Actually, partial caveat: cbsd and bhyve are at least meant to fill this space, I think, but they're neither a perfect match nor as easy to use IMO.
I could be convinced (well, paid) to make it a higher priority, but ultimately it's currently at the bottom of a barrel of much more enticing fish since I'm not really in the demographic that that kind of stuff targets.