[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: defining static IPv6 addresses in /etc/network/interfaces



Hello,

Juliusz Chroboczek a écrit :
iface eth0 inet static
  pre-up  sysctl -w net.ipv6.conf.eth0.autoconf=0 > /dev/null || true

Whether it all works as expected will be seen after the next reboot.

Unless something has changed in recent kernels, it won't.  There's no
conf/eth0 knob before the interface is up.

Things have changed in "recent" kernels. Since 2.6.21, interface-specific parameters in net/ipv6/conf and net/ipv4/conf exist as soon as the interface is created, before it is up or an address is added.

From ChangeLog-2.6.21 :
commit 8030f54499925d073a88c09f30d5d844fb1b3190
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Thu Feb 22 01:53:47 2007 +0900

    [IPV4] devinet: Register inetdev earlier.

    This patch allocates inetdev at registration for all devices
    in line with IPv6.  This allows sysctl configuration on the
    devices to occur before they're brought up or addresses are
    added.

    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

commit 45ba9dd2007da23da5ac21179451c3c9fee30a96
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date:   Thu Feb 15 02:07:27 2007 +0900

    [IPV6] ADDRCONF: Register inet6_dev earlier.

    Allocate inet6_dev earlier to allow users to set up per-interface variables.

    Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>


Reply to: