Firewalls behind NAT (management tunnel)
OPNexus must be able to reach a firewall's API. If the firewall has no public address (behind NAT, CGNAT, mobile router), you build a WireGuard hub on the OPNexus server with the management tunnel (System › Management tunnel): the firewall dials in outwards there, and OPNexus reaches its API through the tunnel. Nothing on the firewall has to be reachable from the internet. The tunnel is meant only for management; user traffic does not run through it.
Prerequisites: the hub is an optional container. In .env set COMPOSE_PROFILES=overlay (comma-separated with
several profiles), run docker compose up -d, and the UDP port OVERLAY_PORT (default 51820)
of the server must be reachable from the internet (port forwarding on the router of the OPNexus server). The hub
runs with the backend's image and needs only the NET_ADMIN capability for the WireGuard interface;
the Linux kernel module wireguard must be present on the server (any current kernel).
Setting up: switch it on in the management tunnel, enter the server's public address (DNS name or IP),
save. Then per firewall "Add firewall": OPNexus assigns a tunnel address (e.g.
10.99.0.2) and a pre-shared key and shows instructions with copyable values:
- In OPNsense (VPN › WireGuard) create a local instance, let it generate a key pair, enter the tunnel address.
- Enter the hub as peer (public key, pre-shared key, endpoint, allowed IP
10.99.0.1/32, keepalive 25). - A firewall rule on the WireGuard interface group: TCP from the hub address to "This firewall", port of the web interface (443).
- Enter the new instance's public key under "Key / host" in OPNexus.
- Create the firewall as a host as usual, but with the tunnel address (
https://10.99.0.2). The status in the management tunnel changes to "connected".
From then on everything works as with any other firewall (rules, maintenance, logs, backups, security posture). Certificate pinning also works through the tunnel.
Security: the hub accepts no new connections from the firewalls (iptables INPUT … NEW
dropped), so a compromised remote site reaches neither OPNexus nor other remote sites. The
proxy through which OPNexus reaches the firewalls is reachable only in the Compose network and connects
only into the tunnel network. Keys are stored as files in the volume overlay_state (including the hub's
private key; the full backup contains it). Each firewall has its own
pre-shared key; "Delete" removes it from the hub immediately. Hosts in the tunnel network are addressed only by IP addresses
(no DNS names). Not included: OPNexus does not perform the setup on the firewall
(for a firewall behind NAT it cannot reach it, after all); for a reachable firewall you can
alternatively distribute a tunnel with the same values under VPN › WireGuard.