What onboot configuration option will set the default outbound IPv6 address to use when a Linux machine initiates an outbound IPv6 connection?
IPV6ADDR= does not work to specify the default outbound IPv6 address.
I have a machine with several IPv6 alias addresses on eth0. I specify
ifcfg-eth0 to set the
IPV6ADDR_SECONDARIES= to a long list of IPv6 addresses.
Linux seems to pick one of those IPv6 addresses at random to use as its default outbound IPv6 to use. No rhyme or reason on which it uses, and it's annoying. Some IPv6 addresses are for incoming services only, and I don't want to expose those addresses to others when initiating outbound connections.
I can manually tell Linux to stop using an outbound IPv6 address:
ip -6 addr show | grep global sudo ip addr change 2111:aaaa:bbbb:cccc:1:2:3:4 dev eth0 preferred_lft 0 ip -6 addr show | grep global
Then it stops using
2111:aaaa:bbbb:cccc:1:2:3:4 as the default outbound IPv6, and starts using the next one on its list according to
ip -6 addr show | grep global. This is a manual workaround until I find some
IPV6_OUTBOUND= or whatever parameter to specify the main outbound IPv6 address.
In comparison, IPv4 seems to use its
IPADDR= as the default outbound IP. The IPv6 version of this parameter,
IPV6ADDR= does not set the default outbound IPv6 address - it often uses one on the
I am using Centos 6.