Commit f80b7386 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Add a connection type for WireGuard interfaces

Contributed by Thibaut Sautereau <thibaut@sautereau.fr>
parent b5335f43
......@@ -16,6 +16,7 @@ optdepends=('dialog: for the menu based wifi assistant'
'ifplugd: for automatic wired connections through netctl-ifplugd'
'ppp: for PPP connections'
'openvswitch: for Open vSwitch connections'
'wireguard-tools: for WireGuard connections'
)
install=netctl.install
source=(https://sources.archlinux.org/other/packages/netctl/netctl-${pkgver}.tar.xz{,.sig})
......
Description="Example WireGuard tunnel connection"
Interface=wg0
Connection=wireguard
WGConfigFile=/etc/wireguard/wg0.conf
## Example IP configuration
IP=static
Address=('10.0.0.2/24')
IP6=static
Address6=('fd00::2/120')
......@@ -62,6 +62,8 @@ AVAILABLE CONNECTION TYPES
For VLANs on ethernet-like connections.
+macvlan+::
For MACVLANs on ethernet-like connections.
+wireguard+::
For WireGuard interfaces.
GENERAL OPTIONS
......@@ -551,6 +553,17 @@ following are understood for connections of the `macvlan' type:
details.
OPTIONS FOR `wireguard' CONNECTIONS
-----------------------------------
The name of the WireGuard interface is specified in 'Interface='. Next
to the *ip options*, the following are understood for connections of
the `wireguard' type:
'WGConfigFile='::
Path to a *WireGuard* configuration file. Defaults to
'/etc/wireguard/$Interface.conf'.
SPECIAL QUOTING RULES
---------------------
Configuration files for *wpa_supplicant* use non-standard quoting.
......
# Contributed by: Thibaut Sautereau <thibaut@sautereau.fr>
. "$SUBR_DIR/ip"
wireguard_up() {
if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists"
return 1
fi
if ! interface_add wireguard "$Interface" "$MACAddress"; then
report_error "Your kernel may not support WireGuard."
return 1
fi
wg setconf "$Interface" "${WGConfigFile:-/etc/wireguard/$Interface.conf}"
bring_interface_up "$Interface"
ip_set
}
wireguard_down() {
ip_unset
interface_delete "$Interface"
}
# vim: ft=sh ts=4 et sw=4:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment