add relevant config to /etc/network/interfaces, for example I have
this on my server:
auto wg0
iface wg0 inet static
address 10.236.153.1
netmask 255.255.255.0
pre-up ip link add dev wg0 type wireguard
pre-up ip link set dev wg0 mtu 1450
pre-up wg setconf wg0 /etc/network/wg0.conf
post-down ip link delete dev wg0
No need for custom boot scripts.
On Sat, Nov 23, 2019 at 5:13 PM Dieter <dieter@systemli.org> wrote:
>
> Hi,
>
> I want to start my wireguard vpn on my alpine VM on boot. The VPN works
> fine when I start it with "sudo wg-quick up wg0" but I dont want to do
> that every one and also I need to be able to reboot the VM when Im not
> at home.
>
> I found the documentation in the wiki a bit confusing. Also it says that
> its still work in progrss.
> https://wiki.alpinelinux.org/wiki/Writing_Init_Scripts
>
> Can I just make alpine execute "sudo wg-quick up wg0" after boot? Is
> there a wireguard init script somewhere already that I can use? Or could
> you show me an example init script?
>
> thanks in advance