I have using something similar to How to enforce IPv6 source address selection with addrlabel at startup? to configure IPv6 address selection in Ubuntu 16.04.
Now I am deploying Ubuntu 18.04 and the new network configuration tool is "netplan".
This machine has a handful of IPv6 addresses and I want to be able to configure the source address as described in RFC 3484. That is, several IPv6 source addresses are valid for a given destination, but I want to be able to choose what source IPv6 address is used depending of the destination.
I have tried "routes" and "routing-policy", with no effect. Maybe I am doing it wrong.
I have found some examples por policy routing for IPv4, but all of them use "via" with an static address and I want to use automatic IPv6 router discovery so, technically, I don't know what my router address is, and it could change anytime.
I have tried something like this, with no success:
network: version: 2 renderer: networkd ethernets: enp1s0: addresses: - 2001:XXXX:XXXX::1/48 routing-policy: - to: "::/0" from: "2001:XXXX:XXXX::1/48" priority: 0
EDIT: My current netplan configuration is:
network: version: 2 renderer: networkd ethernets: enp1s0: dhcp4: yes dhcp6: yes addresses: - 2001:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:1/48