Hi Stuart, /etc/hostname.trunk0 trunkproto loadbalance trunkport bge0 trunkport bge1 inet public1 255.255.255.248 bcaddr inet alias public2 255.255.255.248 bcaddr inet alias public3 255.255.255.248 bcaddr inet alias 10.private1 255.255.255.248 bcaddr inet alias 10.private2 255.255.255.248 bcaddr inet alias 10.private3 255.255.255.248 bcaddr inet6 alias private:f020::4 64 inet6 alias private:f020::3 64 inet6 alias private:f020::2 64 inet6 alias public::f020::4 64 inet6 alias public::f020::3 64 inet6 alias public::f020::2 64 up
rfc3484 rules 2 (scope) and 7 (pref-public) apply. If the order is reversed 2,3,4 instead of the above 4,3,2 ping6 selects 4 as srcaddr. If I remove the 'alias' keyword from the inet6 addr I wish to be "preferred" I see no difference. For me it seems the network stack just takes the "most-recently-added" net6 address as the "greatest" as to use the term from the rfc. If you take the addresses 4,5,3 (in this order) it will select ::3 as source. Whats the purpose of 'alias' in the inet6 context if its not honored? Marco > On 2011/08/03 15:30, Marco wrote: >> Hi, >> >> I've bound multiple local-unique and global-unique addresses to my >> trunk0 >> interface. >> >> xxx::2 (should be primary, I want that address to be seen for outbound >> connections) >> xxx::3 >> xxx::4 >> >> and ping6 selects ::4 as its source address if not explicitly given one. >> >> ping6 selects ::2 only if this address is the 'last' to appear in >> hostname.trunk0. >> >> I've tried with 4.9-current/i386 generic built on Juli 30th 2011 >> >> Is this a bug or a undefined ipv6 issue? > > ipv6 has complicated source-address selection rules - you don't include > enough information to tell whether what you're seeing is expected or not > but see rfc3484 before attributing this to a possible bug.
