OPNsense Business 26.10 on FreeBSD: A Small VPN, a Large Forwarding Cost

By 1AEO Team ·

Measured software, November 2026: FreeBSD-based OPNsense Business 26.10.0p1, running FreeBSD 15.1-RELEASE-p6 (base/kernel package 26.7.9).

Scope: November 2026; a 16-core x86-64 firewall appliance with approximately 64 GiB RAM and a 10 Gb/s wide area network (WAN) service. Both phases of the main comparison ran on the same boot. Earlier tuning used Business 26.4.1p2 / FreeBSD 14.3-RELEASE-p16. Measurements used ordinary cumulative counters; no new Tor instrumentation. Internet/upstreams, public-relay hosts and Management local area networks (LANs) A/B are anonymous roles.

During a reported Tor-associated traffic flood, the router was receiving about 1.3 million packets/s across its WAN and LAN and tracking about 4.6 million firewall states. Moving the small management virtual private network (VPN) from IPsec to WireGuard and removing its ordinary IPsec policies cut system-plus-interrupt CPU cost per received packet by 51%. The result comes from 28 comparisons: each matches a 30-second router sample before the change with one after it at similar traffic load.

The VPN change cut CPU use. Total busy CPU on the 16-core x86-64 router fell from 79% to 39% while it received about the same number of packets. Both phases used the same boot, kernel and major settings.

More states fixed allocation failures, not CPU stalls. The router had about 64 GiB RAM, with about 43 GiB free initially. We raised the state limit from 6,536,100 to 10,000,000. That stopped new allocation failures.

CPU cost was still lower 12 days later. Saved counters spanning the 12-day follow-up showed an average of about 4,812 core-nanoseconds per received packet, close to the earlier post-migration results.

1. A different forwarding path, at matched load

On the measured FreeBSD 15.1-RELEASE-p6 kernel, ordinary IPsec security policy database (SPD) entries kept IPv4 traffic from using the fast-forward path in that virtual network stack (VNET). Removing those entries let eligible packets use fast forwarding while retaining packet-filter (PF) checks. The counted fast-forward fraction rose from 0% to more than 99%. Pinned input path · PF hooks.

Overlaid IPsec and WireGuard lines compare system-plus-interrupt CPU and physical ingress across two separate 15-minute phases.
Footnote: Each panel overlays IPsec before and WireGuard after on the same scale. CPU is system plus interrupt as a share of 16 cores; ingress counts physical LAN + WAN receive packets once. The 30-second averages use elapsed time within separate 15-minute phases at different clock times. See Table 1 and Technical notes.
Twenty-eight comparisons of 30-second router samples show lower system-plus-interrupt cost after migration; median after/before ratio 0.487.
Footnote: Each row compares a 30-second IPsec router sample with a 30-second WireGuard sample at similar load. Cost is system-plus-interrupt core-nanoseconds per physical ingress packet. The 28 comparisons each use one before and one after sample, without reusing a sample.
Table 1. Two 15-minute phases; 28 before/after sample comparisons.
Measured objectIPsec beforeWireGuard after
Valid 30-second intervals30 of 3030 of 30
Compared samples28 intervals · 14 minutes · 93%28 intervals · 14 minutes · 93%
Busy CPU, entire 16-core x86-64 router79%39%
System CPU / interrupt CPU79% / <1%38% / <1%
User CPU / idle CPU<1% / 21%<1% / 61%
Combined physical ingress, packets/s1,298,6711,296,518
WAN receive / transmit, packets/s646,841 / 651,216649,408 / 646,374
WAN receive / transmit, Mbit/s3,788 / 3,8163,803 / 3,716
WAN mean receive bytes/packet732732
Ending PF state population4,570,0964,617,974
Median interval system + interrupt cost, core-ns / counted ingress packet9,6784,707
New LAN / WAN receive drops13,044 / 7320 / 0
Fast-forwarded share of counted IPv4 forwarding0%>99%
Median matched after/before cost ratioReference0.487 (51% lower)
Matched-ratio middle half / full range—0.485–0.490 / 0.475–0.492
Schematic shows ordinary Internet-to-relay transit and a separate encrypted management VPN. Ordinary IPsec policies prevent the fast-forward path before; after their removal, eligible traffic can use it with PF checks retained.
Footnote: VNET is the virtual network stack; SPD is its IPsec security policy database. PF hooks remain, and packets can fall back from fast forwarding. WireGuard encrypts the management path. Pinned implementation and counter semantics.

2. What helped and what did not

Raising the state limit stopped allocation failures, but the router still stalled. Disabling unneeded pfsync and Hostwatch work cut CPU cost by 6.4% and 1.7% in separate tests. The timeout groups used fewer state-hours per new state, and the no-state rules stopped creating their own states; neither showed a whole-router CPU saving.

