Zima: a FreeBSD router built around FIBs and epair route leaks
Disclosure: Drafted with AI assistance from the system’s configuration files and command output, then reviewed and edited.
zima.netcrave.local is my FreeBSD router. It runs FreeBSD 15.0-RELEASE-p11 on ZFS and does a lot more than move packets between a LAN and the internet: it segments the network into dozens of VRF-like domains using FIBs (routing tables), trunks them over a LACP bond and VLANs, “leaks” routes between domains with epair interfaces into a central core FIB, runs PF for NAT/filtering, carries native-ish IPv6 transit through a Hurricane Electric gif tunnel, and hosts a set of Bastille jails for infrastructure services: three tiers of unbound DNS with internal PowerDNS split-horizon zones, a GPS-backed NTP hierarchy (gpsd → host chronyd → ntpint → the other segments), a paired Squid proxy that clients discover via WPAD, a Tailscale node, and the per-segment service jails that hand out DHCP, router advertisements, and DNS forwarders.
This post is a walkthrough of the live configuration I explored on the box: /etc/rc.conf, /boot/loader.conf, /etc/sysctl.conf, /etc/pf.conf, /dump_routes and /restore_routes for the persisted routing tables, /usr/local/etc/chrony.conf, interfaces and routing tables (ifconfig, netstat -rn across FIBs), jls, Bastille jail configs, running services, and the running config of the Cisco SG300-10FP switch on the other end of the LACP trunk.
System basics
- Host:
zima.netcrave.local - OS:
FreeBSD 15.0-RELEASE-p11 amd64(GENERIC) - Forwarding:
net.inet.ip.forwarding=1,net.inet6.ip6.forwarding=1 - FIBs:
net.fibs=1024,net.add_addr_allfibs=0 - Storage: ZFS (
zroot, EFI boot),vfs.zfs.vdev.min_auto_ashift=12 - Key services:
sshd,pf,lldpd,gpsd(GPS on/dev/ttyU0) + hostchronyd(SHM refclock, serves FIB 123),ctld(fib 16),bastille;tailscaledis enabled on fib 255 but the running instance is thezimatsjail on fib 56
Boot and sysctl knobs
/boot/loader.conf sets up the routing and timer behavior the design relies on:
net.fibs=1024
kern.hz=100
boot_verbose=YES
kern.sched.preemption=0
kern.eventtimer.periodic=1
zfs_load=YES
efi_max_resolution="1920x1080"
kern.vt.fb.default_mode="1920x1080"
net.inet.tcp.bind_all_fibs=0
net.inet.udp.bind_all_fibs=0
net.inet.raw.bind_all_fibs=0
/etc/sysctl.conf keeps process visibility tight and leaves add_addr_allfibs alone (it’s already 0):
security.bsd.see_other_uids=0
security.bsd.see_jail_proc=0
security.bsd.unprivileged_read_msgbuf=0
security.bsd.unprivileged_proc_debug=0
vfs.zfs.vdev.min_auto_ashift=12
# net.add_addr_allfibs=0 # already is 0
net.inet6.ip6.source_address_validation=0
net.inet6.icmp6.nd6_debug=1
net.inet.icmp.log_redirect=1
Topology at a glance
The physical/underlay picture is: two Realtek NICs bonded with LACP, a Wi-Fi STA interface used as the current IPv4 WAN, and a Hurricane Electric IPv6-in-IPv4 tunnel riding over that WAN FIB.
graph TD classDef uplink fill:#eeeeee,stroke:#333333,stroke-width:1px; classDef core fill:#dddddd,stroke:#333333,stroke-width:1px; subgraph uplinks [Uplinks] WIFI["wlan255 SSID redacted 192.168.1.156/24 fib 255 WAN"] HE[gif48 2001:470:a:56f::2/128 fib 48 tunnelfib 255 HE tunnel] end subgraph trunk [LACP trunk MTU 9000] RE0[re0] RE1[re1] LAGG[lagg0 LACP] RE0 --> LAGG RE1 --> LAGG end subgraph segments [VLANs / bridges / segments] V16[lagg0.16 + bridge16 metal fib 16] V18[lagg0.18 + bridge18 intranet fib 18] V20[lagg0.20 + bridge20 wifi_pri fib 20] V25[lagg0.25 + bridge25 lan fib 25] V30[lagg0.30 + bridge30 live fib 30] V53[lagg0.53 unbound fib 53] V80[lagg0.80 epair80a squid_egr fib 80] V123[lagg0.123 epair123a ntp fib 123] V255[lagg0.255 + epair255a can fib 255] end LAGG --> V16 LAGG --> V18 LAGG --> V20 LAGG --> V25 LAGG --> V30 LAGG --> V53 LAGG --> V80 LAGG --> V123 LAGG --> V255 WIFI --> HE V255 -. uplink path / NAT .-> WIFI class WIFI,HE uplink; class LAGG core;
(That’s a representative slice — the full FIB map is in the table below, including several intentionally unassigned VRFs.)
The switch: Cisco SG300-10FP
The LACP trunk on zima terminates on a Cisco SG300-10FP (hostname switchb572de, firmware v1.4.11.5 / R800_NIK_1_4_220_026, CLI v1.0) — a 10-port gigabit PoE switch. It’s the access layer that breaks the VLANs out to the desk, the APs, and a couple of upstream boxes, and it’s itself a good citizen of the FIB design: it has a management IP in FIB 0 and sends its own syslog, NTP, DNS, and RADIUS traffic to the same VIPs the jails use.
Secrets from the running config (SSH/HTTPS private keys, the encrypted local username password, the RADIUS shared key, and the SNMP community) are redacted below; everything else is functional configuration.
Global features
The switch is configured to carry the same jumbo frames and fast failure detection as the router:
config-file-header
switchb572de
v1.4.11.5 / R800_NIK_1_4_220_026
CLI v1.0
set system
file SSD indicator plaintext
spanning-tree loopback-guard
port jumbo-frame
bridge multicast filtering
voice vlan id 31
voice vlan state disabled
voice vlan oui-table add 0001e3 Siemens_AG_phone________
voice vlan oui-table add 00036b Cisco_phone_____________
voice vlan oui-table add 00096e Avaya___________________
voice vlan oui-table add 000fe2 H3C_Aolynk______________
voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone
voice vlan oui-table add 00d01e Pingtel_phone___________
voice vlan oui-table add 00e075 Polycom/Veritel_phone___
voice vlan oui-table add 00e0bb 3Com_phone______________
port-channel load-balance src-dst-mac-ip
loopback-detection enable
errdisable recovery interval 3600
errdisable recovery cause loopback-detection
errdisable recovery cause stp-loopback-guard
no eee enable
hostname switchb572de
radius-server host 10.27.255.0
radius-server host fd00:27::1812
logging host fd00:22::514 severity debugging
no logging buffered
logging origin-id ipv6
no logging file
logging aggregation aging-time 15
logging source-interface vlan 1
logging source-interface-ipv6 vlan 1
ip http authentication aaa login-authentication https local radius
power inline traps enable
snmp-server server
snmp-server location upstairs
snmp-server contact paige@paige.bio
snmp-server community <redacted> ro 10.0.0.1 view Default
ip http timeout-policy 0
clock timezone " " 0 minutes 0
sntp anycast client enable both
sntp broadcast client enable both
clock source sntp
sntp unicast client enable
sntp unicast client poll
sntp server 10.123.255.0 poll
sntp server fd00:123::123 poll
sntp source-interface vlan 1
sntp source-interface-ipv6 vlan 1
ip domain name netcravel.local
ip name-server fd00:53::53
no service cpu-utilization
no security-suite deny syn-fin
security-suite syn protection mode disabled
macro auto disabled
port jumbo-frame matches mtu 9000 on re0/re1/lagg0. Spanning-tree loopback guard plus loopback-detection with errdisable recovery (one hour, for both loopback-detection and STP loopback) means a loop on an access port is shut down and auto-restored rather than taking down the segment. EEE (Energy Efficient Ethernet) is disabled globally and again on the two chatty ports (gi7, gi9), and PoE traps are enabled for the powered ports.
A few global knobs are worth calling out on their own:
- Voice VLAN 31 has a full OUI table (Siemens, Cisco, Avaya, H3C, Philips/NEC, Pingtel, Polycom, 3Com) configured but
voice vlan state disabled— the OUI recognition is there if it’s ever turned on. - HTTP/HTTPS management uses AAA
login-authenticationviahttps, falling back from RADIUS to the local user; the session timeout policy is0. - ** Logging** goes only to the remote syslog host (
fd00:22::514, severitydebugging) with IPv6 origin ID and VLAN 1 as source; local buffered and file logging are both off, and aggregation is batched with a 15-second aging timer. - Clock:
clock source sntp, UTC (0 minutes 0), with anycast, broadcast, and unicast SNTP clients all enabled, and both v4/v6 source interfaces. - Security suite:
service cpu-utilizationis off,deny syn-finis off, and SYN protection is disabled — this switch is inside the trusted side of the router’s PF.
VLANs
The VLAN database mirrors the router’s FIB map — the switch carries every VLAN the router trunks, plus a few the router doesn’t assign a FIB to:
vlan database
vlan 16-18,20-34,48,52-54,56,80-81,123,128,180-181,255
exit
The full set of named SVIs, which mirrors the router’s *_vrf purposes:
interface vlan 16
name "Physical Server Network"
interface vlan 17
name "Public bare-metal Servers"
interface vlan 18
name "Private Service Network"
bridge multicast forbidden forward-all add gi7
interface vlan 20
name "Trusted Wireless"
bridge multicast forbidden forward-all add gi7
interface vlan 21
name "Untrusted Wireless (IPv6 Only)"
interface vlan 22
name "Centralized Logging"
interface vlan 23
name Unassigned
interface vlan 25
name "Trusted Wired LAN"
bridge multicast forbidden forward-all add gi7
interface vlan 26
name "Internal SMTP"
interface vlan 27
name Auth/Accounting
interface vlan 28
name "Directory Services"
bridge multicast forbidden forward-all add gi7
interface vlan 29
name "Authentication (KDC)"
interface vlan 30
name "Production Services"
bridge multicast forbidden forward-all add gi7
interface vlan 31
name "Voice over IP"
interface vlan 32
name "Public SMTP"
interface vlan 33
name Fileservers
interface vlan 48
name "IPv6 Tunnel (Hurricane Electric)"
interface vlan 52
name "External Authoritative DNS"
interface vlan 53
name "Recursive DNS"
interface vlan 54
name "Internal PowerDNS"
interface vlan 56
name "Upstream VPS"
interface vlan 80
name "Outbound Proxy (Peer)"
interface vlan 81
name "Inbound Proxy (Filtering)"
interface vlan 123
name "Time Synchronization"
interface vlan 128
name Tailscale
interface vlan 180
name "External Load Balancing"
interface vlan 181
name "Internal Load Balancing"
interface vlan 255
name "Control/WAN/Access Network"
A few divergence points from the router’s map:
- VLAN 33 is named Fileservers on the switch, but FIB 33 is an unused VRF in
rc.conf. - VLAN 128 is named Tailscale on the switch, while the router’s
rc.confcalls FIB 128 unused and puts Tailscale on FIB 56; the switch also names VLAN 56 “Upstream VPS”. - VLAN 31 (
voip_vrf) exists with a voice VLAN OUI table butvoice vlan state disabled. - VLAN 23/24 exist on the switch but are unused on the router; the switch’s VLAN 24 is one of the ranges carried in
Po1.
VLAN 1 is the management VLAN:
interface vlan 1
ip address 10.0.0.2 255.255.254.0
ipv6 address fd00:0:8000::2/64
That’s the .2/::2 counterpart to bridge0’s 10.0.0.1 and fd00:0:8000:: on the router. The switch reaches the router as its default gateway over both families:
ip default-gateway 10.0.0.1
ipv6 neighbor fd00:0:8000::ffff vlan1 58:9c:fc:10:63:54
ipv6 default-gateway fd00:0:8000::ffff
Note the IPv6 default gateway is fd00:0:8000::ffff — the alias on the router’s management bridge — pinned with a static neighbor entry to bridge0’s MAC.
Ports and port-channels
The ten physical ports and two LAGs:
| gi1 | Zima LAGG member 1 | LACP (channel-group 1) | trunk (see Po1) |
| gi2 | Zima LAGG member 2 | LACP (channel-group 1) | trunk (see Po1) |
| gi3 | AP315 | trunk | add 255 (native 1) |
| gi4 | Supermicro IPMI | access | native (1) |
| gi5 | Aruba LAGG member 1 | LACP (channel-group 2), preferred master | trunk (see Po2) |
| gi6 | Aruba LAGG member 2 | LACP (channel-group 2), PoE priority high | trunk (see Po2) |
| gi7 | Wave | trunk, EEE off, green-ethernet off | native 16, add 18,255 |
| gi8 | Desktop/LAN | trunk, default-vlan tagged | native 25, add 16-18,30 |
| gi9 | Slammer | trunk, EEE off, green-ethernet off | native 17, add 30 |
| gi10 | (speed 100) | access, 100 Mbps | native 25 |
| Po1 | Zima (LACP, flowcontrol auto, loopback-detect) | trunk | 16-18,20-34,48,52-54,56,80-81,123,128,180-181,255 |
| Po2 | Aruba | trunk | 20-21,255 |
| No matching rows. | |||
The two upstream LAGs are the important ones. Po1 is the trunk to zima’s lagg0; Po2 is the trunk to an Aruba wireless controller:
interface gigabitethernet1
description "Zima LAGG member 1"
channel-group 1 mode auto
interface gigabitethernet2
description "Zima LAGG member 2"
channel-group 1 mode auto
interface Port-channel1
flowcontrol auto
loopback-detection enable
description Zima
switchport trunk allowed vlan add 16-18,20-34,48,52-54,56,80-81,123
switchport trunk allowed vlan add 128,180-181,255
interface Port-channel2
description Aruba
switchport trunk allowed vlan add 20-21,255
Po1’s allowed list is essentially the whole VLAN database — every FIB-carrying VLAN plus the unused ones. Note the router’s lagg0 has no IP of its own; the VLAN 1 SVI on the switch is the L3 management endpoint on that trunk.
A few access ports are worth calling out:
interface gigabitethernet7
no eee enable
description Wave
switchport trunk allowed vlan add 18,255
switchport trunk native vlan 16
no eee lldp enable
no green-ethernet energy-detect
interface gigabitethernet8
description Desktop/LAN
switchport trunk allowed vlan add 16-18,30
switchport trunk native vlan 25
switchport default-vlan tagged
interface gigabitethernet9
no eee enable
description Slammer
switchport trunk allowed vlan add 30
switchport trunk native vlan 17
interface gigabitethernet10
speed 100
switchport trunk native vlan 25
gi8 is the desktop port — native VLAN 25 (LAN) with the FIB 16/17/18/30 VLANs tagged, which is why my desktop can reach metal, intranet, and live directly. gi7 (“Wave”) carries the metal VLAN untagged plus the intranet and can VLANs tagged. gi9 (“Slammer”) is a trunk with native VLAN 17 (metalpub) and VLAN 30 tagged. gi10 is hard-coded to 100 Mbps.
Multicast filtering
Both snooping protocols are on globally, and then every VLAN gets explicit per-VLAN enablement plus immediate-leave. The pattern, repeated for VLANs 1, 16-34, 48, 52-54, 56, 80-81, 123, 128, 180-181, and 255:
ip igmp snooping
ipv6 mld snooping
ip igmp snooping vlan 1
ip igmp snooping vlan 1 immediate-leave
ipv6 mld snooping vlan 1
ipv6 mld snooping vlan 1 immediate-leave
ip igmp snooping vlan 16
ip igmp snooping vlan 16 immediate-leave
ipv6 mld snooping vlan 16
ipv6 mld snooping vlan 16 immediate-leave
... (one igmp pair + one mld pair per VLAN)
ip igmp snooping vlan 255
ip igmp snooping vlan 255 immediate-leave
ipv6 mld snooping vlan 255
ipv6 mld snooping vlan 255 immediate-leave
immediate-leave means the switch stops forwarding a multicast group the moment the last member on a port leaves, instead of waiting for a query timeout — important on segments with short-lived multicast clients. Separately, five VLANs mark gi7 as forbidden for bridge multicast forbidden forward-all: 18, 20, 25, 28, and 30 (visible in the VLAN blocks above). That keeps multicast from those segments from flooding the Wave port.
Services pointing back at zima
The switch’s own housekeeping traffic is aimed at the router’s VIPs, which is a nice confirmation that the VIP scheme works for non-jail clients too:
radius-server host 10.27.255.0
radius-server host fd00:27::1812
logging host fd00:22::514 severity debugging
logging origin-id ipv6
logging source-interface vlan 1
sntp server 10.123.255.0 poll
sntp server fd00:123::123 poll
sntp source-interface vlan 1
ip domain name netcravel.local
ip name-server fd00:53::53
- RADIUS at
10.27.255.0/fd00:27::1812— FIB 27 (radius_vrf), used withip http authentication aaa login-authentication https local radiusand a local privilege-15 fallback user. - Syslog to
fd00:22::514— the syslog VIP, with IPv6 as the origin ID and VLAN 1 as the source. - NTP from
10.123.255.0/fd00:123::123— thentpintVIP, via both unicast and anycast/broadcast SNTP clients withclock source sntp. - DNS to
fd00:53::53—unboundint, with domainnetcravel.local.
SNMP is enabled (location “upstairs”, contact paige@paige.bio) with a community restricted to 10.0.0.1, login and exec banners warn “Unauthorized access prohibited”, and a loopback interface holds 100.127.255.255/32 (a stable CGNAT-space router ID).
graph TD
Z[zima lagg0
re0 + re1
MTU 9000]
subgraph sw [switchb572de - Cisco SG300-10FP]
direction TB
MGMT[mgmt SVI vlan 1
10.0.0.2 fd00:0:8000::2]
subgraph po1 [Po1 - LACP to zima]
GI1[gi1 Zima LAGG member 1]
GI2[gi2 Zima LAGG member 2]
end
subgraph po2 [Po2 - LACP to Aruba]
GI5[gi5 Aruba LAGG member 1
preferred master]
GI6[gi6 Aruba LAGG member 2
PoE priority high]
end
GI3[gi3 AP315
VLAN 255]
GI4[gi4 Supermicro IPMI
VLAN 1]
GI7[gi7 Wave
native 16 + 18 255
EEE/green off]
GI8[gi8 Desktop
native 25 + 16-18 30
default-vlan tagged]
GI9[gi9 Slammer
native 17 + 30
EEE/green off]
GI10[gi10
100 Mbps native 25]
end
ARUBA[Aruba wireless
VLANs 20 21 255]
IPMI[IPMI out-of-band]
AP[AP315]
WAVE[Wave]
DESK[Desktop]
SLAM[Slammer]
Z ---|"LACP trunk: 16-34 48 52-54 56
80-81 123 128 180-181 255"| po1
po2 ---|"LACP trunk: 20 21 255"| ARUBA
MGMT ---|"default gw 10.0.0.1
fd00:0:8000::ffff"| Z
GI3 --- AP
GI4 --- IPMI
GI7 --- WAVE
GI8 --- DESK
GI9 --- SLAM
VRF/FIB map and addressing scheme
/etc/rc.conf starts with an explicit mapping table. The core idea: FIB 0 is management, FIB 1 is the inter-VRF routing core, and most other FIBs map to a purpose-specific network/VLAN. A few entries (23, 24, 33, 34, 128) are deliberately unassigned, and FIB 17 (metalpub_vrf) shows up in pf.conf and on live interfaces even though it’s missing from the rc.conf comment table.
| 0 | - | mgmt_vrf | Management / physical access |
| 1 | - | core_vrf | Inter-VRF routing core |
| 16 | 16 | metal_vrf | Physical server network |
| 17 | 17 | metalpub_vrf | Public bare-metal servers (pf.conf / live interfaces) |
| 18 | 18 | intranet_vrf | Private service network |
| 20 | 20 | wifi_pri_vrf | Trusted wireless |
| 21 | 21 | wifi_pub_vrf | Untrusted wireless (IPv6-focused in places) |
| 22 | 22 | syslog_vrf | Centralized logging |
| 23 | 23 | unused_vrf | Unassigned |
| 24 | 24 | unused_vrf | Unassigned |
| 25 | 25 | lan_vrf | Trusted wired LAN |
| 26 | 26 | smtp_int_vrf | Internal SMTP |
| 27 | 27 | radius_vrf | Auth/accounting |
| 28 | 28 | ldap_vrf | Directory services |
| 29 | 29 | kerberos_vrf | Authentication (KDC) |
| 30 | 30 | live_vrf | Production services |
| 31 | 31 | voip_vrf | Voice over IP |
| 32 | 32 | smtp_ext_vrf | Public SMTP |
| 33 | 33 | unused_vrf | Unassigned |
| 34 | 34 | unused_vrf | Unassigned |
| 48 | 48 | he_vrf | IPv6 tunnel (Hurricane Electric) |
| 52 | 52 | dns_ext_vrf | External authoritative DNS |
| 53 | 53 | unbound_vrf | Recursive DNS |
| 54 | 54 | dns_int_vrf | Internal PowerDNS |
| 56 | 56 | tailscale_vrf | Upstream VPS / zimats Tailscale jail |
| 80 | 80 | squid_egr_vrf | Outbound proxy |
| 81 | 81 | squid_ing_vrf | Inbound/filtering proxy |
| 123 | 123 | ntp_vrf | Time synchronization |
| 128 | 128 | unused_vrf | Unassigned |
| 180 | 180 | haproxy_ext_vrf | External load balancing |
| 181 | 181 | haproxy_int_vrf | Internal load balancing |
| 255 | 255 | can_vrf | Control/WAN/access network |
| No matching rows. | |||
The config also documents a consistent addressing plan:
- IPv4 (
10.0.0.0/8): per-VRF/16; first/17for VLAN/DHCP space, second/17for VIPs (VIPs carved as/31pairs: host/VIP on the low address, peer/hop on the high address). - IPv6 ULA (
fd00::/): per-VRF/32; VIPs in the first/33, VLAN/DHCP addressing in the last/33(noted as inverted relative to IPv4 by preference). - IPv6 GUA (Hurricane Electric): delegated space routed into FIB 1 and further segmented (e.g.
/80slices such as2001:470:b:56f:180::/80,...:30::/80,...:80::/80, etc.).
The split is the same idea in both families, just mirrored, with FIB 25 as the concrete example:
graph LR subgraph v4 [IPv4 10.0.0.0/8 - per-VRF /16] V4[10.25.0.0/16 for FIB 25] V4A[10.25.0.0/17 VLAN / DHCP space] V4B[10.25.128.0/17 VIP space: /31 pairs] V4 --> V4A V4 --> V4B end subgraph v6 [IPv6 ULA fd00::/8 - per-VRF /32] V6[fd00:25::/32 for FIB 25] V6A[fd00:25::/33 VIP space] V6B[fd00:25:8000::/33 VLAN / DHCP space] V6 --> V6A V6 --> V6B end subgraph gua [IPv6 GUA from HE] GA[HE delegated /64 and /48 routed to FIB 1] GB[Per-VRF /80 slices 2001:470:b:56f:30::/80 2001:470:b:56f:80::/80 2001:470:b:56f:180::/80] GA --> GB end
The route-leak pattern: epairs into FIB 1
Instead of a single global routing table, each domain lives in its own FIB and gets selective connectivity by peering with the core FIB through an epair (a virtual Ethernet pair). A typical pair looks like this:
epair1016a:10.1.16.0/31, fib 16, groupmetal_vrf route_leakepair1016b:10.1.16.1/31, fib 1, groupmetal_vrf route_leak
The “a” side belongs to the VRF; the “b” side belongs to the core. Routes installed in each FIB point specific destinations (or defaults, depending on policy) across that /31/link-local peering. This gives explicit, auditable leak points instead of putting everything in one table.
graph LR classDef core fill:#dddddd,stroke:#333333,stroke-width:1px; classDef leak fill:#f4f4f4,stroke:#555555,stroke-width:1px; subgraph fib16 [FIB 16 metal_vrf] BR16[bridge16 10.16.0.1/23 fd00:16:8000::/64] A16[epair1016a 10.1.16.0/31] BR16 --- A16 end subgraph fib1 [FIB 1 core_vrf] B16[epair1016b 10.1.16.1/31] B53[epair1053b 10.1.53.1/31] B255[epair1255b 10.1.255.1/31] CORE[Core routing table] B16 --- CORE B53 --- CORE end subgraph fib53 [FIB 53 unbound_vrf] L53[lagg0.53 10.53.0.1/23] A53[epair1053a 10.1.53.0/31] VIP53[epair53a VIP 10.53.255.1/31] L53 --- A53 L53 --- VIP53 end subgraph fib255 [FIB 255 can_vrf] WAN[wlan255 192.168.1.156/24] end A16 ---|route leak| B16 A53 ---|route leak| B53 CORE -->|default/selected routes| B255 B255 -.-> WAN class CORE core; class A16,B16,A53,B53,B255 leak;
In practice, FIB 1 holds connected routes for all those epair*b interfaces plus static policy routes: it points many per-VRF networks back to the right peer and carries a default route toward 10.1.255.0 via epair1255b (the WAN/CAN path). Per-VRF FIBs then get only the routes they need (e.g. access to syslog, unbound, squid ingress, NTP, specific VIP ranges, or a default route) via their own epair*Xa next hops.
The full mesh — every leak pair, as seen on ifconfig fibs:
| mgmt_vrf | 0 | epair0a | epair0b |
| metal_vrf | 16 | epair1016a | epair1016b |
| metalpub_vrf | 17 | epair1017a | epair1017b |
| intranet_vrf | 18 | epair1018a | epair1018b |
| wifi_pri_vrf | 20 | epair1020a | epair1020b |
| wifi_pub_vrf | 21 | epair1021a | epair1021b |
| syslog_vrf | 22 | epair1022a | epair1022b |
| unused_vrf | 23 | epair1023a | epair1023b |
| unused_vrf | 24 | epair1024a | epair1024b |
| lan_vrf | 25 | epair1025a | epair1025b |
| smtp_int_vrf | 26 | epair1026a | epair1026b |
| radius_vrf | 27 | epair1027a | epair1027b |
| ldap_vrf | 28 | epair1028a | epair1028b |
| kerberos_vrf | 29 | epair1029a | epair1029b |
| live_vrf | 30 | epair1030a | epair1030b |
| voip_vrf | 31 | epair1031a | epair1031b |
| smtp_ext_vrf | 32 | epair1032a | epair1032b |
| unused_vrf | 33 | epair1033a | epair1033b |
| unused_vrf | 34 | epair1034a | epair1034b |
| he_vrf | 48 | epair1048a | epair1048b |
| dns_ext_vrf | 52 | epair1052a | epair1052b |
| unbound_vrf | 53 | epair1053a | epair1053b |
| dns_int_vrf | 54 | epair1054a | epair1054b |
| tailscale_vrf | 56 | epair1056a | epair1056b |
| squid_egr_vrf | 80 | epair1080a | epair1080b |
| squid_ing_vrf | 81 | epair1081a | epair1081b |
| ntp_vrf | 123 | epair1123a | epair1123b |
| unused_vrf | 128 | epair1128a | epair1128b |
| haproxy_ext_vrf | 180 | epair1180a | epair1180b |
| haproxy_int_vrf | 181 | epair1181a | epair1181b |
| can_vrf | 255 | epair1255a | epair1255b |
| No matching rows. | |||
Interface highlights (from ifconfig)
A few concrete examples show the pattern:
- Physical NICs:
re0/re1, the two trunk ports (bothphys_hw), both MTU 9000 in 1000baseT full-duplex active. - LACP trunk:
lagg0withlaggport re0andlaggport re1(active/collecting/distributing), MTU 9000. - Management bridge (FIB 0):
bridge0=10.0.0.1/23+fd00:0:8000::/64(+::ffff/64alias), memberslagg0andepair0a, groupsbridge mgmt_vrf. - Segment bridges: e.g.
bridge16(10.16.0.1/23,fd00:16:8000::/64, memberslagg0.16+epair16a, fib 16), similar for 17/18/20/21/25/30/31 with fib-appropriate members and addresses. - VLAN/service interfaces: many
lagg0.<vlan>interfaces carry the per-VRF subnet directly (e.g.lagg0.22syslog,lagg0.26smtp_int,lagg0.53unbound,lagg0.80/81squid,lagg0.123NTP,lagg0.180/181haproxy,lagg0.255can). - VIP epairs: e.g.
epair53a10.53.255.1/31+fd00:53::/64(unbound VIP, fib 53),epair80asquid egress VIP (also with a GUA/96alias2001:470:b:56f:80::/96),epair180ahaproxy external VIP with2001:470:b:56f:180::/96. - WAN:
wlan255onrtwn0, fib 255,192.168.1.156/24, associated to[redacted SSID]; it’s the only STA interface, VHT mode 11ac on band 149 (5745 MHz), WPA2, and groupscan_vrf wan. - HE tunnel:
gif48tunnel192.168.1.156 -> 216.218.226.238,2001:470:a:56f::2 <-> ::1, fib 48,tunnelfib 255. - Host
lldpd:lldpd_flags="-I re0,re1,lagg0,wlan255 -M 4 -k -c"— the trunk pluswlan255, announce for 4 seconds, KVM, connected clients only.
The IPv6 path from the tunnel in to the segments:
graph LR W[wlan255 192.168.1.156/24 fib 255 IPv4 WAN] T[gif48 2001:470:a:56f::2 fib 48 tunnelfib 255] F48[FIB 48 2000::/3 via 2001:470:a:56f::1] F1[FIB 1 core 2000::/3 via epair1048b] D[Delegated back toward core 2001:470:b:56f::/64 2001:470:e845::/48] S[Per-VRF /80 slices ...:21 ...:30 ...:80 ...:180] W -->|IPv4 transport| T T --> F48 F48 -->|default via epair1048b| F1 F48 --> D --> F1 F1 -->|/80 slices via epair*b| S
Routing snapshots (examples)
On zima, these routing tables aren’t maintained as a separate set of per-route declarations in rc.conf; they’re persisted as flat scripts at the filesystem root: /dump_routes and /restore_routes. The approach is described in Backing up the routing table with netstat –libxo. /dump_routes loops over every FIB present on interfaces, runs netstat -nr -F <fib> --libxo json, and uses jq to turn gateway/blackhole/reject entries into route add lines with the right -fib and -inet/-inet6 family; /restore_routes is the generated result. There’s no rc.local or cron entry — restoring is a manual step, so the running table (including inter-VRF leak/policy routes) is the source of truth and is replayed by hand when needed.
The boot path and the manual replay fit together like this:
graph TD L[loader.conf net.fibs=1024, modules, bind_all_fibs] R[rc.conf interfaces, services, Bastille] I[Interfaces up lagg0, VLANs, bridges, epairs] J[Jails up DNS, NTP, Squid, svc jails, zimats] RR[restore_routes run by hand from filesystem root] T[Live FIB tables leaks + policy routes] L --> R --> I --> J I --> T RR -->|replays route add lines| T T --> J
FIB 0 keeps a small set of specific routes over the mgmt/core leak and reaches selected service ranges/VIPs (e.g. unbound, squid ingress, NTP, tailscale ranges) via epair1000a -> 10.1.0.1. FIB 1 acts as the policy core with a default out epair1255b and return/static routes for many VRFs and GUA prefixes. A few representative per-VRF views:
- FIB 16 (metal): local
10.16.0.0/23onbridge16, default-ish/service access via10.1.16.1(core leak) to syslog, LAN, smtp_int, unbound, tailscale, squid ingress, NTP ranges, etc. - FIB 18 (intranet): local bridge +
epair218a192.0.0.0/31, reaches selected auth/DNS/proxy/NTP ranges via core, and has specific host routes (e.g. syslog VIPfd00:22::514 -> fd00:18:8000::2). - FIB 25 (LAN, my desktop segment): the table is still policy-heavy, but it now has a default route out
epair1025ato10.1.25.1(the core leak peer), persisted in/restore_routes. Alongside that default it keeps the selective reachability this design is about: local10.25.0.0/23onbridge25, the route-leak peer to FIB 1, specific internal/service ranges (e.g. wifi_pri, smtp_int, unbound, squid ingress, NTP VIP ranges via10.1.25.1, plus matching IPv6 service prefixes likefd00:22/26/53/81/123::/33viafe80::1%epair1025a), and a handful of explicit external IPv4 host routes (e.g.131.153.243.91,205.166.94.4,205.166.94.9,209.160.32.186). General web access still goes through the proxy:HTTP_PROXY/HTTPS_PROXY=http://10.81.255.0:3128points at the squid ingress VIP range, and browsers that use WPAD pick up the same setting automatically from the PAC file served by the LAN’s service jail. - FIB 30 (live): local bridge plus
2000::/3default IPv6 viafe80::1%epair1030aand delegated GUA handling (2001:470:b:56f:30::/80routed internally). - FIB 48 (HE):
2000::/3via2001:470:a:56f::1ongif48, with delegated2001:470:b:56f::/64and2001:470:e845::/48routed back toward core.
PF: macros, tables, NAT, and policy
/etc/pf.conf is a short active policy: the <restricted_networks> table, a NAT line on $wan, and the HE-tunnel ICMPv6 rules. The live file also declares a macro for each FIB number and a per-VRF table, but nothing in the ruleset references them, so they’re omitted here. Here is the file:
# FIB / Routing Table Mapping
wan = "wlan255"
mgmt = "lagg0"
he = "gif48"
table <restricted_networks> { 0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 169.254.0.0/16
172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 192.88.99.0/24
192.168.0.0/16 198.18.0.0/15 198.51.100.0/24 203.0.113.0/24
224.0.0.0/4 233.252.0.0/24 240.0.0.0/4 6.0.0.0/8
7.0.0.0/8 11.0.0.0/8 21.0.0.0/8 22.0.0.0/8 26.0.0.0/8
28.0.0.0/8 29.0.0.0/8 30.0.0.0/8 33.0.0.0/8 55.0.0.0/8
214.0.0.0/8 215.0.0.0/8 }
set optimization aggressive
set loginterface $mgmt
set skip on lo
scrub in on { $wan $he } all fragment reassemble
# !!! DO NOT USE ANY FOR SRC IT WONT WORK
# nat on $wan inet from any to !<restricted_networks> -> ($wan)
nat on $wan inet from 10.0.0.0/8 to !<restricted_networks> -> ($wan)
# 1. Global block (The catch-all)
block in on $he inet6 proto ipv6-icmp
block out on $he inet6 proto ipv6-icmp
# 2. Allow your specific exceptions
pass in quick on $he inet6 proto ipv6-icmp icmp6-type { echoreq } \
keep state (max-src-conn 100, max-src-conn-rate 20/5)
pass out quick on $he inet6 proto icmp6 icmp6-type { echoreq } keep state
pass out quick on $he inet6 proto icmp6 icmp6-type { echorep } \
keep state (max-src-states 100, max-src-conn-rate 50/10)
(pfctl state/rules inspection required root, so this is from the configuration file rather than loaded ruleset introspection.)
Bastille jails and service roles
Bastille is enabled with ZFS-backed storage on zroot (/usr/local/bastille, base release 15.0-RELEASE). The host currently has 11 running jails (jls):
| 1 | lansvc | LAN services: Kea DHCPv4/v6, router advertisements, DNS forwarder, WPAD |
| 2 | metalsvc | Bare-metal segment services: Kea DHCPv4/v6, RA, DNS forwarder, WPAD |
| 3 | ntpint | NTP server for internal segments (upstream: host chronyd/GPS) |
| 9 | wifiprisvc | Trusted Wi-Fi services: Kea DHCPv4/v6, RA, DNS forwarder, WPAD |
| 10 | wifipubsvc | Untrusted Wi-Fi: DNS forwarder only (no DHCP/RA/nginx) |
| 24 | squidingr | Squid ingress/filtering proxy (client-facing side) |
| 29 | zimats | Tailscale node (FIB 56, upstream VPS segment) |
| 39 | unboundcan | Unbound resolver: recursive, CAN-facing |
| 40 | unboundhe | Unbound resolver: HE/IPv6-facing |
| 41 | unboundint | Unbound resolver: internal, split-horizon aggregator |
| 42 | squidegr | Squid egress proxy (outbound side) |
| No matching rows. | ||
All 11 are Bastille thin jails sharing a 15.0-RELEASE base on zroot/bastille; the network-facing ones are VNET jails holding the b end of an epair (e.g. epair80b, epair81b, epair56b).
The *svc jails are a repeatable pattern rather than one-off boxes: each is attached to its segment through epair<vlan>b with that VLAN’s .255 address and a ULA address in fd00:<vlan>:8000::/64, with a default route back to the host side. lansvc (10.25.0.255), metalsvc (10.16.0.255), and wifiprisvc (10.20.0.255) each run Kea DHCPv4/DHCPv6 plus its control agent for that subnet, rtadvd for IPv6 SLAAC, lldpd, inetd, and nginx. wifipubsvc (10.21.0.255) is deliberately minimal — just a local DNS forwarder, syslog, and cron, with no DHCP, RA, or web server for the untrusted segment. Every one of them runs local_unbound forwarding to the internal resolver pair at 10.53.255.0 and fd00:53::53.
Using lansvc as the example:
graph LR subgraph host [zima host - FIB 25] VLAN[lagg0.25 10.25.0.1/23 fd00:25:8000::/64] BR[bridge25 members lagg0.25 and epair25a] A[epair25a host side] VLAN --> BR --> A end subgraph jail [lansvc JID 1 - VNET] B[epair25b 10.25.0.255/23 fd00:25:8000::1/64] K[Kea DHCPv4 and DHCPv6 subnet 10.25.0.0/23] RA[rtadvd IPv6 SLAAC] DNS[local_unbound forwards to 10.53.255.0] WP[nginx wpad.dat wpad.netcrave.local] B --- K B --- RA B --- DNS B --- WP end A ---|epair pair| B
zimats is the outlier: a VNET jail on epair56b (10.56.255.0/31, fd00:56::53/64, FIB 56) running tailscaled -port 41641 -tun tailscale0, with its own Tailscale identity at 100.70.163.20 and a MagicDNS address in fd7a:115c:a1e0::/32. The host’s tailscaled is still enabled in rc.conf on FIB 255, but isn’t running — the jail is the live node.
graph TD subgraph clients [Client segments] LAN[FIB 25 LAN / desktop default via 10.1.25.1 + proxy] WIFI[Other allowed VRFs] end subgraph discovery [Proxy discovery] WPAD[nginx wpad.dat on svc jails returns PROXY 10.81.255.0:3128] end subgraph ingress [squidingr JID 24 - FIB 81] INVIP[10.81.255.0:3128 fd00:81::3128] INPOLICY[ACL/filtering never_direct -> peer] end subgraph egress [squidegr JID 42 - FIB 80] EGVIP[fd00:80::3128 peer target] EGOUT[always_direct outbound via core] end subgraph host [zima host] PF[PF + FIB routing] CORE[FIB 1 core leaks] end LAN -->|WPAD lookup| WPAD WIFI -->|WPAD lookup| WPAD WPAD -.->|proxy setting| INVIP LAN -->|"HTTP(S)_PROXY"| INVIP WIFI -->|"HTTP(S)_PROXY"| INVIP INPOLICY -->|cache_peer proxy-only| EGVIP EGVIP --> EGOUT EGOUT --> CORE --> PF
The two Squid jails are VNET jails attached to opposite ends of /31 VIP pairs in separate FIBs: the host owns the epair*a VIP/router side in FIB 80/81, and each jail receives the epair*b side (vnet.interface = epair80b / epair81b in jail.conf). Both run squid_enable=YES, log to syslog (local2), disable caching (cache deny all), and use local unbound forwarders (10.53.255.0, and IPv6 fd00:53::53 on ingress).
Squid ingress: squidingr (FIB 81, client-facing/filtering)
- Jail:
squidingr(JID 24,host.hostname = squidingr,/usr/local/bastille/jails/squidingr/root, VNET onepair81b, FreeBSD 15.0-RELEASE) - In-jail interface/routes (
rc.conf/ observed):epair81b10.81.255.0/31+fd00:81::3128/64; default IPv4 route0.0.0.0/0 -> 10.81.255.1; static IPv6 routefd00::/8 -> fd00:81::(no general IPv6 default inside the jail) - Host-side FIB 81 wiring:
epair1081a10.1.81.0/31(fib 81, route-leak) ↔epair1081b10.1.81.1/31(fib 1),epair81aVIP10.81.255.1/31+fd00:81::/64(fib 81),lagg0.8110.81.0.1/23+fd00:81:8000::/64(fib 81)
Host routing in FIB 81 is intentionally constrained (no general internet default):
| 10.0.0.0/8 | 10.1.81.1 | UGS | epair1081a |
| 10.1.81.0/31 | link#105 | U | epair1081a |
| 10.81.0.0/23 | link#151 | U | lagg0.81 |
| 10.81.255.0/31 | link#107 | U | epair81a |
| fd00::/16 | fe80::1%epair1081a | UGS | epair1081a |
| fd00:81::/64 | link#107 | U | epair81a |
| fd00:81:8000::/64 | link#151 | U | lagg0.81 |
| No matching rows. | |||
Squid policy (/usr/local/etc/squid/squid.conf):
- Listens on
10.81.255.0:3128and[fd00:81::3128]:3128asproxy.sttl.wa.us.netcrave.local cache_peer fd00:80::3128 parent 3128 0 proxy-only no-query no-digest no-delay name=dfl_cache_peernever_direct allow all/always_direct deny all— ingress forwards requests to the egress peer rather than fetching directly- Denies private-to-private traffic where both source and destination are in the configured RFC1918/special-use IPv4 and IPv6 ACL sets
- Allows clients by source VRF/range (ACLs defined for mgmt, metal/pub, intranet, wifi pri/pub v6, syslog, LAN v4/v6, smtp/radius/ldap/kerberos/live/voip/dns/unbound/kamatera, squid ranges, NTP, HAProxy, CAN, etc.)
- Access is scoped by destination/domain and port in most cases: many VRFs are allowed only to curated update domain lists in
/usr/local/etc/squid/acls/*.txt(e.g.debian.txt,ubuntu.txt,freebsd.txt,openbsd.txt,netbsd.txt,arch.txt,npm.txt,pypi.txt,github.txt,github-actions.txt,windows-update.txt, mostly on ports 80/443) - Notable broader allowances:
public_wifi_v6,lan_vrf/lan_vrf_v6,private_wifi_vrf, andinternal_yacy_servers_vip(10.18.2.0/32) on ports 80/443/8090/8443 - Final rule is
http_access deny all
This is why general web access from my desktop on FIB 25 goes through Squid even though the FIB now has a default route: the ingress proxy VIP range is reachable, HTTP_PROXY/HTTPS_PROXY=http://10.81.255.0:3128 hands web traffic to Squid, and browsers with WPAD enabled discover the same proxy automatically from the PAC file served on the segment.
Proxy auto-configuration (WPAD)
The nginx instances in lansvc, metalsvc, and wifiprisvc are all the same small virtual host: port 80, server_name wpad wpad.netcrave.local, root /www, and MIME type application/x-ns-proxy-autoconfig for .dat/.pac/.da files so browsers actually execute the script. /www holds wpad.dat with proxy.pac symlinked to it. The PAC returns DIRECT for plain hostnames, anything under .netcrave.local, and addresses in private/reserved IPv4 ranges; otherwise it returns PROXY 10.81.255.0:3128; DIRECT — the squidingr VIP. That makes the proxy choice automatic for clients on those segments, with the environment-variable setup as the fallback for tools that don’t do WPAD.
Squid egress: squidegr (FIB 80, outbound side)
- Jail:
squidegr(JID 42,host.hostname = squidegr,/usr/local/bastille/jails/squidegr/root, VNET onepair80b, FreeBSD 15.0-RELEASE) - In-jail interface/routes (
rc.conf/ observed):epair80b10.80.255.0/31+fd00:80::3128/64+ alias2001:470:b:56f:80::3128/96; default IPv4 route0.0.0.0/0 -> 10.80.255.1; static IPv6 routesfd00::/8 -> fd00:80::and2000::/3 -> fd00:80:: - Host-side FIB 80 wiring:
epair1080a10.1.80.0/31(fib 80, route-leak) ↔epair1080b10.1.80.1/31(fib 1),epair80aVIP10.80.255.1/31+fd00:80::/64+2001:470:b:56f:80::/96(fib 80),lagg0.8010.80.0.1/23+fd00:80:8000::/64(fib 80)
Host routing in FIB 80 provides outbound reachability and selected service paths:
| default | 10.1.80.1 | UGS | epair1080a |
| 10.22.128.0/17 | 10.1.80.1 | UGS | epair1080a |
| 10.53.128.0/17 | 10.1.80.1 | UGS | epair1080a |
| 10.80.0.0/23 | link#150 | U | lagg0.80 |
| 10.80.255.0/31 | link#103 | U | epair80a |
| 10.81.128.0/17 | 10.1.80.1 | UGS | epair1080a |
| 10.180.128.0/17 | 10.1.80.1 | UGS | epair1080a |
| 2000::/3 | fe80::1%epair1080a | UGS | epair1080a |
| 2001:470:b:56f:80::/96 | link#103 | U | epair80a |
| fd00:22::/32 | fe80::1%epair1080a | UGS | epair1080a |
| fd00:53::53 | fe80::1%epair1080a | UGHS | epair1080a |
| fd00:80::/64 | link#103 | U | epair80a |
| fd00:80:8000::/64 | link#150 | U | lagg0.80 |
| fd00:81::/33 | fe80::1%epair1080a | UGS | epair1080a |
| fd00:180::/33 | fe80::1%epair1080a | UGS | epair1080a |
| No matching rows. | |||
Squid policy (/usr/local/etc/squid/squid.conf):
- Listens on
10.80.255.0:3128and[fd00:80::3128]:3128asproxy-egr.sttl.wa.us.clandestine.network always_direct allow all/never_direct deny all— egress fetches upstream destinations directly (no further parent peer)tcp_outgoing_address 2001:470:b:56f:80::3128pins the outbound IPv6 source address to the delegated egress GUAforwarded_for off,pinger_enable on,cache deny all- Only the ingress proxy is allowed as a client:
ingress_proxy(10.81.255.0) andingress_proxy_v6(fd00:81::3128) - Denies private/special-use source or destination networks (IPv4/IPv6 ACL sets) and ends with
http_access deny all
Taken together, the split is explicit in both routing and Squid policy: squidingr is the constrained, client-facing policy/enforcement point that can only forward to squidegr, while squidegr is the only hop allowed to reach the outside world on behalf of that ingress peer.
DNS: three tiers of unbound
Name resolution is split across three local_unbound jails, each in its own FIB, with forwarders in the service jails:
unboundint(FIB 53, JID 41) is the internal aggregator. It listens on10.53.255.0andfd00:53::53, allows queries from all of10.0.0.0/8,fd00::/16, and the delegated HE GUA/64, and disables caching (rrset-cache-size: 0,msg-cache-size: 0). Its root zone forwards to the other two resolvers (10.255.255.0/fd00:255::53andfd00:48::53), while split-horizon forward zones fornetcrave.local,10.in-addr.arpa,fd00reverse, and both HE reverse ranges go to the internal PowerDNS at10.54.255.0/fd00:54::53.unboundcan(FIB 255, JID 39) is the recursive one: it listens on10.255.255.0andfd00:255::53, accepts queries only fromunboundint’s addresses (plus localhost), and forwards to public resolvers (1.1.1.1, 1.0.0.1, 8.8.8.8, 8.8.4.4, 9.9.9.9, 149.112.112.112).unboundhe(FIB 48, JID 40) is the IPv6/HE-facing one: it listens only onfd00:48::53, accepts queries fromunboundint, forwards to HE’s2001:470:20::2, and pinsoutgoing-interface 2001:470:b:56f:48::53to the delegated GUA.
The *svc jails, both squid jails, and ntpint all run local_unbound forwarding to 10.53.255.0, with fd00:53::53 added where IPv6 is configured, so the path is client → segment forwarder → unboundint → CAN/HE resolvers, with internal names and reverse zones peeled off to PowerDNS.
Time: GPS → gpsd → chronyd → ntpint → segments
Time starts with a USB GPS on /dev/ttyU0. gpsd runs with -n /dev/ttyU0 -F /var/run/gpsd.sock, and host chronyd consumes the shared-memory refclock declared in /usr/local/etc/chrony.conf:
local stratum 10
allow 10.123.255.0/32
bindaddress 10.1.123.0
refclock SHM 0 offset 0.5 refid SHM
local stratum 10 is the fallback if the GPS refclock disappears, and allow 10.123.255.0/32 means the only client is the ntpint jail. The host binds to 10.1.123.0, the FIB 123 side of the epair1123a/epair1123b leak pair.
ntpint (JID 3) runs chronyd -x with server 10.1.123.0 iburst and server fd00:0:: iburst, then serves allow 10.0.0.0/8 and allow fd00::/16. The segments that can actually reach it are the ones with a route to 10.123.128.0/17 (which contains the 10.123.255.0 VIP) — FIBs 16, 17, 18, 20, 25, and 255, plus FIB 56 with a broader 10.123.0.0/16 — or to fd00:123::/33 over IPv6 (FIBs 16, 17, 18, 20, 21, 25, and 255). FIB 21 (public Wi-Fi) only gets the IPv6 side, which fits its IPv6-focused policy.
Both paths, side by side:
graph TD subgraph dns [DNS path] C[Segment clients] LF[Local unbound in svc / squid / ntpint jails] UI[unboundint 10.53.255.0 fib 53] UC[unboundcan 10.255.255.0 fib 255] UH[unboundhe fd00:48::53 fib 48] PD[PowerDNS 10.54.255.0 fib 54] PUB[Public resolvers] HE[HE 2001:470:20::2] C --> LF LF --> UI UI -->|root queries| UC UC --> PUB UI -->|IPv6 root queries| UH UH --> HE UI -->|internal and reverse zones| PD end subgraph clock [Time path] GPS[USB GPS ttyU0] GSD[gpsd] HC[host chronyd 10.1.123.0] NI[ntpint 10.123.255.0 fib 123] SEG[Segments with a route to 10.123.128.0/17] GPS --> GSD GSD -->|SHM refclock| HC HC --> NI NI --> SEG end NI -.->|ntpint also forwards DNS| UI
What I like about this design
The epair route-leak mesh is the backbone of the whole thing: instead of one routing domain with policy bolted on, every segment gets a FIB and a narrow, auditable peer into the core, so ifconfig and netstat -rn -F <fib> show the actual boundaries at all times. Adding a VRF means adding a bridge, two VLANs, a leak pair, and a few entries in the map — the boundary is explicit and the tables can be popped when the segment goes away. The “a” (segment) and “b” (core) sides of each /31 pair make the trust direction obvious, and the core FIB is the only place that trusts connections from a segment.
It’s also very “FreeBSD-native”: LACP lagg, VLANs, bridges, epairs, multiple FIBs, gif(4), PF, ZFS, and Bastille each do one job, and the mesh composes into something that behaves like a small multi-VRF edge/router platform. The service paths are layered the same way: time from GPS→chronyd→ntpint, DNS from clients→unboundint→resolvers, web through WPAD→ingress→egress. Each layer has one job and a narrow, visible boundary.