Re: Disabling IPv6 by default when creating a new namespace in Linux
Dheeraj Kandula <[email protected]> Tue, 7 Jun 2022 15:31:40 -0400
| Newsgroups | gmane.linux.debian.devel.ipv6 |
|---|---|
| Message-ID | <CA+qNgxTTguQFVD3mF=tZz0U+HuMa7Psbk4y05SS_yP4BEM_xMw@mail.gmail.com> |
--000000000000fba7ff05e0e0a34c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Marc for your email. With the grub option, the IPv6 feature itself may have been removed from the running Linux kernel. But, I want IPv6 functionality to be present in the kernel but with the capability to enable or disable it. If disabled, IPv6 should be disabled on current namespaces and future namespaces, until I enable IPv6 again. Is this possible in Linux? Dheeraj On Tue, Jun 7, 2022 at 2:38 PM <[email protected]> wrote: > Dheeraj, > > You don't need to touch the /etc/sysctl.conf. You need to touch your > bootloader configuration file. You can see an example of how to do it her= e: > https://www.thegeekdiary.com/centos-rhel-7-how-to-disable-ipv6/ > > On 07/06/2022 15:33, Dheeraj Kandula <[email protected]> wrote: > > Thanks Bj=C3=B8rn for your response. I think I am getting a bit confuse= d here. > > > > I booted up my Linux VM and set the following in my /etc/sysctl.conf > file: > > > > net.ipv6.conf.all.disable_ipv6=3D1 > > net.ipv6.conf.default.disable_ipv6=3D1 > > > > I saved the file. > > > > *I rebooted my VM.* > > > > After reboot, I check the value of > > "/sys/module/ipv6/parameters/disable_ipv6". *It is still 0.* > > > > As it is still 0, the new namespaces are created with IPv6 enabled. Is > > this a bug in the kernel code? > > > > Dheeraj > > > > On Tue, Jun 7, 2022 at 2:17 PM Bj=C3=B8rn Mork <[email protected] > > <mailto:[email protected]>> wrote: > > > > Dheeraj Kandula <[email protected] <mailto:[email protected]>> > writes: > > > > > On my system I see the following values: > > > > > > $cat /sys/module/ipv6/parameters/disable_ipv6 > > > 0 > > > > Yes, that's the default unless you change it.. > > > > > Are you suggesting that "cat > > /sys/module/ipv6/parameters/disable_ipv6" > > > should be 1? > > > > Yes, And if you boot with "ipv6.disable_ipv6=3D1" on the command li= ne, > > then it will be. > > > > > > Bj=C3=B8rn > > > > > > --000000000000fba7ff05e0e0a34c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Thanks Marc for your email. With the grub option, the= IPv6 feature itself may have been removed from the running Linux kernel. B= ut, I want IPv6 functionality to be present in the kernel but with the capa= bility to enable or disable it.</div><div><br></div><div>If disabled, IPv6 = should be disabled on current namespaces and future namespaces, until I ena= ble IPv6 again.</div><div><br></div><div>Is this possible in Linux?</div><d= iv><br></div><div>Dheeraj<br></div></div><br><div class=3D"gmail_quote"><di= v dir=3D"ltr" class=3D"gmail_attr">On Tue, Jun 7, 2022 at 2:38 PM <<a hr= ef=3D"mailto:[email protected]">[email protected]</a>> wrote:<= br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e= x;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dheeraj,<br> <br> You don't need to touch the /etc/sysctl.conf. You need to touch your bo= otloader configuration file. You can see an example of how to do it here: <= a href=3D"https://www.thegeekdiary.com/centos-rhel-7-how-to-disable-ipv6/" = rel=3D"noreferrer" target=3D"_blank">https://www.thegeekdiary.com/centos-rh= el-7-how-to-disable-ipv6/</a><br> <br> On 07/06/2022 15:33, Dheeraj Kandula <<a href=3D"mailto:[email protected]= om" target=3D"_blank">[email protected]</a>> wrote:<br> > Thanks Bj=C3=B8rn for your response. I think I am getting a bit confus= ed here.<br> > <br> > I booted up my Linux VM and set the following in my /etc/sysctl.conf f= ile:<br> > <br> > net.ipv6.conf.all.disable_ipv6=3D1<br> > net.ipv6.conf.default.disable_ipv6=3D1<br> > <br> > I saved the file.<br> > <br> > *I rebooted my VM.*<br> > <br> > After reboot, I check the value of <br> > "/sys/module/ipv6/parameters/disable_ipv6". *It is still 0.*= <br> > <br> > As it is still 0, the new namespaces are created with IPv6 enabled. Is= <br> > this a bug in the kernel code?<br> > <br> > Dheeraj<br> > <br> > On Tue, Jun 7, 2022 at 2:17 PM Bj=C3=B8rn Mork <<a href=3D"mailto:b= [email protected]" target=3D"_blank">[email protected]</a> <br> > <mailto:<a href=3D"mailto:[email protected]" target=3D"_blank">bjorn@mo= rk.no</a>>> wrote:<br> > <br> >=C2=A0 =C2=A0 =C2=A0Dheeraj Kandula <<a href=3D"mailto:dkandula@gmai= l.com" target=3D"_blank">[email protected]</a> <mailto:<a href=3D"mailt= o:[email protected]" target=3D"_blank">[email protected]</a>>> writ= es:<br> > <br> >=C2=A0 =C2=A0 =C2=A0 > On my system I see the following values:<br> >=C2=A0 =C2=A0 =C2=A0 ><br> >=C2=A0 =C2=A0 =C2=A0 > $cat /sys/module/ipv6/parameters/disable_ipv6= <br> >=C2=A0 =C2=A0 =C2=A0 > 0<br> > <br> >=C2=A0 =C2=A0 =C2=A0Yes, that's the default unless you change it..<= br> > <br> >=C2=A0 =C2=A0 =C2=A0 > Are you suggesting that "cat<br> >=C2=A0 =C2=A0 =C2=A0/sys/module/ipv6/parameters/disable_ipv6"<br> >=C2=A0 =C2=A0 =C2=A0 > should be 1?<br> > <br> >=C2=A0 =C2=A0 =C2=A0Yes, And if you boot with "ipv6.disable_ipv6= =3D1" on the command line,<br> >=C2=A0 =C2=A0 =C2=A0then it will be.<br> > <br> > <br> >=C2=A0 =C2=A0 =C2=A0Bj=C3=B8rn<br> > <br> > <br> <br> </blockquote></div> --000000000000fba7ff05e0e0a34c--