Scriptless redundancy based on recursive next-hop search uses
check-gateway=ping to monitor immortal addresses somewhere behind the uplink, so if L1/L2 on the uplink is fine but the path to the monitored IP address is broken somewhere further, the uplink is detected to be unusable. The coarse description is - instead of setting a default route (0.0.0.0/0) directly via an uplink's gateway, you set a specific /32 route to the monitored address (e.g., 8.8.8.8
) via that gateway; the route to 0.0.0.0/0 has the monitored address as a gateway. So if 8.8.8.8 is pingable, the route to 0.0.0.0/0 via 8.8.8.8 is active; when the path to 8.8.8.8 via that uplink is broken for any reason, the default route via 8.8.8.8 becomes inactive within 10 seconds (
check-gateway=ping uses a
10s interval which cannot be changed).
So you need a monitored address (or better two if you suspect the single one not to be immortal enough) per uplink which in your case of four uplinks may be a bit of a problem, but you need no scripting for the failover, as the embedded mechanisms take care of it.
The gateways MUST be plain IP addresses for this to work (no interface names, no
ip.add.re.ss%interface-name constructs are accepted). And the
scope and
target-scope parameters of some of the recursive routes need to be adjusted to make it all work. The details are e.g. in
this nice article.