Wireguard-Interfaces may not come up at Boot-Time, as the WAN-Interface may not be ready yet.
Working Solution, tested on OpnSense:
diff --git a/net/wireguard-tools/files/wireguard_wgquick.in b/net/wireguard-tools/files/wireguard_wgquick.in
index c6680e08c5e..1669676e097 100644
--- a/net/wireguard-tools/files/wireguard_wgquick.in
+++ b/net/wireguard-tools/files/wireguard_wgquick.in
@@ -29,7 +29,12 @@ wireguard_start()
${wireguard_env:+eval export $wireguard_env}
for interface in ${wireguard_interfaces}; do
- %%PREFIX%%/bin/wg-quick up ${interface}
+ # wait in Background for Interface to show up
+ # this may take a While as WAN may not yet be ready
+ while ! %%PREFIX%%/bin/wg show ${interface} >/dev/null 2>&1; do
+ %%PREFIX%%/bin/wg-quick up ${interface}
+ /bin/sleep 1
+ done &
done
}
Feel free to use this Patch. Contribution-Policy is too cumbersome for me.
Wireguard-Interfaces may not come up at Boot-Time, as the WAN-Interface may not be ready yet.
Working Solution, tested on OpnSense:
Feel free to use this Patch. Contribution-Policy is too cumbersome for me.