* [gentoo-user] Disable IPv6 on specific interface @ 2014-12-30 3:27 Zesen Qian 2014-12-30 9:39 ` Mick 0 siblings, 1 reply; 7+ messages in thread From: Zesen Qian @ 2014-12-30 3:27 UTC (permalink / raw To: gentoo-user 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. -- Zesen Qian (钱泽森) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Disable IPv6 on specific interface 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 2014-12-30 10:27 ` covici 0 siblings, 2 replies; 7+ messages in thread From: Mick @ 2014-12-30 9:39 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: Text/Plain, Size: 1297 bytes --] 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. -- Regards, Mick [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Disable IPv6 on specific interface 2014-12-30 9:39 ` Mick @ 2014-12-30 10:10 ` Zesen Qian 2014-12-30 10:31 ` Mick 2014-12-30 10:27 ` covici 1 sibling, 1 reply; 7+ messages in thread From: Zesen Qian @ 2014-12-30 10:10 UTC (permalink / raw To: Mick; +Cc: gentoo-user 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 (钱泽森) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Disable IPv6 on specific interface 2014-12-30 10:10 ` Zesen Qian @ 2014-12-30 10:31 ` Mick 0 siblings, 0 replies; 7+ messages in thread From: Mick @ 2014-12-30 10:31 UTC (permalink / raw To: Zesen Qian; +Cc: gentoo-user [-- Attachment #1: Type: Text/Plain, Size: 2354 bytes --] On Tuesday 30 Dec 2014 10:10:04 Zesen Qian wrote: > 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. Right, I didn't think that you would want to disable IPv6 completely, but 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 configure IPv6, but it was worth checking. > 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. I'm afraid I don't know of any other way to do it. -- Regards, Mick [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Disable IPv6 on specific interface 2014-12-30 9:39 ` Mick 2014-12-30 10:10 ` Zesen Qian @ 2014-12-30 10:27 ` covici 2014-12-30 10:49 ` Zesen Qian 1 sibling, 1 reply; 7+ messages in thread From: covici @ 2014-12-30 10:27 UTC (permalink / raw To: gentoo-user Mick <michaelkintzios@gmail.com> 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=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. 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. -- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Disable IPv6 on specific interface 2014-12-30 10:27 ` covici @ 2014-12-30 10:49 ` Zesen Qian 2014-12-30 13:15 ` covici 0 siblings, 1 reply; 7+ messages in thread From: Zesen Qian @ 2014-12-30 10:49 UTC (permalink / raw To: covici; +Cc: gentoo-user covici@ccs.covici.com writes: > Mick <michaelkintzios@gmail.com> 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=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. > > 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 <modulename> [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)? -- Zesen Qian (钱泽森) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Disable IPv6 on specific interface 2014-12-30 10:49 ` Zesen Qian @ 2014-12-30 13:15 ` covici 0 siblings, 0 replies; 7+ messages in thread From: covici @ 2014-12-30 13:15 UTC (permalink / raw To: Zesen Qian; +Cc: gentoo-user Zesen Qian <gentoo-user@dnspod-free.mydnspod.net> wrote: > covici@ccs.covici.com writes: > > > Mick <michaelkintzios@gmail.com> 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=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. > > > > 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 <modulename> [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)? I think so, as I use it for my soundcard modules which udev loads. -- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-12-30 13:16 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox