Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

Have you tried

iface bond0 inet6 static
    address myprefix:mysubnet::myip
    gateway myprefix:mysubnet::mygatewayip
    netmask 64

    post-up /sbin/sysctl -q -w net.ipv6.conf.bond0.autoconf=0
    post-up /sbin/sysctl -q -w net.ipv6.conf.bond0.accept_ra=0

If that does not work, I'd probably try it with a script in /etc/network/if-up.d/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.