[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ipv6 stable privacy (rfc 7217) as default ipv6 address for outgoing traffic



Hi Serge,

On Mon, May 24, 2021 at 11:51:12AM +0200, Serge Pouliquen wrote:
> I'm getting 2 addresses : one from slaac with stable privacy and one from
> dhcpv6.
> It looks like the one from dhcpv6 is used as the default for outgoing
> traffic.
> 
> How can I indicate that I want to use the one related to stable privacy as
> the default outgoing address ?

I'm not sure if you can do it with DHCPv6.

If you can find a way to alter your routing table, you would be
wanting to set the source address on your v6 default route.

> I can also disable dhcpv6, but I would like to keep dhcpv6.
>   iface enp6s0 inet6 auto

Could you maybe use a post-up directive to change your default
route?

$ ip -6 route show default
default via fe80::200:24ff:fec4:36dd dev enp0s31f6 proto ra metric 100 pref medium
$ my_route=$(ip -6 route show default); ip -6 route change $my_route src 2001:8b0:ca07:c57a:127b:44ff:fe93:fac4
$ ip -6 route show default
default via fe80::200:24ff:fec4:36dd dev enp0s31f6 proto ra src 2001:8b0:ca07:c57a:127b:44ff:fe93:fac4 metric 100 pref medium

(might possibly want to check that your v6 default route doesn't
already have a src ip. Also there can be multiple default routes…)

The other common way to influence source address selection is to set
preferred_lft to 0 for every IPv6 address that you DON'T want used
as a source address. Such addresses will then be marked as
"deprecated"; they will still accept traffic but will not be
selected as the source address unless forced.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: