User Tools

Site Tools


cheatsheet:wireguard

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
cheatsheet:wireguard [2023/02/14 10:28] – created kamaradskicheatsheet:wireguard [2023/02/14 10:37] (current) – [Others] kamaradski
Line 21: Line 21:
 -rw-------  1 root root   45 Nov 25 22:15 privatekey -rw-------  1 root root   45 Nov 25 22:15 privatekey
 -rw-------  1 root root   45 Nov 25 22:15 publickey -rw-------  1 root root   45 Nov 25 22:15 publickey
 +
 +
 +# Syntax:
 +# wg genkey
 +# wg pubkey <private_key>
 </code> </code>
  
Line 35: Line 40:
 </code> </code>
  
-===== see wireguard status =====+===== show the current status of all WireGuard interfaces =====
 <code bash> <code bash>
 $ sudo wg show $ sudo wg show
Line 56: Line 61:
   transfer: 13.39 KiB received, 21.38 KiB sent   transfer: 13.39 KiB received, 21.38 KiB sent
  
-TIP: use "$ watch sudo wg show" to create the effect of an constantly updating status window+TIP: use "$ watch sudo wg show" to create the effect of constantly updating status window
 </code> </code>
 +
 +===== show the current status of the specified WireGuard interface =====
 +<code bash>
 +$ sudo wg show wg0
 +
 +interface: wg0
 +  public key: GHI-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x=
 +  private key: (hidden)
 +  listening port: 1234
 +
 +peer: DEF-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x=
 +  endpoint: 1.2.3.4:1234
 +  allowed ips: 10.1.248.10/32
 +  latest handshake: 43 seconds ago
 +  transfer: 12.98 KiB received, 28.82 KiB sent
 +
 +peer: ABC-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x=
 +  endpoint: 1.2.3.4:1234
 +  allowed ips: 10.1.248.11/32
 +  latest handshake: 28 minutes, 46 seconds ago
 +  transfer: 13.39 KiB received, 21.38 KiB sent
 +</code>
 +
 +
 +===== others =====
 +
 +wg showconf <interface>: Show the configuration of the specified WireGuard interface.
 +
 +wg set <interface> <config_file>: Set the configuration of the specified WireGuard interface.
 +
 +wg add peer <interface> <peer_config_file>: Add a peer to the specified WireGuard interface.
 +
 +wg delete peer <interface> <public_key>: Delete a peer from the specified WireGuard interface.
 +
 +wg set peer <interface> <public_key> <peer_config_file>: Update the configuration of a peer for the specified WireGuard interface.
 +
 +wg listen-port <interface> <port>: Set the listen port for the specified WireGuard interface.
 +
 +wg peer <interface> <public_key>: Show the configuration of a peer for the specified WireGuard interface.
 +
 +wg set keepalive <interface> <public_key> <interval>: Set the keepalive interval for a peer for the specified WireGuard interface.
 +
 +wg-quick up <interface>: Bring up a WireGuard interface.
 +
 +wg-quick down <interface>: Bring down a WireGuard interface.
 +
 +wg-quick save <interface>: Save the current configuration of a WireGuard interface.
 +
 +wg-quick strip <interface>: Remove any firewall rules created by the wg-quick utility.
cheatsheet/wireguard.1676370508.txt.gz · Last modified: 2023/02/14 10:28 by kamaradski