@@ -7,19 +7,45 @@ Before using this module, you'll need to:
7
7
8
8
1 . Install the [ WireGuard tools] ( https://www.wireguard.com/install/ ) for your OS.
9
9
10
- 2 . Generate a key pair for each client:
10
+ 2 . Generate a key pair for each client with a WireGuard tool :
11
11
``` bash
12
12
wg genkey | tee client1-privatekey | wg pubkey > client1-publickey
13
13
```
14
14
15
- 3 . Generate a key pair for the server
15
+ 3 . Generate a key pair for the server with a WireGuard tool:
16
16
``` bash
17
17
wg genkey | tee server-privatekey | wg pubkey > server-publickey
18
18
```
19
19
4 . Add each client's public key, along with the next available IP address to the ` wg_clients ` list.
20
20
21
21
5 . Add server's private key to the ` wg_server_private_key ` variable. You can use AWS SSM Parameter store to store and read server private key.
22
-
22
+ 5.1 To store the private key you could use this command:
23
+
24
+ ``` shell
25
+ aws ssm put-parameter --name /wireguard/wg-server-private-key --type SecureString --value < Your Server Private Key>
26
+ ```
27
+
28
+ 6. To create working configuration for the GUI WireGuard client, you should create a conf file from this template:
29
+
30
+ ` ` ` toml
31
+ [Interface]
32
+ PrivateKey = < Your Client Private Key>
33
+ ListenPort = 51820
34
+ Address = 10.0.0.4/32 # Set your client's local ip address
35
+ DNS = 8.8.8.8
36
+
37
+ [Peer]
38
+ PublicKey = <Public Key of Your WireGuard Server>
39
+ AllowedIPs = 10.0.0.0/24
40
+ Endpoint = <IP or Domain Name of Your WireGuard Server>:51820
41
+ PersistentKeepalive = 25
42
+ ` ` `
43
+
44
+ Save this file as ` < Your VPN Name> .conf` . Then you could import your configuration in WireGuard GUI client or share it with end users.
45
+
46
+ If you want to save or share more than one conf file - you can add them to single zip file without folders.
47
+
48
+ WireGuard GUI client support import of zipped configurations.
23
49
24
50
< ! -- BEGINNING OF GENERATED BY TERRAFORM-DOCS -->
25
51
0 commit comments