LinuxCommandLibrary

wg

Manage the configuration of WireGuard interfaces.

TLDR

Check status of currently active interfaces

$ sudo wg
copy


Generate a new private key
$ wg genkey
copy


Generate a public key from a private key
$ wg pubkey < [path/to/private_key] > [path/to/public_key]
copy


Generate a public and private key
$ wg genkey | tee [path/to/private_key] | wg pubkey > [path/to/public_key]
copy


Show the current configuration of a wireguard interface
$ sudo wg showconf [wg0]
copy

Copied to clipboard