Skip to content

Configuration

meshguard is configured entirely through CLI flags and environment variables. There is no configuration file.

Config Directory

The default config directory is ~/.config/meshguard/. Override it with the MESHGUARD_CONFIG_DIR environment variable:

bash
export MESHGUARD_CONFIG_DIR=/etc/meshguard
meshguard up --seed 1.2.3.4:51821

Directory Layout

$MESHGUARD_CONFIG_DIR/
├── identity.key           # Ed25519 secret key (permissions: 0600)
├── identity.pub           # Ed25519 public key
└── authorized_keys/       # Trusted peer keys
    ├── peer-a.pub
    └── peer-b.pub

CLI Flags

meshguard up

FlagDefaultDescription
--seed(none)Seed peer address (ip:port). Can be repeated.
--dns(none)Discover seeds via DNS TXT records
--mdnsfalseDiscover seeds via mDNS on LAN
--announce(auto)Manually announce this IP to peers
--kernelfalseUse kernel WireGuard module instead of userspace

meshguard keygen

FlagDefaultDescription
--forcefalseOverwrite existing identity keys

meshguard trust

FlagDefaultDescription
--name(auto)Human-readable name for the peer

Network Defaults

ParameterValueSource
Gossip port51821config.zig
WireGuard port51830config.zig
Mesh prefix10.99.0.0/16wireguard/ip.zig
Interface namemg0wg_config.zig
MTU1420tun.zig
Max peers64device.zig
Suspicion timeout5000 msconfig.zig

SWIM Protocol Defaults

ParameterValueDescription
Protocol period1000 msInterval between SWIM probe rounds
Suspicion timeout5000 msTime before suspected → dead
Max gossip entries8Gossip entries piggybacked per message

WireGuard Transport Defaults

ParameterValueDescription
Rekey after time120 sHandshake renewal interval
Reject after time180 sMaximum key lifetime
Keepalive timeout10 sPassive keepalive interval
Rekey after messages2^60Message count trigger for rekeying
Anti-replay window2048 packetsSliding-window replay protection

STUN Servers

meshguard uses hardcoded STUN servers for public endpoint discovery:

ServerIPPort
stun.l.google.com74.125.250.12919302
stun.cloudflare.com104.18.32.73478

Released under the MIT License.