Linux implements RFC 3484, "Default Address Selection for Internet Protocol version 6 (IPv6). Briefly, the algorithm involves building a candidate list of potential source addresses, then following these rules in order:
Prefer same address. (i.e. destination is local machine)
Prefer appropriate scope. (i.e. smallest scope shared with the destination)
Avoid deprecated addresses.
Prefer home addresses.
Prefer outgoing interface. (i.e. prefer an address on the interface we're sending out of)
Prefer matching label.
Prefer public addresses.
Use longest matching prefix.
参考
http://www.davidc.net/networking/ipv6-source-address-selection-linux
http://kemot-net.com/blog/which-ipv6-source-address-to-choose