Home

Awesome

VintageNetWireguard

Experimental

An attempt to support Wireguard VPN peer connections on Nerves devices. See https://wireguard.com for more info

Configuration

<!--- DOC !--->

Wireguard needs to configure an interface and peer connections for that interface. Below is a list of the expected configuration parameters which are referenced from wg(8) and wg-quick(8):

Interface

Keywg nameRequired?Description
:private_keyPrivateKeyXbase64 private key for the interface registered with the server
:addressesAddressXlist of IP addresses for the connection to use (CIDR supported)
:listen_portListenPortport for the connection. Randomly assigned if empty or 0
:fwmarkFwMark32-bit fwmark for outgoing packets
:dnsDNSlist of DNS IP's
:peers[PEER]list of peer configs (see below)

Peer

Keywg nameRequired?Description
:public_keyPublicKeyXbase64 public key
:endpointEndpointXendpoint to the wireguard server which the peer attempts to connect
:allowed_ipsAllowedIpsXlist of IP addresses for allowed incoming packets and outgoing packets directed to. Defaults to ["0.0.0.0/0", "::0"]
:persistent_keepalivePersistentKeepaliveoptional integer seconds for sending an authenticated packet as a keepalive

Using Wireguard Config Files

Wireguard commonly uses *.conf configuration files to simplify the setup process and VintageNetWireguard provides a helper function to parse those config files into the expected format:

iex)> config = VintageNetWireguard.ConfigFile.parse("/path/to/wg0.conf")
iex)> VintageNet.configure("wg0", config)
<!--- DOC !--->

Goals/Ideas