From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 633611389E2 for ; Tue, 30 Dec 2014 10:10:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D188BE09D7; Tue, 30 Dec 2014 10:10:19 +0000 (UTC) Received: from Riaqn-RamNode.riaqn.com (ramnode.riaqn.com [167.88.115.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4BF60E09BF for ; Tue, 30 Dec 2014 10:10:17 +0000 (UTC) Received: from Riaqn-ThinkPad (unknown [59.78.22.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by Riaqn-RamNode.riaqn.com (Postfix) with ESMTPSA id 1B6CF1C3C038E; Tue, 30 Dec 2014 18:10:14 +0800 (CST) From: Zesen Qian To: Mick Cc: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Disable IPv6 on specific interface References: <87zja5g6l5.fsf@riaqn.com> <201412300939.45311.michaelkintzios@gmail.com> Date: Tue, 30 Dec 2014 18:10:04 +0800 In-Reply-To: <201412300939.45311.michaelkintzios@gmail.com> (Mick's message of "Tue, 30 Dec 2014 09:39:35 +0000") Message-ID: <87tx0dfnyb.fsf@riaqn.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 796c4d4a-4bac-4255-8c7c-8ee7b2740bdb X-Archives-Hash: 5616fde1f193a26d192edb6046e1d707 Mick writes: > On Tuesday 30 Dec 2014 03:27:34 Zesen Qian wrote: >> Hello list, >> Sorry for hijacking Rich's thread, resend here. >> I want to disable IPv6 on an certain interface, a simple google >> tell me to add one line to /etc/sysctl.d/local.conf >> net.ipv6.conf.enp4s0.disable_ipv6=3D1 >> Simple enough, but the problem I have is that both ipv6 and the >> dirver of the network card(tg3) is loaded by modules. They 're not >> loaded when the service sysctl is started, so there's no entry >> named "net.ipv6.conf.enp4s0", which make sysctl not working. >> So my question is that, is there any way to disable IPv6 on >> specific interface, as early as I can? I want to make it early >> because I don't want to receive any RA to mess up my route table. >> I guess just adding sysctl to preup() in /etc/conf.d/net should do >> the trick, but may I make it earlier? >> Any comment is appreciated. > > > Unless the kernel knows of the enp4s0 interface and therefore lists it un= der=20 > sysctl, I can't see how it can be disabled. You could try disabling IPv6= =20 > altogether in the kernel, but this may not be what you want to achieve. > > Alternatively, have a look with modinfo in the module options in the unli= kely=20 > chance that the module has some option which disables IPv6 functionality. Hello Mick, The module ipv6 has only three parameters, each of which is "disable ipv6", "disable ipv6 on all interfaces", "disable autoconf on all interfaces", none of these is what I want to achieve. Module tg3 has only on parameters which control the debug level. Currently I just call "sysctl net.ipv6.conf.enp4s0.disable_ipv6=3D1" in preup(), which works just fine. I 'm just wondering if there 's some more "proper" way to do it. Since in my opinion, this should be done at the first moment when the interface is present, not when the interface is up. --=20 Zesen Qian (=E9=92=B1=E6=B3=BD=E6=A3=AE)