1 |
Mick <michaelkintzios@×××××.com> writes: |
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 |
Hello Mick, |
29 |
The module ipv6 has only three parameters, each of which is "disable |
30 |
ipv6", "disable ipv6 on all interfaces", "disable autoconf on all |
31 |
interfaces", none of these is what I want to achieve. Module tg3 has |
32 |
only on parameters which control the debug level. |
33 |
Currently I just call "sysctl net.ipv6.conf.enp4s0.disable_ipv6=1" in |
34 |
preup(), which works just fine. I 'm just wondering if there 's some |
35 |
more "proper" way to do it. Since in my opinion, this should be done at |
36 |
the first moment when the interface is present, not when the interface |
37 |
is up. |
38 |
|
39 |
-- |
40 |
Zesen Qian (钱泽森) |