View Source Wireguardex.DeviceConfigBuilder (Wireguardex v0.3.3)
This module contains functions to create a DeviceConfig
which itself
represents a configuration that can be set on a Wireguard device (interface).
If an interface exists, the configuration is applied on top of the existing interface's settings. Missing settings are not overwritten or set to defaults.
To crate the default config use device_config/0
then you can apply each
function in this module to specify the details.
examples
Examples
iex> res=
...> device_config()
...> |> listen_port(1234)
...> |> fwmark(11111)
...> |> Wireguardex.set_device("wg1234")
...> Wireguardex.delete_device("wg1234")
...> res
:ok
Link to this section Summary
Functions
Creates the default configuration to be configured with the provided functions.
The fwmark to set on the interface.
The listening port for incoming connections to set on the interface.
A list of peers with their own configurations to set on this interface.
The private encryption key to set on the interface.
The public encryption key to set on the interface.
If true, replace existing peer configurations on the interface.
Link to this section Functions
Creates the default configuration to be configured with the provided functions.
The fwmark to set on the interface.
The listening port for incoming connections to set on the interface.
A list of peers with their own configurations to set on this interface.
The private encryption key to set on the interface.
The public encryption key to set on the interface.
If true, replace existing peer configurations on the interface.