見出し画像

Appendix wgコマンド

環境

  • RockyLinux 9

  • wireguard-tools 1.0.20210914

wgコマンド

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg --help
Usage: wg <cmd> [<args>]

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
  syncconf: Synchronizes 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.
[root@lpic303-rocky34 ~]#

wg show

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg show --help
Usage: wg show { <interface> | all | interfaces } [public-key | private-key | listen-port | fwmark | peers | preshared-keys | endpoints | allowed-ips | latest-handshakes | transfer | persistent-keepalive | dump]
[root@lpic303-rocky34 ~]#

wg showconf


[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg showconf --help
Unable to access interface: No such device
[root@lpic303-rocky34 ~]#

wg set

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg set --help
Usage: wg set <interface> [listen-port <port>] [fwmark <mark>] [private-key <file path>] [peer <base64 public key> [remove] [preshared-key <file path>] [endpoint <ip>:<port>] [persistent-keepalive <interval seconds>] [allowed-ips <ip1>/<cidr1>[,<ip2>/<cidr2>]...] ]...
[root@lpic303-rocky34 ~]#

wg setconf

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg setconf --help
Usage: wg setconf <interface> <configuration filename>
[root@lpic303-rocky34 ~]#

wg addconf

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg addconf --help
Usage: wg addconf <interface> <configuration filename>
[root@lpic303-rocky34 ~]#

wg syncconf

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg syncconf --help
Usage: wg syncconf <interface> <configuration filename>
[root@lpic303-rocky34 ~]#

wg genkey

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg genkey --help
Usage: wg genkey
[root@lpic303-rocky34 ~]#

wg genpsk

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg genpsk --help
Usage: wg genpsk
[root@lpic303-rocky34 ~]#

wg pubkey

[root@lpic303-rocky34 ~]#
[root@lpic303-rocky34 ~]# wg pubkey --help
Usage: wg pubkey
[root@lpic303-rocky34 ~]#


この記事が気に入ったらサポートをしてみませんか?