public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zesen Qian <gentoo-user@riaqn.com>
To: Mick <michaelkintzios@gmail.com>
Cc: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Disable IPv6 on specific interface
Date: Tue, 30 Dec 2014 18:10:04 +0800	[thread overview]
Message-ID: <87tx0dfnyb.fsf@riaqn.com> (raw)
In-Reply-To: <201412300939.45311.michaelkintzios@gmail.com> (Mick's message of "Tue, 30 Dec 2014 09:39:35 +0000")

Mick <michaelkintzios@gmail.com> 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=1
>> 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 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.
>
> Alternatively, have a look with modinfo in the module options in the unlikely 
> 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=1" 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.

-- 
Zesen Qian (钱泽森)


  reply	other threads:[~2014-12-30 10:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-30  3:27 [gentoo-user] Disable IPv6 on specific interface Zesen Qian
2014-12-30  9:39 ` Mick
2014-12-30 10:10   ` Zesen Qian [this message]
2014-12-30 10:31     ` Mick
2014-12-30 10:27   ` covici
2014-12-30 10:49     ` Zesen Qian
2014-12-30 13:15       ` covici

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tx0dfnyb.fsf@riaqn.com \
    --to=gentoo-user@riaqn.com \
    --cc=gentoo-user@lists.gentoo.org \
    --cc=michaelkintzios@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox