<div dir="ltr"><div>You could use the networkd-broker tool (or its predecessor networkd-dispatcher) to react to networkd's configuration events, or a netlink-based tool (similar to `ip mon addr`) to directly watch IP address changes.</div><div><br></div><div>To be honest though, a bond0 that's connected to two completely different networks kind of makes no sense to me at all. How is it better than just having two network interfaces?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 29, 2022 at 12:22 PM m1027 <<a href="mailto:m1027@posteo.net">m1027@posteo.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
With a working wlan/lan bond0 failover, how can we trigger other<br>
local services whenever a failover happens?<br>
<br>
Why: In our case, a local openvpn client service needs SIGUSR1<br>
whenever the own IP address changes, after a failover. See man<br>
openvpn(8), --ipchange.<br>
<br>
The problem: After a failover, the openvpn client keeps sitting on<br>
the wrong IP address/interface. Sending SIGUSR1 manually helps<br>
indeed: openvpn then reconfigures itself and uses the correct IP<br>
address. The man page recommends to write a hook script for the<br>
local dhcpcd to send SIGUSR1 to the openvpn client, however we are<br>
not using dhcpcd but systemd.<br>
<br>
Some more information:<br>
<br>
- Failover works in general here; pulling out the cable from lan1<br>
activates wlan0 and vice versa, and this triggers external DHCP<br>
servers to issue a new IP address. The external servers are<br>
triggered because of FailOverMACPolicy=active for bond0.<br>
<br>
- Our bond0 is on top of wlan0 + lan1 and configured like this:<br>
<br>
[NetDev]<br>
Name=bond0<br>
Kind=bond<br>
[Bond]<br>
Mode=active-backup<br>
AdSelect=bandwidth<br>
FailOverMACPolicy=active <br>
<br>
- We know of networkmanager's dispatcher scripts but are looking for<br>
a solution within systemd. (It's also unclear whether our network<br>
setup could be configured entirely by networkmanager.)<br>
<br>
- There is a workaround: There is the "inactive <sec>" option for<br>
the openvpn client to shutdown in case of no action. And we can<br>
additionally set the client to Restart=always. However, this<br>
interrupts even working openvpn client sessions every 60 sec of<br>
inactivity.<br>
<br>
Thanks for any pointers...<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div>