blob: 58829128841ec1e3f0874461b6ebc8516f5260d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# Wireguard configuration manager
`wgmgr` is a command-line configuration manager for the [Wireguard](https://wireguard.org) VPN solution. It expects a traditional client-server relationship, and cannot be used to handle meshed networks.
It handles client creation and removal, and will auto-generate the corresponding private and public keys. It can also generate the configuration file for each client.
Be aware that the clients' private keys will be stored on the server in order to simplify the config file generation. This is par for the course for Wireguard managers, but it bears repeating.
```
$ wgmgr add my_new_laptop
$ wgmgr ls
my_new_laptop | 10.8.0.2
$ wgmgr config --type split my_new_laptop
<copy-paste the configuration to your laptop>
```
## Setting up
Create the application configuration file, at `/etc/wgmgr.toml`:
```toml
wgconf = "/etc/wireguard/wg0.conf" # path to your Wireguard configuration file
endpoint = "1.2.3.4" # IP address of the server
port = 6789 # optional, uses 51820 by default
dns = "8.8.8.8" # optional
```
Your Wireguard configuration file must already exist and be valid. A sample configuration file is as follows:
```
[Interface]
PrivateKey = REDACTED
ListenPort = 51820
Address = 10.8.0.1/24
```
## Usage
```
Usage: wgmgr [OPTIONS] <COMMAND>
Commands:
ls List known clients
config Generate the configuration file for a client
add Add a new client to your VPN
rm Remove a client from your VPN
wg Run 'wg', but with the client names
help Print this message or the help of the given subcommand(s)
Options:
-w, --wgconfig <WGCONFIG> Wireguard configuration file name
-c, --config <CONFIG> wgmgr configuration file path
-h, --help Print help
-V, --version Print version
```
## Reporting bugs
Please report any bugs you find to [bugs+wgmgr@sixfoisneuf.fr](mailto:bugs+wgmgr@sixfoisneuf.fr). Contributions are welcomed, as long as they follow the [git send-email](https://git-send-email.io) format.
|