- To add new interface:
wgconfmgr new <IFACE>
- To add new peer:
wgconfmgr new <IFACE> <PEER>
Adding new interface or peer creates required directories and files:
private.key
is automaticaly generated (however it's OK to replace it later)ip.conf
,networks.conf
are created empty and need to be manually populated with desired values
- Interface configuration:
wgconfmgr conf <IFACE>
- Peer configuration:
wgconfmgr conf <IFACE> <PEER>
- All interfaces:
wgconfmgr write-conf
- Specific interface:
wgconfmgr write-conf <IFACE>
Interface configuration is saved to /etc/wireguard/<IFACE>.conf.d/interface.conf
. This can be later copied, renamed or symlinked as /etc/wireguard/<IFACE>.conf
.
wgconfmgr qr <IFACE> <PEER>
Note:
- Peer's
private.key
is required to generate QR code. qrencode
tool is used (see: libqrencode)- UTF-8 enabled terminal is required to display QR code.
Tested with:
wgconfmgr ping
- ping all peers on all interfaceswgconfmgr ping <IFACE>
- ping all peers on specific interfacewgconfmgr ping <IFACE> <PEER>
- ping single peer on specific interface (all addresses)
Interfaces' configuration directories are named /etc/wireguard/<IFACE>.conf.d
.
Private key.
File should be readable only by root.
Public key.
If missing, wg pubkey
command will be used in runtime.
IPv4 or IPv6 addresses. One per line.
IPv4 or IPv6 networks. One per line.
List should include networks matching assigned interfaces and optionally additional networks that should be accessible by peers.
Endpoint hostname or IP address of the server.
Listening port. Defaults to 51820
Firewall mark id. Defaults to 0xca6c
DNS-es to by used by peers. Defaults to 1.1.1.1
and 8.8.8.8
(Cloudflare and Google public nameservers).
Optional entries to be concatenated into interface configuration file.
Example:
SaveConfig = false
Peers' configuration directories are named /etc/wireguard/<IFACE>.conf.d/peers.d/<PEER>
Private key.
If missing, a placeholder will be printed in peer's config file.
Only required for full configuration file generation on a server, including QR code generation.
Public key. Optional, if private.key
is provided.
At least one of private.key
and public.key
must be present.
The tool doesn't verify if public.key
matches private.key
when both are present.
IPv4 or IPv6 addresses. One per line.
IPv4 or IPv6 networks connected to peer. One per line.
If the network is not a subnet of interface network, it should also be referenced in interface's network.conf
file.
DNS-es to by used by peer. Defaults to interface's dns.conf
or default values.
- Mateusz Adamowski
The project is licensed under MIT License.
- The Wireguard
- Wireguard Vanity Address Tool to generate keypairs with easily recognizable public key prefixes, like
c0ol/adDr/eM/ui8om59pAvR1KgLuhpOV5KC9kWiGGo=
- QR Encode Tool to generate QR codes from command line, able to display them on text console using UTF-8 block characters. Simplifies provisioning of mobile devices.