Define your virtual WireGuard networks in YAML to easily manage peering, subnets, and routing.
If you are unfamiliar with concepts like public keys, endpoints, or AllowedIPs, we highly recommend reading the WG Tutorial first to see how it all works under the hood.
Configuration that applies to the entire network or the Control Plane itself.
2.wg0).version: 2 contact_email: "admin@example.com" interface_name: "wg-corp"
Underlying infrastructure paths (e.g., LAN, WAN). Nodes connect via the highest priority shared path.
IPv6 Support: Physical endpoints fully support IPv6. Define separate IPv4 and IPv6 physical networks to create a prioritized dual-stack mesh.
Supported Properties:
"wan", "office-lan").true to temporarily disable this physical path globally.physical_networks:
- network: "wan-v6"
priority: 10 # Prefer IPv6 if both peers support it
- network: "wan-v4"
priority: 1 # Fallback to IPv4Isolated virtual networks. Shared membership creates automatic peering. Nodes can attach to multiple networks to bridge them.
Note: Virtual internal networks do not currently support IPv6. All virtual addresses must be IPv4.
Supported Properties:
"production").true to temporarily disable this virtual network globally.DNS Automation (See Section 9):
wireguard_networks:
- network: "production"
persistent_keepalive: 25 # (Optional) Default for everyone on this network
dns: ["1.1.1.1"] # (Optional) Default DNS for this network
- network: "management"
mtu: 1280 # (Optional) Default MTU for this networkNodes "attach" to networks. A node can have multiple physical and virtual identities.
51888).address for servers, or a list of networks for roaming nodes. Defaults to ["wan"].network name and a virtual address.nodes:
- name: "gateway"
public_key: "..."
listen_port: 51888
dns: ["8.8.8.8"]
physical:
- network: "wan"
address: "vpn.example.com" # Peer Endpoint
wireguard:
- network: "production"
address: "10.0.1.1" # Virtual IPSettings apply hierarchically, resolving in this order:
nodes[0].wireguard[0]). (Highest priority)Optional top-level security keys:
Authorization: Bearer <token> header for ALL access.admin_tokens: ["secret123"] write_tokens: ["save-only-secret"] write_barrier: 42
Nodes without a static IP can list accessible physical networks instead (e.g., ["office-lan", "wan"]). They will automatically use the best available path.
nodes:
- name: "laptop"
physical: ["office-lan", "wan"] # Roams between LAN and WAN
wireguard:
- network: "production"
address: "10.0.1.50"By default, nodes in the same virtual network form a Full Mesh. You can override this with an explicit peers list to create Hub-and-Spoke or other custom topologies.
name or public_key values to peer with. If omitted, peers with everyone in the network.nodes:
- name: "spoke-node"
wireguard:
- network: "production"
address: "10.0.1.50"
peers: ["hub-router"] # Only peers with the HubThe WG-CP agent can automatically provision a lightweight CoreDNS server to provide seamless name resolution without OS port conflicts.
Configure forwarding, TTL, and custom static records on the virtual network.
wireguard_networks:
- network: "vpn"
upstream_dns: ["1.1.1.1", "1.0.0.1"] # Forward external queries
dns_ttl: 300 # Global TTL
custom_dns:
- name: "printer.vpn"
address: "192.168.1.50" # Infers 'A' record
- name: "mail.vpn"
type: "MX"
value: "10 mail-server.vpn"Flag a node to host the DNS service. Other clients automatically receive DNS = <node-ip> in their configurations.
Redundancy: You can enable host_dns: true on multiple nodes. Clients will receive all of their IPs in their DNS configuration, providing automatic failover.
Physical Binding: By default, DNS binds to virtual networks. You can explicitly bind it to a physical network by providing a list (e.g., host_dns: ["office-lan"]). If you do this, ensure the node's physical IP is stable (static IP or DHCP reservation), or CoreDNS will fail to bind if the IP changes.
nodes:
- name: "gateway-1"
host_dns: true # Binds to all attached virtual networks
wireguard:
- network: "vpn"
address: "10.0.0.1/32"
- name: "gateway-2"
host_dns: ["office-lan"] # Explicit binding to a physical network
physical:
- network: "office-lan"
address: "192.168.1.100" # MUST be a static IP
wireguard:
- network: "vpn"
address: "10.0.0.2/32"