Vyatta NOS documentation

Learn how to install, configure, and operate Vyatta Network Operating System (Vyatta NOS), which helps to drive our virtual networking and physical platforms portfolio.

How to configure backup of default routes with switch over

An example in which we configure a default static route with three next hops.

The distance configuration ensures that the system will choose only a single next hop, in a deterministic order (that is, to prefer the lowest distance).

set protocols static route 0.0.0.0/0 next-hop 10.10.2.3 path-monitor monitor DC-1 policy 'DC'
set protocols static route 0.0.0.0/0 next-hop 10.10.2.3 distance 10
set protocols static route 0.0.0.0/0 next-hop 10.10.3.3 path-monitor monitor DC-2 policy 'DC'
set protocols static route 0.0.0.0/0 next-hop 10.10.3.3 distance 20
set protocols static route 0.0.0.0/0 next-hop 10.10.4.3 distance 30
set protocols static route 10.10.10.10/32 next-hop 10.10.2.3 interface 'dp0p1s2'
set protocols static route 10.10.10.10/32 next-hop 10.10.3.3 interface 'dp0p1s3'

set service path-monitor host DC target '10.10.10.10'
set service path-monitor host DC type 'ping'
set service path-monitor monitor DC-1 policy 'DC'
set service path-monitor monitor DC-1 type ping host 'DC'
set service path-monitor monitor DC-1 type ping interface 'dp0p1s2'
set service path-monitor monitor DC-2 policy 'DC'
set service path-monitor monitor DC-2 type ping host 'DC'
set service path-monitor monitor DC-2 type ping interface 'dp0p1s3'
set service path-monitor policy DC requires type 'ping'

If DC-1 is compliant with the DC policy then the default route will go via 10.10.2.3. Otherwise, so long as DC-2 is compliant with the DC policy then the default route will go via 10.10.3.3. If neither DC-1 nor DC-2 is compliant then traffic will go via 10.10.4.3.

The 10.10.10.10/32 static routes ensure there is always a route for the monitors to reach their target via both 10.10.2.3 and 10.10.3.3.

You can tweak the behavior by adjustment of the distance configuration on the default route.

For example, if you remove the distance configuration from the 10.10.2.3 and 10.10.3.3 next hops then you allow ECMP to send traffic over both paths so long as both DC-1 and DC-2 remain compliant. If either becomes non-compliant then traffic will continue over the next hop that you've associated with the other. If both become non-compliant then traffic would switch to the path via 10.10.4.3.