Disabling IPv6 on *one* network interface in Debian

Bjørn Mork bjorn at mork.no
Fri Feb 4 15:16:07 CET 2011


Brandon Applegate <brandon at burn.net> writes:

> I'm *thinking* it's a race condition.  Debian is going to create that
> interface on demand with vconfig.  So I think pre-up is trying to run
> and the interface isn't created yet.  

Correct.  You can see this if you add non-failing pre-up commands and
run "ifup --verbose".  The pre-up commands are run first, and then 

 run-parts /etc/network/if-pre-up.d

which eventually will call 

  /etc/network/if-pre-up.d/vlan 

which in turn will create the interface using vconfig.  So you either
need to stick the sysctl cmmands into e.g.

 /etc/network/if-pre-up.d/zz-late-pre-up

or something like that, or use some other trick.


> This is messy, but what about:
>
> post-up ifconfig eth0.100 down
> post-up sysctl -w net.ipv6.conf.eth0/100.autoconf=0 post-up sysctl -w
> net.ipv6.conf.eth0/100.accept_ra=0
> post-up ifconfig eth0.100 up

Yes, that will work, but seems a bit messy like you say.  How about just
changing the defaults for new interfaces before bringing this interface up:

 iface eth0.100 inet static
       pre-up sysctl -w net.ipv6.conf.default.autoconf=0
       pre-up sysctl -w net.ipv6.conf.default.accept_ra=0
       address a.b.c.d
       netmask 255.255.255.0
       network a.b.c.0


You might want to add 

     up sysctl -w net.ipv6.conf.default.autoconf=1
     up sysctl -w net.ipv6.conf.default.accept_ra=1

as well, to restore the proper defaults for other interfaces brought up
later.



Bjørn
 


More information about the ipv6-ops mailing list