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 BEF5F1389E2 for ; Tue, 30 Dec 2014 10:31:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 962D2E09C5; Tue, 30 Dec 2014 10:31:51 +0000 (UTC) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 861B8E096C for ; Tue, 30 Dec 2014 10:31:50 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id k14so2610412wgh.30 for ; Tue, 30 Dec 2014 02:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=Pv+sVOnzL6mYFe5ZJLNtDcV9KphF0+VgE4iBk/MuEr4=; b=OjLzQSqi+GnxZoYFzN9Uh+6Sa/xVOTqYrKw0mTMIfVWkoiXoSAfmmdHiZyUocZU2uI /qx4FO/oc/ZNs1j2bEa9XVhSkoUZrZF5N3CfHlFMmDBJk60u6XKTPWZArkb35VIiMAIV uC6fTrQmgWzfM+9u/Q//fvHM7LwOqLbwEvDRVWP2EVu3VTQAg3URRHPQDWEb5worHPDM jAI2AZcyXfBq2yu1iwP33TFW4MJ5h+c0LtjFw3o8+lPO9ZFcz2eehsMpfuTWAeo+CV4J Rx3devJcoOPpROprerZXTo9zceVdVSZumo4VEZrhRH3k5yR5sTGIrpExfDz/f+73XJ4H NVpg== X-Received: by 10.194.59.33 with SMTP id w1mr120517090wjq.123.1419935509469; Tue, 30 Dec 2014 02:31:49 -0800 (PST) Received: from dell_xps.localnet (230.3.169.217.in-addr.arpa. [217.169.3.230]) by mx.google.com with ESMTPSA id u13sm50502178wjr.26.2014.12.30.02.31.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Dec 2014 02:31:48 -0800 (PST) From: Mick To: Zesen Qian Subject: Re: [gentoo-user] Disable IPv6 on specific interface Date: Tue, 30 Dec 2014 10:31:26 +0000 User-Agent: KMail/1.13.7 (Linux/3.17.7-gentoo; KDE/4.14.3; x86_64; ; ) Cc: gentoo-user@lists.gentoo.org References: <87zja5g6l5.fsf@riaqn.com> <201412300939.45311.michaelkintzios@gmail.com> <87tx0dfnyb.fsf@riaqn.com> In-Reply-To: <87tx0dfnyb.fsf@riaqn.com> 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: multipart/signed; boundary="nextPart1545421.uPMWzdDg6A"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201412301031.42590.michaelkintzios@gmail.com> X-Archives-Salt: 79428e24-505c-43cb-a61c-bc12100586e4 X-Archives-Hash: 618f124704660431652fb5bc964d24b7 --nextPart1545421.uPMWzdDg6A Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tuesday 30 Dec 2014 10:10:04 Zesen Qian wrote: > 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. > >=20 > > Unless the kernel knows of the enp4s0 interface and therefore lists it > > under sysctl, I can't see how it can be disabled. You could try > > disabling IPv6 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 > > unlikely chance that the module has some option which disables IPv6 > > functionality. >=20 > 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.=20 Right, I didn't think that you would want to disable IPv6 completely, but=20 mentioned it for completeness. > Module tg3 has > only on parameters which control the debug level. Yes, I thought it unlikely that a hardware driver would be used to configur= e=20 IPv6, but it was worth checking. > 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. I'm afraid I don't know of any other way to do it. =2D-=20 Regards, Mick --nextPart1545421.uPMWzdDg6A Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJUon8OAAoJELAdA+zwE4YeRjwIAJ0RLPNejG4GUA6K1f5IYFhA vJT/RfFAHjk4EvR/urB417DlE6LAh25pIT0V/kD57sUetG/aZuZQRDizSUeFMYSb 9UvgUSTcae/dw+QUzo/tDo7WyNhmcfq0SZ4b8KynLiT/YobdXxG63him7QsQOYEu 4bjdTD4HoMq9Hd4DjSVtrBu6ROL9rLnzsBUcI1/f7Skb18FnPuXiBYmWgo/mHlCF i9DMHMv/HviZfXFgHfrzVDzOK6OZHLeaWIHYdkyP5oxvnqRkxjD37Jh8y/ixopTF +NCoSaC4XFU8MeOH5Fz3US9p0kvLs3xsCGIESDeRyvJWCXAafanuk1uDsa2o+jg= =aE3s -----END PGP SIGNATURE----- --nextPart1545421.uPMWzdDg6A--