-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Hi,
I am testing redistribution of default routes, using 2 routes and 1 client.
The idea is to have both routes installed on the client either with different metrics, or as 1 rule with 2 nexthops of different weights
Use case: 2 ISPs, with one preferred over the other, different public IPv4 and IPv6 ranges, routers distributing the default routes with custom metric ( or weigth ), the routers would be monitoring the external connection, and change the redistribution metric or retract the distribution if an ISP goes offline. Also source routing that can work for both IPv4 and IPv6.
These are the things I tried without success:
- Have the routes installed in the client with a pref-src.
I tried a combo of theinfilter,pref-src <IP>and no selector or selectors liketable 2,ip ::/0 eq 0,ip 0.0.0.0/0 eq 0,id <RouterID>but the route gets always installed in the default table, with no source, also no metric on the IPv4:
default via 12.144.66.185 dev ens3 proto babel onlink
default via fe80::e6a:a3ff:fea7:0 dev ens3 proto babel metric 1024 onlink pref medium
- Have multiple routes installed
What happens is that only one gets installed, the other stays "feasible". Also it is on first-come basis, so the lower metric one can end to be not the one installed. Example of a log output:
::/0 from ::/0 metric 1096 (1096) refmetric 1000 id 0e:08:1c:ff:fe:dd:00:00 seqno 13650 age 87 via ens3 neigh fe80::e08:1cff:fedd:0 (installed)
::/0 from ::/0 metric 106 (106) refmetric 10 id 0e:6a:a3:ff:fe:a7:00:00 seqno 38400 age 87 via ens3 neigh fe80::e6a:a3ff:fea7:0 (feasible)
0.0.0.0/0 from 0.0.0.0/0 metric 1096 (1096) refmetric 1000 id 0e:08:1c:ff:fe:dd:00:00 seqno 13650 age 87 via ens3 neigh fe80::e08:1cff:fedd:0 nexthop 12.144.66.185 (installed)
0.0.0.0/0 from 0.0.0.0/0 metric 106 (106) refmetric 10 id 0e:6a:a3:ff:fe:a7:00:00 seqno 38400 age 87 via ens3 neigh fe80::e6a:a3ff:fea7:0 nexthop 66.199.5.161 (feasible)
If both could be installed, the OS could choose the lower metric one. Other option could be to override the same route installed when a new lower metric is received. [Extra] nexthop merging of route + weight could be also an option
- [Extra] Have the same route installed twice, with different parameters by altering with the install filter. This would allow to add the same route in the default table and in a separate table to be used with source routing-policy.
The main settings are:
Router 1:
redistribute ip 0.0.0.0/0 eq 0 metric 1000
redistribute ip ::/0 eq 0 metric 1000
Router 2:
redistribute ip 0.0.0.0/0 eq 0 metric 10
redistribute ip ::/0 eq 0 metric 10
Client:
Ubuntu with kernel 5.15.0-92-generic
in id 0e:08:1c:ff:fe:dd:00:00 table 2