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 ACAA81389E2 for ; Tue, 30 Dec 2014 10:49:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1739DE09BF; Tue, 30 Dec 2014 10:49:22 +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 1923DE09B1 for ; Tue, 30 Dec 2014 10:49:20 +0000 (UTC) Received: from Riaqn-ThinkPad.dorm.riaqn.com (unknown [111.186.3.78]) (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 6E4921C3C038E; Tue, 30 Dec 2014 18:49:15 +0800 (CST) From: Zesen Qian To: covici@ccs.covici.com 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> <9340.1419935236@ccs.covici.com> Date: Tue, 30 Dec 2014 18:49:04 +0800 In-Reply-To: <9340.1419935236@ccs.covici.com> (covici@ccs.covici.com's message of "Tue, 30 Dec 2014 05:27:16 -0500") Message-ID: <87y4ppmmzj.fsf@Riaqn-ThinkPad.dorm.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: ce094ebb-43ab-409b-b552-8e83b46bb8bc X-Archives-Hash: 7f68259f10124101537461aaddf1b73b covici@ccs.covici.com writes: > Mick wrote: > >> 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. >>=20 >>=20 >> Unless the kernel knows of the enp4s0 interface and therefore lists it u= nder=20 >> sysctl, I can't see how it can be disabled. You could try disabling IPv= 6=20 >> altogether in the kernel, but this may not be what you want to achieve. >>=20 >> Alternatively, have a look with modinfo in the module options in the unl= ikely=20 >> chance that the module has some option which disables IPv6 functionality. > > You may be able to use the feature of modprobe that executes a command > when the module loads and that way disable the ipv6 interface. I have > not tried this myself. Hello Covici, Yes, there's a rule named "install [command..]" in modprobe, but aren't they only applied to modprobe itself? I mean, in my case the ipv6 and tg3 is loaded automatically(maybe by udev?), not by running "modprobe ipv6". is this kind of module loading also affected by modprobe rule(in /etc/modprobe.d/*.conf)? --=20 Zesen Qian (=E9=92=B1=E6=B3=BD=E6=A3=AE)