Keep your WireGuard.Add the second link in ten minutes.
Bramaguard sits between kernel WireGuard and your WAN interfaces. You change one line in wg0.conf, write one small TOML file and start one binary on each side. Nothing about your keys or peers changes.
The binary ships with early access, and the steps below use today's build.
Get the binary
Bramaguard is one static Linux binary (x86_64, ARM, ARM64, MIPS) under 2.5 MB with no dependencies, and the same file runs on the router and on the VPS. Builds go out through early access: request early access and tell us about your links; you get the build, and a setup call where it helps. The Free tier — one device, two links, one ingress relay, no expiry — needs no registration and no key. Already have a VPS running WireGuard? That is the intended start: add the binary next to it, nothing else changes.
install -m 0755 bramaguard /usr/local/bin/bramaguard
bramaguard list-interfaces # shows the WANs it can bind toEvery build is signed with minisign and comes with a checksum file, and the public key is published in more than one place, so you can cross-check it instead of taking one copy on faith.
Point WireGuard at localhost
On the router, the peer’s Endpoint becomes bramaguard on localhost. That is the whole trick: the kernel keeps doing the crypto, bramaguard only decides which WAN each already-encrypted datagram leaves on. On the VPS, wg0 listens on localhost too and bramaguard owns the public port.
# /etc/wireguard/wg0.conf on the router — the only change is the Endpoint
[Interface]
Address = 10.66.0.2/24
PrivateKey = <router key>
MTU = 1420
[Peer]
PublicKey = <server key>
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = 127.0.0.1:59401 # bramaguard, not the server
PersistentKeepalive = 25Give each WAN its own way out
Each WAN needs its own routing table and a rule pointing at it, so a socket bound to that WAN really leaves the box through it. This is the part that bites, because it fails silently: once the tunnel is your default route, the proxy’s own packets try to leave through the tunnel they are supposed to carry. In proxy-only mode — MikroTik, or a router already running mwan3 — the platform owns these rules and you should let it. Everywhere else, do it like this. The snippet reads each interface’s own address and gateway from the box, so the only thing to change is the list of interface names — get them from bramaguard list-interfaces. It prints a line instead of guessing when a link has no address or gateway yet, and the rules are gone at the next reboot until you put them where your distribution keeps them.
# One routing table per WAN, matched on the outgoing interface — the form the design
# calls for, because the proxy binds each socket to its WAN with SO_BINDTODEVICE and an
# oif rule matches exactly that. Adjust only the interface list.
for dev in eth1 starlink0; do # your WANs: bramaguard list-interfaces
t=$(( 100 + $(cat /sys/class/net/$dev/ifindex) ))
gw4=$(ip -4 route show default dev "$dev" | awk '{print $3}' | head -n1)
gw6=$(ip -6 route show default dev "$dev" | awk '{print $3}' | head -n1)
ip rule del oif "$dev" table "$t" 2>/dev/null # re-runnable: drop the old rule first
ip -6 rule del oif "$dev" table "$t" 2>/dev/null
[ -n "$gw4" ] && ip route replace default via "$gw4" dev "$dev" table "$t" \\
&& ip rule add oif "$dev" table "$t" priority "$t"
[ -n "$gw6" ] && ip -6 route replace default via "$gw6" dev "$dev" table "$t" \\
&& ip -6 rule add oif "$dev" table "$t" priority "$t"
done
ip rule show; ip -6 rule show # each WAN should point at its own tableWrite both configs
Not everyone wants a command to write their config, and some boxes are provisioned from a template. Answer five questions in the wizard — which links you have, what matters, what stays in reserve, what traffic, where the server is — and the form fills itself. Every field stays editable and the file under the form updates as you type. Switch it between router and server: both halves of the same network come out of the same answers.
priority: lower is preferred · backup: warm only, promoted when fewer than active_min paths are alive.
# /etc/bramaguard/config.toml
[general]
mode = "mirror"
active_target = 2
active_min = 1
[client]
listen = "127.0.0.1:59401" # point wg0's Endpoint here
server = "vds.example.com:59500"
control_psk = "CHANGE_ME" # shared with the server
[[path]]
iface = "eth1" # fiber
priority = 10
[[path]]
iface = "starlink0" # Starlink
priority = 20
[health]
heartbeat = "1s"
fail_after = 3
recover_after = "30s"
preempt = trueRun both sides
One binary, subcommands, on both ends: the router runs the client role, the VPS runs the server role next to its own kernel WireGuard — the server side is what mirrors downstream and keeps your reserve warm. Both roles install as a systemd unit, and on OpenWrt as a procd service, so they come back after a reboot. You keep your wg0 and start the client next to it. Pointing the router at a plain WireGuard server without bramaguard still works, but degraded — upstream copies only, downstream on whichever link answered last — and the status output says so.
# router — reads /etc/bramaguard/config.toml; BRAMAGUARD_* variables and flags override it
bramaguard client
# VPS — same binary, server role
bramaguard serverWatch it work
Status shows every path with its state, RTT and counters. Pull a cable: the path turns down within milliseconds, the counters on the other paths keep growing and nothing inside the tunnel notices. Reserve links show heartbeats only.
The server side
Any small VPS works. Bramaguard listens on one UDP port for all routers and hands packets to the local kernel WireGuard, which de-duplicates and NATs. Several independent networks can live on one server, each on its own port.
# /etc/bramaguard/config.toml on the VPS
[server]
listen = "[::]:59500" # one UDP port for every client, dual-stack
control_psk = "CHANGE_ME" # the same value as on the routers
[[network]]
name = "home"
wireguard = "127.0.0.1:51820" # the local kernel wg0 listens here
pool = "10.66.0.0/24"Two shapes, both ordinary
Either bramaguard runs beside the WireGuard your VPS already has — nothing about that tunnel changes — or, on a fresh box, both come up together in one compose stack.
What the installer never does
It does not generate keys, edit your firewall, or touch an existing WireGuard config: those are your decisions, and a security product whose installer quietly rewrites security-relevant files is not one you should trust.
What the box has to be
The cheapest tier at any serious hoster is enough — this is a proxy, not a transcoder. Four things decide whether one will do: a public IPv4 address you control, IPv6 available, UDP passed without filtering or shaping, and a location close to you, because the tunnel’s latency floor is the distance to this box. Two more vary by plan and are worth checking before you pay: whether the IPv4 address costs extra, and whether the traffic allowance suits mirroring, which sends your traffic once per active link.
A relay at another hoster
The same binary in its relay role, on a small VPS at a different hoster, gives the tunnel another way into this server: the same packets come in both ways and the first copy wins. A relay holds no keys, so the cheapest plan anywhere will do; what matters is that its network differs from this server’s. How relays help.
# docker-compose.yml on the VPS, beside the WireGuard you already run
services:
bramaguard:
image: <published with the release>
network_mode: host # it needs the real UDP port and the host's wg0
restart: unless-stopped
volumes:
- ./config.toml:/etc/bramaguard/config.toml:ro
command: ["server"]Where the router half runs
The same binary either way; only the packaging differs by box.
OpenWrt
A package in our own feed installs it with a single opkg line. The platform we care most about, and the firmware family the boxes people buy for a second uplink already run: a GL.iNet travel or 5G router is OpenWrt underneath, and a binary of about a megabyte fits one with room to spare.
MikroTik RouterOS
RouterOS keeps WireGuard, bramaguard runs in a container behind a veth pair. Worth checking your model first: it needs the container package and enough storage, and the smallest devices have neither.
A Linux box as the router
Debian, Ubuntu, an x86 appliance: the same install as the server, plus the per-WAN routing above.
Teltonika and other vendor firmware
Where the firmware lets you run a Linux binary, the steps are the same as on any Linux router.
Which WireGuard you point it at
Three layers that stack, and bramaguard is indifferent to all three — it carries ciphertext either way. How they relate.
Plain WireGuard the baseline
Everything on this page assumes it.
AmneziaWG supported
An alternative build rather than an addition, so the install forks early: its own kernel module or userspace build, and awg in place of wg. For you it is one line: flavor = "amneziawg" on the network. With default headers the bytes on the wire are WireGuard’s and nothing changes for us. With the obfuscation on (H1–H4, S1–S4) the packet-type byte and the fields our server reads move, so bramaguard reads the same values from the awg.conf you already have.
Rosenpass beside it nothing needed from us
Two daemons and a preshared key: run Rosenpass next to WireGuard and it refreshes that key with post-quantum algorithms. Two things that are not obvious. It speaks on its own port outside the tunnel, so if the link it uses dies the tunnel keeps running and the key simply stops rotating until the link returns. And with AmneziaWG its built-in integration does not apply, because that calls wg set while the tool is awg — use its --outfile mode and a small script that applies the key instead.