Skip to content

sskras/wg-peers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 

Repository files navigation

Manage Wireguard peers (IPv4 only)

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

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

where:

  • a[dd] add a new peer
  • s[how] show peer configuration
  • d[el] delete peer(s)
  • l[ist] list peers
  • f[ix] rename old style client config files to new (based on client public key)

<desc> is an optional mnemonic peer description, e.g. "John Doe phone". Default is the peer public key.
<peer> is the peer public key as shown by list command

Configuration files for clients are saved in /etc/wireguard/clients. They are named after the corresponding public key. To fix bad names do this: wg-peer fix.

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 "John Doe phone"
  • 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

About

Manage Wireguard peers (IPv4 only)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%