Gentoo Archives: gentoo-user

From: covici@××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Disable IPv6 on specific interface
Date: Tue, 30 Dec 2014 10:27:25
Message-Id: 9340.1419935236@ccs.covici.com
In Reply to: Re: [gentoo-user] Disable IPv6 on specific interface by Mick
1 Mick <michaelkintzios@×××××.com> wrote:
2
3 > On Tuesday 30 Dec 2014 03:27:34 Zesen Qian wrote:
4 > > Hello list,
5 > > Sorry for hijacking Rich's thread, resend here.
6 > > I want to disable IPv6 on an certain interface, a simple google
7 > > tell me to add one line to /etc/sysctl.d/local.conf
8 > > net.ipv6.conf.enp4s0.disable_ipv6=1
9 > > Simple enough, but the problem I have is that both ipv6 and the
10 > > dirver of the network card(tg3) is loaded by modules. They 're not
11 > > loaded when the service sysctl is started, so there's no entry
12 > > named "net.ipv6.conf.enp4s0", which make sysctl not working.
13 > > So my question is that, is there any way to disable IPv6 on
14 > > specific interface, as early as I can? I want to make it early
15 > > because I don't want to receive any RA to mess up my route table.
16 > > I guess just adding sysctl to preup() in /etc/conf.d/net should do
17 > > the trick, but may I make it earlier?
18 > > Any comment is appreciated.
19 >
20 >
21 > Unless the kernel knows of the enp4s0 interface and therefore lists it under
22 > sysctl, I can't see how it can be disabled. You could try disabling IPv6
23 > altogether in the kernel, but this may not be what you want to achieve.
24 >
25 > Alternatively, have a look with modinfo in the module options in the unlikely
26 > chance that the module has some option which disables IPv6 functionality.
27
28 You may be able to use the feature of modprobe that executes a command
29 when the module loads and that way disable the ipv6 interface. I have
30 not tried this myself.
31
32
33 --
34 Your life is like a penny. You're going to lose it. The question is:
35 How do
36 you spend it?
37
38 John Covici
39 covici@××××××××××.com

Replies

Subject Author
Re: [gentoo-user] Disable IPv6 on specific interface Zesen Qian <gentoo-user@×××××.com>