Skip to content

Latest commit

 

History

History
77 lines (64 loc) · 2.49 KB

package-wireguard.md

File metadata and controls

77 lines (64 loc) · 2.49 KB

OpenIPC Wiki

Table of Content

Package WireGuard

Configuring WireGuard to work with OpenIPC (VPN implementation)

Configuring the server in Linux

Use this guide (archived copy).

Configuring the client in OpenIPC

  1. In the /etc/network/interfaces.d/wg0 file, add the auto wg0 line to the beginning, in address specify the desired client address within the VPN network, and in netmask specify the VPN network mask. An example of the resulting file:
auto wg0
iface wg0 inet static
    address 10.10.10.10.2
    netmask 255.255.255.255.0
    pre-up modprobe wireguard
    pre-up ip link add dev wg0 type wireguard
    pre-up wg setconf wg0 /etc/wireguard.conf
    post-down ip link del dev wg0
  1. Edit the /etc/wireguard.conf file, taking into account that the Address (we set the address in the previous step) and DNS keywords are not supported. An example of the resulting file:
[Interface].
PrivateKey = MO3+yxTyFnnOgeOk9NKFSKHqgFfW6cBhctUO4YeiwV0=
[Peer]
AllowedIPs = 10.10.10.10.0/24
Endpoint = 192.168.0.2:51820
PersistentKeepalive = 25
PublicKey = M2/axcXbD+eg/c4vfEQTiIpV6LU+kzgJCGqDpzIpHS4=
  1. In the /etc/rc.local file, add the ifup wg0 line before the exit 0 line. An example of the resulting file:
#!/bin/sh
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

ifup wg0
exit 0
  1. Reboot OpenIPC.

  2. Test: on the server and on the client, run the wg show command. Here is its output example if successful:

root@openipc-t31:~# wg show
interface: wg0
  public key: /RL2MdZqOdLsT2Be1KXnJWQGJP2oP8sVMlZ/f3GK1BA=
  private key: (hidden)
  listening port: 34161
peer: M2/axcXbD+eg/c4vfEQTiIpV6LU+kzgJCGqDpzIpHS4=
  endpoint: 192.168.0.2:51820
  allowed ips: 10.10.10.0/24
  latest handshake: 1 minute, 7 seconds ago
  transfer: 185.22 KiB received, 182.02 KiB sent
  persistent keepalive: every 25 seconds