WireGuard: Difference between revisions

m Adding peers to the server configuration: Corrected configuration file, added italics
Added attribution
 
(2 intermediate revisions by the same user not shown)
Line 51: Line 51:
=== Generate a public/private key pair ===
=== Generate a public/private key pair ===


* Create a private and public key for the server. You can use the following command:
* Generate a private and public key for the server. You can use the following command:
  wg genkey | tee server-privatekey | wg pubkey > server-publickey
  wg genkey | tee server-privatekey | wg pubkey > server-publickey
**<code>server-privatekey</code> and <code>server-publickey</code> are filenames and can be anything you want and can be changed accordingly. These files are not directly used by WireGuard.
**<code>server-privatekey</code> and <code>server-publickey</code> are filenames and can be anything you want and can be changed accordingly. These files are not directly used by WireGuard.


Line 116: Line 117:
=== Generate a public/private key pair ===
=== Generate a public/private key pair ===


* We will create a public/private key pair much the same way as we did for the server:
* We will generated a public/private key pair much the same way as we did for the server:
  wg genkey | tee client-privatekey | wg pubkey > client-publickey
  wg genkey | tee client-privatekey | wg pubkey > client-publickey
** The name <code>client</code> for the file name can be changed to anything you like for convenience.
** The name <code>client</code> for the file name can be changed to anything you like for convenience.
Line 189: Line 190:
* Add another <code>[Peer]</code> section to the server configuration.
* Add another <code>[Peer]</code> section to the server configuration.
* Reload the WireGuard server.
* Reload the WireGuard server.
== See also ==
Thank you to "Mark Liversedge" at [https://markliversedge.blogspot.com/2023/09/wireguard-setup-for-dummies.html Wireguard setup for dummeies] with his comprehensive guide that made this possible for me