Setting the source IP for routes injected by bird

Nico Schottelius nico.schottelius at ungleich.ch
Fri Feb 2 18:48:02 CET 2024


Good evening,

I have seen that the static protocol has the attribute "krt_prefsrc"
which seems to fit the source IP as seen by the kernel:

[18:44] server120.place15:~# ip route get 2001:4860:4860::8888
2001:4860:4860::8888 from :: via 2001:7f8:24::4a dev eth7 proto bird src 2001:7f8:24::ae metric 32 pref medium

On this particular machine bird (?) selected 2001:7f8:24::ae as the
source address, which makes sense as it is the only IP address on the
interface. However that address is a peering IP address and traffic to
it is not forwarded outside of the peering.

Now I can easily add another ip address on the interface that is within
a prefix that I control, but how do I ensure that the route is changed
with another source ip address?

I think what I am looking for is something on the line of

--------------------------------------------------------------------------------
protocol kernel kernel_v6 {
        ipv6 {
             export all;
             prefsrc ... ;
        };
}
--------------------------------------------------------------------------------

Above obviously has a problem, as the preferred address is different,
depending on which device the route is applied to...but as far as I can
see bird adds the route, so bird probably also need to set the preferred
source? Or is it something better solved in the kernel somehow?

Cheers,

Nico

--
Sustainable and modern Infrastructures by ungleich.ch


More information about the Bird-users mailing list