Disabling IPv6 in Ubuntu Server 18.04












8















I was putting the following in /etc/sysctl.conf in Ubuntu 16.04 and ipv6 was disabled.



net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1


In Ubuntu 18.04 I have to add the following to grub.



GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"


Just wanted to have confirmation whether this is the new way in Ubuntu 18.04 to disable IPv6.










share|improve this question





























    8















    I was putting the following in /etc/sysctl.conf in Ubuntu 16.04 and ipv6 was disabled.



    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1


    In Ubuntu 18.04 I have to add the following to grub.



    GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"


    Just wanted to have confirmation whether this is the new way in Ubuntu 18.04 to disable IPv6.










    share|improve this question



























      8












      8








      8


      1






      I was putting the following in /etc/sysctl.conf in Ubuntu 16.04 and ipv6 was disabled.



      net.ipv6.conf.all.disable_ipv6 = 1
      net.ipv6.conf.default.disable_ipv6 = 1
      net.ipv6.conf.lo.disable_ipv6 = 1


      In Ubuntu 18.04 I have to add the following to grub.



      GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"


      Just wanted to have confirmation whether this is the new way in Ubuntu 18.04 to disable IPv6.










      share|improve this question
















      I was putting the following in /etc/sysctl.conf in Ubuntu 16.04 and ipv6 was disabled.



      net.ipv6.conf.all.disable_ipv6 = 1
      net.ipv6.conf.default.disable_ipv6 = 1
      net.ipv6.conf.lo.disable_ipv6 = 1


      In Ubuntu 18.04 I have to add the following to grub.



      GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"


      Just wanted to have confirmation whether this is the new way in Ubuntu 18.04 to disable IPv6.







      server 18.04






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 28 at 3:19









      Pablo Bianchi

      2,86521534




      2,86521534










      asked Jun 12 '18 at 23:27









      gagan singhgagan singh

      143113




      143113






















          2 Answers
          2






          active

          oldest

          votes


















          3














          You only need to add this to /etc/default/grub



          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          I also did it on GRUB_CMDLINE_LINUX_DEFAULT to be safe. Modifying sysctl only partially worked, and noticed the bug show-up in netplan, I even tried dhcp6=false to no avail. Netplan seems to have too many bugs for 18.04 STABLE IMO but that's another story...half tempted to remove netplan also.



          Just don't forget to update grub before rebooting!



          sudo update-grub





          share|improve this answer





















          • 1





            Can you clarify how this answers the question? I am confused by your answer.

            – Stephen Rauch
            Jun 13 '18 at 3:19






          • 1





            Please consider reporting the netplan bugs you found on launchpad.net! It will help the developers making it better.

            – Sebastian Stark
            Jun 13 '18 at 5:11











          • Sebastian Stark - I will try to get to it, it just does not seem to pay attention to kernel settings hence why the grub command was needed, everything else used sysctl.conf except netplan.

            – VTChevalier
            Jun 14 '18 at 19:21



















          11














          To clarify Stephan Rauch (for 18.04 only) -
          If using grub method to disable ipv6, the /etc/sysctl.conf configuration changes were not needed. I ended up leaving them in, (in case netplan is fixed in future) but all that is needed is the following:



          sudo vi /etc/default/grub


          Modify the GRUB_CMDLINEs to look like:



          GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          Then execute:



          sudo update-grub
          sudo reboot


          Enjoy ipv4.






          share|improve this answer
























          • Thanks for the info. Do we think this would be worthy of a netplan bug or is configuring things like this through sysctl.conf deprecated anyway? I couldn't find a relevant bug in bugs.launchpad.net/netplan but perhaps I missed it?

            – sxc731
            Dec 25 '18 at 12:03











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1046057%2fdisabling-ipv6-in-ubuntu-server-18-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          You only need to add this to /etc/default/grub



          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          I also did it on GRUB_CMDLINE_LINUX_DEFAULT to be safe. Modifying sysctl only partially worked, and noticed the bug show-up in netplan, I even tried dhcp6=false to no avail. Netplan seems to have too many bugs for 18.04 STABLE IMO but that's another story...half tempted to remove netplan also.



          Just don't forget to update grub before rebooting!



          sudo update-grub





          share|improve this answer





















          • 1





            Can you clarify how this answers the question? I am confused by your answer.

            – Stephen Rauch
            Jun 13 '18 at 3:19






          • 1





            Please consider reporting the netplan bugs you found on launchpad.net! It will help the developers making it better.

            – Sebastian Stark
            Jun 13 '18 at 5:11











          • Sebastian Stark - I will try to get to it, it just does not seem to pay attention to kernel settings hence why the grub command was needed, everything else used sysctl.conf except netplan.

            – VTChevalier
            Jun 14 '18 at 19:21
















          3














          You only need to add this to /etc/default/grub



          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          I also did it on GRUB_CMDLINE_LINUX_DEFAULT to be safe. Modifying sysctl only partially worked, and noticed the bug show-up in netplan, I even tried dhcp6=false to no avail. Netplan seems to have too many bugs for 18.04 STABLE IMO but that's another story...half tempted to remove netplan also.



          Just don't forget to update grub before rebooting!



          sudo update-grub





          share|improve this answer





















          • 1





            Can you clarify how this answers the question? I am confused by your answer.

            – Stephen Rauch
            Jun 13 '18 at 3:19






          • 1





            Please consider reporting the netplan bugs you found on launchpad.net! It will help the developers making it better.

            – Sebastian Stark
            Jun 13 '18 at 5:11











          • Sebastian Stark - I will try to get to it, it just does not seem to pay attention to kernel settings hence why the grub command was needed, everything else used sysctl.conf except netplan.

            – VTChevalier
            Jun 14 '18 at 19:21














          3












          3








          3







          You only need to add this to /etc/default/grub



          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          I also did it on GRUB_CMDLINE_LINUX_DEFAULT to be safe. Modifying sysctl only partially worked, and noticed the bug show-up in netplan, I even tried dhcp6=false to no avail. Netplan seems to have too many bugs for 18.04 STABLE IMO but that's another story...half tempted to remove netplan also.



          Just don't forget to update grub before rebooting!



          sudo update-grub





          share|improve this answer















          You only need to add this to /etc/default/grub



          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          I also did it on GRUB_CMDLINE_LINUX_DEFAULT to be safe. Modifying sysctl only partially worked, and noticed the bug show-up in netplan, I even tried dhcp6=false to no avail. Netplan seems to have too many bugs for 18.04 STABLE IMO but that's another story...half tempted to remove netplan also.



          Just don't forget to update grub before rebooting!



          sudo update-grub






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 28 at 3:22









          Pablo Bianchi

          2,86521534




          2,86521534










          answered Jun 13 '18 at 3:14









          VTChevalierVTChevalier

          1563




          1563








          • 1





            Can you clarify how this answers the question? I am confused by your answer.

            – Stephen Rauch
            Jun 13 '18 at 3:19






          • 1





            Please consider reporting the netplan bugs you found on launchpad.net! It will help the developers making it better.

            – Sebastian Stark
            Jun 13 '18 at 5:11











          • Sebastian Stark - I will try to get to it, it just does not seem to pay attention to kernel settings hence why the grub command was needed, everything else used sysctl.conf except netplan.

            – VTChevalier
            Jun 14 '18 at 19:21














          • 1





            Can you clarify how this answers the question? I am confused by your answer.

            – Stephen Rauch
            Jun 13 '18 at 3:19






          • 1





            Please consider reporting the netplan bugs you found on launchpad.net! It will help the developers making it better.

            – Sebastian Stark
            Jun 13 '18 at 5:11











          • Sebastian Stark - I will try to get to it, it just does not seem to pay attention to kernel settings hence why the grub command was needed, everything else used sysctl.conf except netplan.

            – VTChevalier
            Jun 14 '18 at 19:21








          1




          1





          Can you clarify how this answers the question? I am confused by your answer.

          – Stephen Rauch
          Jun 13 '18 at 3:19





          Can you clarify how this answers the question? I am confused by your answer.

          – Stephen Rauch
          Jun 13 '18 at 3:19




          1




          1





          Please consider reporting the netplan bugs you found on launchpad.net! It will help the developers making it better.

          – Sebastian Stark
          Jun 13 '18 at 5:11





          Please consider reporting the netplan bugs you found on launchpad.net! It will help the developers making it better.

          – Sebastian Stark
          Jun 13 '18 at 5:11













          Sebastian Stark - I will try to get to it, it just does not seem to pay attention to kernel settings hence why the grub command was needed, everything else used sysctl.conf except netplan.

          – VTChevalier
          Jun 14 '18 at 19:21





          Sebastian Stark - I will try to get to it, it just does not seem to pay attention to kernel settings hence why the grub command was needed, everything else used sysctl.conf except netplan.

          – VTChevalier
          Jun 14 '18 at 19:21













          11














          To clarify Stephan Rauch (for 18.04 only) -
          If using grub method to disable ipv6, the /etc/sysctl.conf configuration changes were not needed. I ended up leaving them in, (in case netplan is fixed in future) but all that is needed is the following:



          sudo vi /etc/default/grub


          Modify the GRUB_CMDLINEs to look like:



          GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          Then execute:



          sudo update-grub
          sudo reboot


          Enjoy ipv4.






          share|improve this answer
























          • Thanks for the info. Do we think this would be worthy of a netplan bug or is configuring things like this through sysctl.conf deprecated anyway? I couldn't find a relevant bug in bugs.launchpad.net/netplan but perhaps I missed it?

            – sxc731
            Dec 25 '18 at 12:03
















          11














          To clarify Stephan Rauch (for 18.04 only) -
          If using grub method to disable ipv6, the /etc/sysctl.conf configuration changes were not needed. I ended up leaving them in, (in case netplan is fixed in future) but all that is needed is the following:



          sudo vi /etc/default/grub


          Modify the GRUB_CMDLINEs to look like:



          GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          Then execute:



          sudo update-grub
          sudo reboot


          Enjoy ipv4.






          share|improve this answer
























          • Thanks for the info. Do we think this would be worthy of a netplan bug or is configuring things like this through sysctl.conf deprecated anyway? I couldn't find a relevant bug in bugs.launchpad.net/netplan but perhaps I missed it?

            – sxc731
            Dec 25 '18 at 12:03














          11












          11








          11







          To clarify Stephan Rauch (for 18.04 only) -
          If using grub method to disable ipv6, the /etc/sysctl.conf configuration changes were not needed. I ended up leaving them in, (in case netplan is fixed in future) but all that is needed is the following:



          sudo vi /etc/default/grub


          Modify the GRUB_CMDLINEs to look like:



          GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          Then execute:



          sudo update-grub
          sudo reboot


          Enjoy ipv4.






          share|improve this answer













          To clarify Stephan Rauch (for 18.04 only) -
          If using grub method to disable ipv6, the /etc/sysctl.conf configuration changes were not needed. I ended up leaving them in, (in case netplan is fixed in future) but all that is needed is the following:



          sudo vi /etc/default/grub


          Modify the GRUB_CMDLINEs to look like:



          GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
          GRUB_CMDLINE_LINUX="ipv6.disable=1"


          Then execute:



          sudo update-grub
          sudo reboot


          Enjoy ipv4.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 14 '18 at 19:25









          VTChevalierVTChevalier

          1563




          1563













          • Thanks for the info. Do we think this would be worthy of a netplan bug or is configuring things like this through sysctl.conf deprecated anyway? I couldn't find a relevant bug in bugs.launchpad.net/netplan but perhaps I missed it?

            – sxc731
            Dec 25 '18 at 12:03



















          • Thanks for the info. Do we think this would be worthy of a netplan bug or is configuring things like this through sysctl.conf deprecated anyway? I couldn't find a relevant bug in bugs.launchpad.net/netplan but perhaps I missed it?

            – sxc731
            Dec 25 '18 at 12:03

















          Thanks for the info. Do we think this would be worthy of a netplan bug or is configuring things like this through sysctl.conf deprecated anyway? I couldn't find a relevant bug in bugs.launchpad.net/netplan but perhaps I missed it?

          – sxc731
          Dec 25 '18 at 12:03





          Thanks for the info. Do we think this would be worthy of a netplan bug or is configuring things like this through sysctl.conf deprecated anyway? I couldn't find a relevant bug in bugs.launchpad.net/netplan but perhaps I missed it?

          – sxc731
          Dec 25 '18 at 12:03


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1046057%2fdisabling-ipv6-in-ubuntu-server-18-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Human spaceflight

          Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

          張江高科駅