Re: Disabling IPv6 by default when creating a new namespace in Linux

Dheeraj Kandula <[email protected]> Tue, 7 Jun 2022 15:49:19 -0400
Newsgroups gmane.linux.debian.devel.ipv6
Message-ID <CA+qNgxQ0B88AavFMvx3Lx+y5k0uP4PzDH8+AfrzU-d_aHKH94g@mail.gmail.com>
--000000000000109adb05e0e0e340
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi All,
       If this is not supported in Linux, can I go ahead and file a
bug/enhancement request against the Linux kernel?

Dheeraj

On Tue, Jun 7, 2022 at 3:31 PM Dheeraj Kandula <[email protected]> wrote:

> 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 enab=
le
> 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 he=
re:
>> 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 confus=
ed
>> 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 l=
ine,
>> >     then it will be.
>> >
>> >
>> >     Bj=C3=B8rn
>> >
>> >
>>
>>

--000000000000109adb05e0e0e340
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi All,</div><div>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 If this is not supported in Linux, can I go ahead and file a bug/enhanc=
ement request against the Linux kernel?</div><div><br></div><div>Dheeraj<br=
></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Tue, Jun 7, 2022 at 3:31 PM Dheeraj Kandula &lt;<a href=3D"mailto=
:[email protected]">[email protected]</a>&gt; wrote:<br></div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>Thanks Marc fo=
r your email. With the grub option, the IPv6 feature itself may have been r=
emoved 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.</div=
><div><br></div><div>If disabled, IPv6 should be disabled on current namesp=
aces and future namespaces, until I enable IPv6 again.</div><div><br></div>=
<div>Is this possible in Linux?</div><div><br></div><div>Dheeraj<br></div><=
/div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">O=
n Tue, Jun 7, 2022 at 2:38 PM &lt;<a href=3D"mailto:[email protected]"=
 target=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex">Dheeraj,<br>
<br>
You don&#39;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 &lt;<a href=3D"mailto:[email protected]=
om" target=3D"_blank">[email protected]</a>&gt; wrote:<br>
&gt; Thanks Bj=C3=B8rn for your response. I think I am getting a bit confus=
ed here.<br>
&gt; <br>
&gt; I booted up my Linux VM and set the following in my /etc/sysctl.conf f=
ile:<br>
&gt; <br>
&gt; net.ipv6.conf.all.disable_ipv6=3D1<br>
&gt; net.ipv6.conf.default.disable_ipv6=3D1<br>
&gt; <br>
&gt; I saved the file.<br>
&gt; <br>
&gt; *I rebooted my VM.*<br>
&gt; <br>
&gt; After reboot, I check the value of <br>
&gt; &quot;/sys/module/ipv6/parameters/disable_ipv6&quot;. *It is still 0.*=
<br>
&gt; <br>
&gt; As it is still 0, the new namespaces are created with IPv6 enabled. Is=
 <br>
&gt; this a bug in the kernel code?<br>
&gt; <br>
&gt; Dheeraj<br>
&gt; <br>
&gt; On Tue, Jun 7, 2022 at 2:17 PM Bj=C3=B8rn Mork &lt;<a href=3D"mailto:b=
[email protected]" target=3D"_blank">[email protected]</a> <br>
&gt; &lt;mailto:<a href=3D"mailto:[email protected]" target=3D"_blank">bjorn@mo=
rk.no</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Dheeraj Kandula &lt;<a href=3D"mailto:dkandula@gmai=
l.com" target=3D"_blank">[email protected]</a> &lt;mailto:<a href=3D"mailt=
o:[email protected]" target=3D"_blank">[email protected]</a>&gt;&gt; writ=
es:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; On my system I see the following values:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $cat /sys/module/ipv6/parameters/disable_ipv6=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; 0<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Yes, that&#39;s the default unless you change it..<=
br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Are you suggesting that &quot;cat<br>
&gt;=C2=A0 =C2=A0 =C2=A0/sys/module/ipv6/parameters/disable_ipv6&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; should be 1?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Yes, And if you boot with &quot;ipv6.disable_ipv6=
=3D1&quot; on the command line,<br>
&gt;=C2=A0 =C2=A0 =C2=A0then it will be.<br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Bj=C3=B8rn<br>
&gt; <br>
&gt; <br>
<br>
</blockquote></div>
</blockquote></div>

--000000000000109adb05e0e0e340--