I need to attribute static IPv6 addresses (not use autoconfigured addresses, and ignore router advertisements). This can be done as follows for a standard interface like eth0
iface eth0 inet6 static address myprefix:mysubnet::myip gateway myprefix:mysubnet::mygatewayip netmask 64 pre-up /sbin/sysctl -q -w net.ipv6.conf.$IFACE.autoconf=0 pre-up /sbin/sysctl -q -w net.ipv6.conf.$IFACE.accept_ra=0
However, how can this be done for bonded interfaces? using the "all" interface does not work.
System is Ubuntu 10.04, 2.6.24-24-server. (12.04 seems to be the same).
If one uses the above sysctl command for the bond0, the networking hangs on boot, because /proc/sys/net/ipv6/conf/bond0 does not yet exist and cannot be written to.
Once the system has booted /proc/sys/net/ipv6/conf/bond0 exists, so one solution after booting is to add the following to /etc/rc.local:
/sbin/sysctl -q -w net.ipv6.conf.bond0.autoconf=0 /sbin/sysctl -q -w net.ipv6.conf.bond0.accept_ra=0 /etc/init.d/networking restart
and this has the desired effect, the autoconfig v6 address disappears. Seems like a bit of a hack though, are there better solutions?