Separate earlier comparisons show modest pfsync and Hostwatch CPU-cost reductions and timeout inventory-burden reductions.
Footnote: pfsync and Hostwatch results measure system CPU time per received packet at similar loads. A state-hour means one firewall state retained for one hour. Timeout results divide each group’s state-hours by newly created states; groups contain 5 + 5 and 10 + 10 Tor relays (treatment + control).
Table 2. What each change achieved.
ChangeWhat happenedCPU result
State limit: 6,536,100 → 10,000,000PF memory counter: +159,726 over 255 s before; +0 over 362 s afterAllocation failures stopped; CPU stalls continued. No isolated CPU saving was measured.
State hash: 131,072 → 16,777,216 bucketsVerified after reboot; hash allocation was about 1,281 MiBCPU benefit unknown: reboot and changing load prevented a clean comparison.
Pass logging and local Insight/NetFlowAutomatic pass logging removed; local services stoppedCPU effect was not measured separately. Kernel capture was already inactive.
pfsync, with no identified high-availability (HA) dependency6.4% lower matched system cost; 14 before/after comparisonsReduced CPU cost at comparable load on the earlier kernel.
Hostwatch native disable1.7% lower matched system cost; 28 before/after comparisonsReduced CPU cost at comparable load.
One-hour established-idle timeout10% fewer state-hours per new state in the pilot; 7% in replicationLess state retention per new state, but no measured CPU saving.
Scoped no-state TCP port 443Own-rule states and creations stayed zero; about 1% WAN ingress exposureThe selected rules stopped creating states; no whole-router CPU saving was demonstrated.

3. CPU cost was still lower 12 days later

The first multi-hour averages were near 4,900 core-nanoseconds per received packet. Across the 12-day follow-up, the average was about 4,812.

Receive drops still occurred. During the 12-day follow-up, the counters recorded 109,298 LAN and 1,510,146 WAN receive drops—about 89 per minute combined—and 3 PF state-insert failures. Drops were also recorded before the VPN change and in later follow-ups. These observations do not establish a pre-flood normal rate.

Average CPU cost per received packet and physical ingress are shown for the first hours and the 12-day follow-up after the VPN change.
Footnote: Averages from cumulative counters: the first two spans are consecutive; the longer spans overlap them. CPU cost includes system plus interrupt time per physical ingress packet. The 12-day follow-up uses approximate mixed-collector timing. RX/TX mean receive/transmit.
Table 3. Cumulative averages from the first hours through 12 days. Elapsed time starts with the post-migration benchmark.
Averaging period / elapsed spanReceive drops, LAN / WANBusy CPUCPU cost, core-ns / received packetPhysical ingress packets/sWAN RX / TX Mbit/s
3 h 56 min
about +32 min → +4 h 28 min
1,914 / 9,23232%4,9041,036,7382,848 / 2,810
3 h 5 min
about +4 h 28 min → +7 h 34 min
2,058 / 6,55033%4,8711,076,4292,991 / 2,941
First 7 h 48 min
0 → about +7 h 48 min
5,445 / 17,112≈33%≈4,873≈1,071,831≈2,972 / 2,930
12 days 15 h
12-day follow-up from the post-benchmark start
109,298 / 1,510,146≈22%≈4,812≈716,593≈1,999 / 2,318

Technical notes

Design. Each same-boot phase supplied 31 snapshots and 30 valid 30-second intervals without counter resets. Kernel, state hash, offloads, interrupt moderation and relay trials stayed fixed; pfsync was down and Hostwatch disabled. Rules and WireGuard staging preceded the baseline. The treatment changed VPN transport/routing/policies without reboot or state flush. Post-sampling began about six minutes after intervention (five-minute minimum). An overlapping 20-second observer had unmeasured overhead.

Accounting. Pool kern.cp_time deltas across user, nice, system, interrupt and idle. Count physical LAN + WAN receive packets once per Link row, using actual read durations and skew checks; adding transmit double-counts transit.

ΔT = sum of CPU tick deltas; busy CPU = 100 × (1 − Δidle/ΔT)
f = (Δsystem + Δinterrupt) / ΔT
R = (ΔLAN RX packets + ΔWAN RX packets) / supported seconds
C = 10⁹ × 16 × f / R, in core-ns per counted physical ingress packet

The cost includes all system/interrupt work, not isolated forwarding time or useful delivery. Counted ingress excludes offered packets lost before accounting; PF states need not be unique connections.

Primary matching. Use d(a,b) = |a−b| / ((|a|+|b|)/2), zero for two zeros. Calipers: WAN RX packets/s 5%, TX packets/s 10%, RX bytes/packet 10%, endpoint-mean states 10%, insertions/s 25%. Rank by Σ(d/caliper); greedily select without reuse or CPU outcomes. Gates: ≥24 intervals/phase and ≥15 before/after comparisons. The estimator is median(C_after/C_before); serial spread is not a confidence interval. In timeout/no-state tests, matching on inventory/churn can condition away treatment effects.

Kernel path. With IPv4 forwarding enabled, ip_input attempts ip_tryforward if IPv4 IPsec support is disabled or its IPSEC_CAP_OPERABLE check returns zero. key_havesp_any() tests ordinary SPD count within the VNET, not packet selectors. Fast-forwarded is a subset of forwarded; PF route-to/reply-to can bypass these IP counters.

Collection. Ordinary reads had three-second deadlines and stopped on failure, identity mismatch or excessive lag, without retries. Boundary checks covered VPN/routes; monitored PF failures were memory, state-insert, state-limit and congestion. The benchmark used no tracing or state/socket dumps.

sysctl kern.boottime hw.ncpu kern.cp_time net.pf.states_hashsize kern.osrelease
netstat -ibdnW
pfctl -si
netstat -s -p ip

Cumulative spans. The first two spans had matching boot, configuration hashes and core-version metadata at their endpoints. Longer averages combine collectors and have approximate timing. They show continued low CPU cost, not a new matched VPN effect.

Encryption. WireGuard retained fixed ChaCha20-Poly1305, Curve25519 and Noise, plus a fresh random 256-bit preshared key. The experiment did not isolate cipher performance. Separate maintenance supplied the authentication-validation fix before deployment; use supported releases. Protocol · Security fix.