Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Latest commit

 

History

History
43 lines (30 loc) · 1.56 KB

File metadata and controls

43 lines (30 loc) · 1.56 KB

Made read-only / frozen to preserve the original gist by @colemar.

Future improvements (if any), should be made in forks.

Eg. sskras/wg-peers


Manage Wireguard peers (IPv4 only)

List, add or delete Wireguard peers. Also show client configuration for already added peers.

wg-peer [add|show <peer>|del <peer>|list]

where:

  • a[dd] add a new peer
  • s[how] show peer configuration
  • d[el] delete peer
  • l[ist] list peers

<peer> is the peer public key as shown by list command

Configuration files for clients are saved in /etc/wireguard/clients. If there are multiple Wireguard interfaces, wg-peer chooses the first one listed by wg show interfaces (most likely wg0).

Examples

  • list peers: wg-peer l
  • add a new peer: wg-peer a
  • show client configuration for peer: wg-peer s kTU5yhp1qPBHsKhKs4aSgPKRotU4bGPhl3y8dHD1Ki4=
  • delete peer: wg-peer d kTU5yhp1qPBHsKhKs4aSgPKRotU4bGPhl3y8dHD1Ki4=

Screenshots

Screenshot Screenshot Screenshot Screenshot

Based on new-wireguard-peer.sh by @robinlandstrom.
Imported from wg-peer Gist by @colemar.

License