Dynamic routes

Robert Dahlem Robert.Dahlem at gmx.net
Mon Nov 22 17:20:12 UTC 2021


Hello,

I'm searching for a way to dynamically add or delete routes when a
tunnel comes up or goes down. I do not mean "interface wg0 comes up",
but explicitly "tunnel comes up" in the sense that both peers see each
other, key exchange has been successful and packets would be transported
through the tunnel.

The idea behind this is to have redundant tunnels. Let's say a Wireguard
client has a preferred server and a secondary server. Packets should be
routed through the preferred router while that tunnel is established and
through the secondary server when the preferred server is not available
for some reason.

I could always install Quagga or Bird and use OSPF. But that might be a
bit of an overkill for a simple active/passive failover.

Is there any way to react on tunnel state events in Wireguard?

Regards,
Robert


More information about the WireGuard mailing list