Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

wireguard-go: add pfSense support for WolfGuard-go - #371

Open
LinuxJedi wants to merge 1 commit into
wolfSSL:masterfrom
LinuxJedi:pfsense-wolfguard
Open

LinuxJedi wants to merge 1 commit into
wolfSSL:masterfrom
LinuxJedi:pfsense-wolfguard

Conversation

@LinuxJedi

@LinuxJedi LinuxJedi commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Description

Adds wireguard-go/pfsense/, which makes it possible to run WolfGuard-go on pfSense and manage it from the pfSense web interface.

  • build-freebsd.sh builds wolfguard-go (wireguard-go 0.0.20250522 with Wireguard-Go-FIPS-wolfCrypt-port.patch) and wolfguard's wg-fips on a FreeBSD host matching the pfSense release. wolfSSL is linked statically, so the binaries only depend on FreeBSD base libraries. The UAPI socket directory is set to /var/run/wolfguard at link time so wg-fips can find it.
  • pkg/pfSense-pkg-wolfGuard is a pfSense package:
    • VPN > wolfGuard: tunnels and peers, with key generation and input validation.
    • Status > wolfGuard: handshake times and transfer counters for each peer.
    • It also adds a service entry and starts the tunnels from an early boot command.
    • It sets kern.ipc.maxsockbuf and keeps assigned tunnels at the tunnel MTU.
    • pkg/make-pkg.sh builds the package with pkg create, without needing the pfSense ports tree.
  • README.md covers building, installing and configuring, with an example Linux kernel peer. It also documents the pfSense problems found while bringing this up:
    • Tunnel interfaces must be named tun_*, or pfSense halts at boot.
    • wolfguard-go must be started under daemon(8), or it gets terminated shortly after boot.
    • wireguard-go's 7 MiB UDP socket buffer request fails silently under the default kern.ipc.maxsockbuf. That halved throughput from the peer to the LAN.
    • pfSense sets the interface MTU to 1500 unless an MTU is configured.

The parent wireguard-go/README.md now links to the new directory.

Dependency

wg-fips set hangs against wolfguard-go without wolfSSL/wolfGuard#33, so the package can't apply tunnel settings without it. Until #33 is merged, build with WOLFGUARD_REPO=https://github.com/LinuxJedi/wolfguard.git WOLFGUARD_REF=wg-fips-uapi-set-reply, as described in the README. As a safeguard, the package runs wg-fips with a 10 second timeout so a hang can't block the GUI.

Testing

Lab: pfSense CE 2.9.0 (FreeBSD 16.0-CURRENT, 2 vCPU VM on Proxmox), a FreeBSD 16.0-CURRENT build VM, and a Debian 13 peer running the wolfGuard kernel module.

  • Ran build-freebsd.sh (with the Add test for openssh #33 branch) and make-pkg.sh from a clean copy of this directory. wireguard-go/device unit tests pass.
  • Package install, removal and reinstall work; tunnel settings survive a reinstall.
  • The tunnel comes back up on its own after a reboot.
  • Traffic passes both ways between a LAN host behind pfSense and the kernel peer. iperf3 measured about 1 Gbit/s in each direction (non-FIPS wolfSSL with --enable-intelasm).
  • GUI pages were rendered and their write paths exercised (add, edit, validation errors, toggle, delete) through pfSense's PHP, not clicked through in a browser.
  • wg-fips show, set, showconf, genkey and genpsk work against wolfguard-go on pfSense.

Not tested: a wolfSSL FIPS bundle build, and IPv6 tunnel addresses and endpoints.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 21:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@LinuxJedi

Copy link
Copy Markdown
Member Author

@claude review

Add wireguard-go/pfsense with everything needed to run WolfGuard-go on
pfSense CE 2.9.0 (FreeBSD 16):

- build-freebsd.sh builds wolfguard-go and wg-fips on a FreeBSD host
  matching the pfSense release, with wolfSSL linked statically.
- pfSense-pkg-wolfGuard adds VPN > wolfGuard and Status > wolfGuard pages
  for tunnels and peers, starts tunnels at boot and sets the system
  tunables wolfguard-go needs. make-pkg.sh builds the package without the
  pfSense ports tree.
- README.md documents the build, install and configuration, and the
  pfSense specific issues found (interface naming, boot start, UDP socket
  buffer limits, MTU).

wg-fips needs the fix from wolfSSL/wolfGuard#33 to configure wolfguard-go;
build-freebsd.sh takes WOLFGUARD_REPO and WOLFGUARD_REF to build from it
until it is merged.

Tested on pfSense CE 2.9.0 against the wolfGuard Linux kernel module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants