I've got a /64 of IPv6 addresses available to one of my servers (Ubuntu 12.04). I'm binding them like this:
auto eth0 iface eth0 inet static address xxx.xxx.xxx.82 netmask 255.255.255.248 network xxx.xxx.xxx.80 broadcast xxx.xxx.xxx.255 gateway xxx.xxx.xxx.81 iface eth0 inet6 static address xxxx::2 netmask 64 gateway xxxx::1 pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/autoconf pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra_defrtr pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra_pinfo pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra_rtr_pref up /sbin/ifconfig eth0 inet6 add xxxx::3/64 # ... snip ... up /sbin/ifconfig eth0 inet6 add xxxx::25/64
This works, but applications are all using
xxxx::25 for their outgoing requests unless specifically told otherwise. If I add
xxxx::26 in my
/etc/network/interfaces, they all start using that. It seems like they just use whatever the highest number is.
How do I specify a certain address to be used as the default? In my case, I happen to want to use the lowest address (
xxxx::2), but I'd really like to know how to specify a particular one, should the need arise in the future.