[WireGuard] Wireguard on OpenWRT/LEDE (here: Luci)

Jason A. Donenfeld Jason at zx2c4.com
Tue Nov 1 22:01:01 CET 2016


On Tue, Nov 1, 2016 at 9:57 PM, Dan Lüdtke <mail at danrl.com> wrote:
>> 11. The existing logic for adding a device is to add it if it doesn't
>> exist, and otherwise to flush the addresses. Is it a good idea to
>> flush the routes too? Or simply delete and re-add? Or is a simple
>> flush of the addresses standard LEDE behavior? I'll defer to Baptiste
>> (CC'd) on this.
>
> Not sure either.

In your latest commit, it looks like you've just added flushing of the
routes too. If you're headed down this track, just do it properly by:

- if ! ip link show dev "${iface}" >/dev/null 2>&1; then
-  ip link add dev "${iface}" type wireguard
- else
-  ip address flush dev "${iface}"
-  ip route flush dev "${iface}"
- fi
+ ip link del dev "${iface}" 2>/dev/null
+ ip link add dev "${iface}" type wireguard


More information about the WireGuard mailing list