Skip to content

Configuration

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

Config Directory

meshguard does not read a monolithic configuration file. It uses CLI flags, environment variables, and small files under the config directory. Override the directory with the MESHGUARD_CONFIG_DIR environment variable:

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

Without the override, defaults are platform-specific:

Platform / userDefault
Windows%APPDATA%\meshguard\
POSIX as root/etc/meshguard
POSIX non-root with XDG_CONFIG_HOME$XDG_CONFIG_HOME/meshguard
POSIX non-root fallback~/.config/meshguard

Directory Layout

$MESHGUARD_CONFIG_DIR/
├── identity.key           # Ed25519 secret key (permissions: 0600)
├── identity.pub           # Ed25519 public key
├── node.cert              # Optional org-signed node certificate
├── authorized_keys/       # Trusted peer keys
│   ├── peer-a.pub
│   └── peer-b.pub
├── trusted_orgs/          # Org trust (auto-accept org members)
│   └── eosrio.org
├── org/                   # Org admin keypair, if this node signs certs
│   ├── org.key
│   └── org.pub
├── vouched/               # Org vouches learned or created locally
├── seeds/                 # Saved peer seeds from token-based connect
└── services/              # Service access control (optional)
    ├── default            # Default action: "allow" or "deny"
    ├── global.policy      # Global rules applied to all peers
    ├── peer/              # Per-peer policies (by alias)
    │   └── node-1.policy
    └── org/               # Per-org policies
        └── eosrio.policy

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
--gossip-onlyfalseRun discovery/rendezvous only, without TUN/WG
--no-tunfalseAlias for --gossip-only
--encrypt-workers0Number of encryption threads (0 = serial)
--openfalseAccept all peers (skip trust enforcement)

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 timeout30000 msconfig.zig

SWIM Protocol Defaults

ParameterValueDescription
Protocol period5000 msInterval between SWIM probe rounds
Suspicion timeout30000 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 resolves configured STUN server hostnames at runtime for public endpoint discovery:

ServerPort
stun.l.google.com19302
stun.cloudflare.com3478

The default Config stores these as host:port strings and the runtime STUN client consumes that list. If no configured server can be resolved, meshguard falls back to deterministic IPv4 endpoints for the same services so startup can still proceed in DNS-constrained environments.

Released under the MIT License.