Differences between revisions 1 and 5 (spanning 4 versions)
Revision 1 as of 2020-11-19 15:26:39
Size: 1788
Comment:
Revision 5 as of 2021-06-29 20:16:29
Size: 1851
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
== Linux Setup == == Installation ==
Line 11: Line 11:
=== Server === Install the `wireguard` and `wireguard-tools` packages from your package manager of choice.
Line 13: Line 13:
Open a shell on your remote machine and install `wireguard-tools`, which contains a set of CLI tools. ----



== Setup ==

=== FreeBSD Server ===



=== Linux Server ===
Line 43: Line 53:
For `systemd`-capable systems, set WireGuard to run persistently by [[Systemd|starting and enabling]] `[email protected]`. For `systemd`-capable systems, set !WireGuard to run persistently by [[Systemd|starting and enabling]] `[email protected]`.
Line 47: Line 57:
=== Peer 1 === === Linux Peer ===
Line 49: Line 59:
Install `wireguard-tools` and generate a pair of keys, as above.

Create an interface file at `/etc/wireguard/wg0.conf`.
Generate a pair of keys, as above. Create an interface file at `/etc/wireguard/wg0.conf`.
Line 66: Line 74:
The WireGuard interface can be set live or killed using: `wg0`, the !WireGuard interface, can be set live or killed using:
Line 75: Line 83:
=== Android Peer ===


WireGuard


Installation

Install the wireguard and wireguard-tools packages from your package manager of choice.


Setup

FreeBSD Server

Linux Server

Generate a private/public pair of keys.

wg genkey | tee privatekey | wg pubkey > publickey

Create an interface file at /etc/wireguard/wg0.conf.

[Interface]
PrivateKey = <your remote private key here>
Address = 10.0.0.1/24, fdc9:281f:04d7:9ee9::1/64
ListenPort = 51820
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

# Peer 1
[Peer]
PublicKey = <your local public key here>
AllowedIPs = 10.0.0.2/32, fdc9:281f:04d7:9ee9::2/128

Test the configuration by running:

sudo wg-quick up wg0

For systemd-capable systems, set !WireGuard to run persistently by starting and enabling [email protected].

Linux Peer

Generate a pair of keys, as above. Create an interface file at /etc/wireguard/wg0.conf.

[Interface]
PrivateKey = <your local private key here>
Address = 10.0.0.2/24, fd86:ea04:1115::2/64
ListenPort = <your local port number>

[Peer]
PublicKey = <your remote public key here>
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = <your remote host>
PersistentKeepalive = 25

wg0, the !WireGuard interface, can be set live or killed using:

wg-quick up wg0
wg-quick down wg0

Android Peer


CategoryRicottone

Encryption/WireGuard (last edited 2023-04-06 23:12:46 by DominicRicottone)