... | @@ -368,19 +368,19 @@ Open a UDP port for WireGuard: |
... | @@ -368,19 +368,19 @@ Open a UDP port for WireGuard: |
|
|
|
|
|
Install WireGuard, generate a keypair, and set up an interface. The server will be at 10.100.0.1, and the clients will be at 10.100.0.<var>X</var> for increasing values of <var>X</var>.
|
|
Install WireGuard, generate a keypair, and set up an interface. The server will be at 10.100.0.1, and the clients will be at 10.100.0.<var>X</var> for increasing values of <var>X</var>.
|
|
|
|
|
|
```
|
|
<pre>
|
|
# apt install wireguard
|
|
# apt install wireguard
|
|
# cd /etc/wireguard
|
|
# cd /etc/wireguard
|
|
# (umask 077 && wg genkey > privatekey)
|
|
# (umask 077 && wg genkey > privatekey)
|
|
# wg pubkey < privatekey > publickey
|
|
# wg pubkey < privatekey > publickey
|
|
# (umask 077 && vi wg0.conf)
|
|
# (umask 077 && vi wg0.conf)
|
|
[Interface]
|
|
[Interface]
|
|
PrivateKey = <contents of privatekey file>
|
|
PrivateKey = <mark><var>contents of privatekey file</var></mark>
|
|
ListenPort = 51820
|
|
ListenPort = 51820
|
|
Address = 10.100.0.1/24
|
|
Address = 10.100.0.1/24
|
|
# systemctl enable --now wg-quick@wg0.service
|
|
# systemctl enable --now wg-quick@wg0.service
|
|
# etckeeper commit "wireguard"
|
|
# etckeeper commit "wireguard"
|
|
```
|
|
</pre>
|
|
|
|
|
|
Use `wg show` to show the status of the network interface.
|
|
Use `wg show` to show the status of the network interface.
|
|
|
|
|
... | | ... | |