- UDM/UDMPro Wireguard VPN Tunnel Autostart
- UDM/UDMPro Wireguard WAN Failover detection
- UDM/UDMPro Add ULA
- Install
UDM/UDMPro Wireguard Start Script (requires on_boot.d)
starts automatically when booting the UDM / UDMPro @tusc setup_wireguard.sh script and starts the Wireguard VPN tunnel. If Wireguard is not yet present on the UDM/UDMPro and the download switch is set to 1, 10-wireguard.sh automatically loads the latest release from @tusc repo and extracts it.
download = 0 disable | 1 enable ( default 0 )
UDM/UDMPro Wireguard Failover Script (requires on_boot.d)
On failover, Wireguard automatically switches from the primary interface to the failover interface, when switching from the failover interface to the primary interface, Wireguard remains on the failover interface.
By default, the Wireguard failover script checks every 30 seconds to see if the primary interface is available again and reconnects Wireguard to the primary interface.
In the script you can adjust the sleeptime using the variable sleeptime. Furthermore it is possible to write a logfile to the file wireguard_failover in /mnt/data/log/ using the variable logfile.
logfile = 0 disable | 1 enable ( default 0 )
sleeptime = time in seconds ( default 30 )
UDM/UDMPro Add ULA Script (requires on_boot.d)
"Add ULA Script" adds a ULA prefix to the br0 interface.
Execute via ssh "ifconfig br0 | grep HWaddr | awk '{print $5}'" and generate a ULA PREFIX with your br0 MAC address on https://cd34.com/rfc4193/ and enter it under ULA_PREFIX_br0.
- Install WireGuard kernel module
- Install on_boot.d
- Download and set rights
curl -LJo /mnt/data/on_boot.d/10-wireguard.sh https://raw.githubusercontent.com/k-a-s-c-h/unifi/main/on_boot.d/10-wireguard.sh
curl -LJo /mnt/data/on_boot.d/10-wireguard_failover.sh https://raw.githubusercontent.com/k-a-s-c-h/unifi/main/on_boot.d/10-wireguard_failover.sh
curl -LJo /mnt/data/on_boot.d/11-add-ula.sh https://raw.githubusercontent.com/k-a-s-c-h/unifi/main/on_boot.d/11-add-ula.sh
chmod +x /mnt/data/on_boot.d/10-wireguard*.sh
- Adjust the settings if you want (or use default)
Author: k-a-s-c-h (@0815 on ubnt forums)