Context:
- openwrt 19.07.3 on Fritzbox 4040 with external VDSL modem
- unbound setup in parallel mode
- tun0 created by openvpn when it starts (that is, nothing in /etc/config/network)
- he.net tunnel with /48 split across VLANs and vpn (each gets a /64)
Now the fun fact: when the modem loses the connection for more than a few moments, unbound will loudly complain it cannot talk to upstream servers over the lone IPV6 interface remaining, which is of course the vpn endpoint leading to nowhere. After a short while, the system runs out of memory and must be power-cycled once the modem is back in sync, meaning it won't recover by itself.
I thought of shutting down the vpn interface and openvpn itself when wan is down and restarting it later:
- is that a good idea? Do you have a better one?
- can I use something along the lines of this script?