May 10, 2019

Wireguard: Status information / using the wg command

After the installation of wireguard on two servers i shut down the secondary server and after 4h i did the wg command:
root@zerberus:~# wg
interface: wg0
  public key: XXX=
  private key: (hidden)
  listening port: 46932

peer: YYY=
  allowed ips:
  latest handshake: 4 hours, 19 minutes, 2 seconds ago
  transfer: 348 B received, 436 B sent
With the "ip addr" command there is nothing really interesting:
root@zerberus:~# ip addr show wg0
5: wg0:  mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    inet scope global wg0
       valid_lft forever preferred_lft forever
Just to get some information about the "wg" command:
root@zerberus:~# wg help
Usage: wg  []

Available subcommands:
  show: Shows the current configuration and device information
  showconf: Shows the current configuration of a given WireGuard interface, for use with `setconf'
  set: Change the current configuration, add peers, remove peers, or change peers
  setconf: Applies a configuration file to a WireGuard interface
  addconf: Appends a configuration file to a WireGuard interface
  genkey: Generates a new private key and writes it to stdout
  genpsk: Generates a new preshared key and writes it to stdout
  pubkey: Reads a private key from stdin and writes a public key to stdout
You may pass `--help' to any of these subcommands to view usage.
and one more example:
root@zerberus:~# wg showconf wg0

ListenPort = 46932
PrivateKey = TTT=

PublicKey = XXX=
AllowedIPs =
Endpoint =

No comments:

Post a Comment