Page MenuHomeVyOS Platform

Extend failover route functionality to use dynamically assigned interface next hops
Open, NormalPublicFEATURE REQUEST

Description

In my use case I only require a failover (4G) to be used only when the primary connection fails. I am wondering if failover route monitoring could be extended to allow for a more bare bones failover solution. This would require the addition of automatically grabbing the next hop from various interfaces (via DHCP, PPPoE, etc) as it currently only allows for static routes.

Example:

set interfaces ethernet eth0 address dhcp
set interfaces ethernet eth0 description Primary

set interfaces ethernet eth1 address dhcp
set interfaces ethernet eth1 description Secondary

set interfaces ethernet eth2 address 192.168.0.1/24
set interfaces ethernet eth2 description LAN

set firewall group network-group LAN network 192.168.0.0/24

set protocols failover route 0.0.0.0/0 dhcp-interface eth0 check target interface
set protocols failover route 0.0.0.0/0 dhcp-interface eth0 check timeout ‘10’
set protocols failover route 0.0.0.0/0 dhcp-interface eth0 check type ‘icmp’
set protocols failover route 0.0.0.0/0 dhcp-interface eth0 metric ‘1’

set protocols failover route 0.0.0.0/0 dhcp-interface eth1 check target interface
set protocols failover route 0.0.0.0/0 dhcp-interface eth1 check timeout ‘10’
set protocols failover route 0.0.0.0/0 dhcp-interface eth1 check type ‘icmp’
set protocols failover route 0.0.0.0/0 dhcp-interface eth1 metric ‘2’

set nat source rule 100 description ‘SNAT - LAN - Outbound Primary’
set nat source rule 100 outbound-interface ‘eth0’
set nat source rule 100 source group network-group LAN
set nat source rule 100 translation address ‘masquerade’

set nat source rule 101 description ‘SNAT - LAN - Outbound Secondary’
set nat source rule 101 outbound-interface ‘eth1’
set nat source rule 101 source group network-group LAN
set nat source rule 101 translation address ‘masquerade’

The above syntax is just a suggestion and can be modified.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Improvement (missing useful functionality)

Event Timeline

An additional "nice to have" would be a hook that runs on route state change.
Examples:

set protocols failover route 0.0.0.0/0 next-hop 100.100.100.1 hook '/config/scripts/failover-hook-100.100.100.1'

set protocols failover route 0.0.0.0/0 dhcp-interface eth0 hook '/config/scripts/failover-hook-eth0'

Similar to the WAN load balancing hook, a variable with the state could be passed to the script.

Viacheslav triaged this task as Normal priority.Jan 14 2024, 8:13 PM