Static vs SLAAC - Static expected to be preferred?

Seth Mattinen sethm at rollernet.us
Thu Apr 28 00:46:42 CEST 2011


On 4/27/2011 15:09, Steinar H. Gunderson wrote:
> Den 27. april 2011 17:19 skrev Seth Mattinen <sethm at rollernet.us> følgende:
>> It's easy to go static in Debian:
>>
>> iface eth0 inet6 static
>>    address 2001:0DB8:107:400::a
>>    netmask 64
>>    pre-up modprobe ipv6
>>    pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
>>
>>
>> Or did you mean something else?
> 
> I've tried various variants of this, but seemingly there are races,
> and sometimes you get them anyway. I don't think I've tried
> specifically the pre-up variant, though, so it might be worth a shot
> (I've mainly seen various versions in rc.local).
> 


This is what I've found works best on my Debian servers. It turns off
autoconf as early as possible while still listening for an RA to get a
gateway (handy for simple router redundancy setups). Waiting until
rc.local is usually too late, plus this keeps all the config in the same
place. The modprobe is needed first since when this runs at boot the
ipv6 module hasn't loaded yet and thus the proc tree won't exist.

If I need to add other static IPv6 addresses while preferring the "main"
one as the default source address I put them in as post-up statements:

iface eth0 inet6 static
    address 2001:0DB8:107:400::a
    netmask 64
    pre-up modprobe ipv6
    pre-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
    post-up ip addr add 2001:DB8:107:400::b/64 dev $IFACE preferred_lft 0
    post-up ip addr add 2001:DB8:107:400::c/64 dev $IFACE preferred_lft 0

~Seth


More information about the ipv6-ops mailing list