IPv6: Influence Source Address Selection if Multiple Prefixes Involved?

I can have multiple Prefixes on an Interface:

list ip6prefix 'A'
list ip6prefix 'B'
list ip6prefix 'C'

If that are global prefixes, I would like to influence the preferred address that is used to access internet services.
In RFC6724 is defined how that is done. For example there is the Rule 3: Avoid deprecated addresses..

My best guess is to implement something that I can separately say what prefixes should not be advertised in odhcpd. Then I can set the preferred lifetime of a prefix to a lower value. I started adding preffered lifetime.
If I want clients now to still receive their downstream traffic to A, but they should use B for upstream, I remove advertising A and only advertise B. After the A preffered_lft is over, the prefixes are deprecated, and clients will use B.

Or am I wrong?:
If I remove list ip6prefix 'A' then the downstream traffic would no longer arrive for clients that are from the A prefix?

Actually, there should also be the Pref value in Router Advertisement – Type 134.

Btw.: There is prefix_filter to specify the RA-Prefix to announce from multiple prefixes. For example we could add option prefix_filter 'A' to filterout B and C.

You can do that with ip6class.

You could try to change the ra_preference, but most likely you'll need multiple instances of odchod.

1 Like

As I understand it, it only filter prefixes based on interfaces? So I have to create multiple interfaces and then I can use ip6class to filter them?

I wanted to add something to odhcpd like

config ra
    option prefix '2001::/64'
    option announce '1'
    option valid '300'
    option preferred_lifetime '200'

config ra
    option prefix '2003::/64'
    option announce '0'
    option valid '300'
    option preferred_lifetime '200'

Yes, that is the point of it.

I am not aware of such configuration.

1 Like

It is not existing right now. But I already looked at the odhcpd code and wanted to add something like this.
First thing I did now is to configure the preferred_lft.