How do i disable system wide IPv6 within ubuntu?

I know so many answers in here about this but situation is different. This is an embedded device.

Here is my conditions:

  • IPv6 disabled in kernel to gain some space
  • Bootloader is u-boot

According to here >> How to dynamically enable and disable ipv6 on an interface here is what i tried:

  1. *net.ipv6.conf.** was not worked in sysctl.conf because there is no /proc/sys/net/ipv6/ folder
  2. Could not configure from grub because there is no grub (:

Digging within google gave me the same solutions. And still IPv6 couses problems with my wireless.

Any idea how to do?

  • Can you run sysctl -a | grep ipv6, to check any ipv6 related settings, please? – Jacek Sep 17 '15 at 14:42
  • But anyway - if you want it disabled completely during the boot time in kernel - u-boot also seems to allow passing some kernel arguments, but quite honestly, I'm not very familiar with it to give a straight answer right now. – Jacek Sep 17 '15 at 14:48
  • Sorry for late response. There is nothing about ipv 6 in sysctl output. Isn't there must ve sth about ipv6 disabled? Yes i checked u-boot parameters in forums but everyone says the same solution "there must be a parameter" (: But i think there is not, or i cant found at least. – obayhan Sep 18 '15 at 5:34
  • Sorry about typo . It must be " Isn't there must be something about ipv6 disabled?" – obayhan Sep 18 '15 at 6:12
  • if sysctl doesn't show ipv6 entries, the good thing is it's already disabled - so related modules and ipv6 stack doesn't load. As for u-boot configuration - you will unfortunately have to dig it yourself, unless someone else here knows the ready answer, I'm afraid. – Jacek Sep 18 '15 at 7:52

I think that if you worry about the little space that the IPv6 kernel module takes then you should probably be compiling your own kernel...

  • Yes i am compiling my own kernel but which part of the post is answer i cant understand sorry. – obayhan Sep 18 '15 at 5:37
  • If you really compile your own kernel without ipv6 you most likely don't have to use boot loaded to disable it (you can't disable something that's not there). Unless you're confused about compiling your own kernel. But anyway - unless you're really very limited with disk/memory space - just basically disable modules, you don't need - modular construction of kernel helps in this kind of situations. – Jacek Sep 18 '15 at 7:55
  • i got 1.9M size about kernel , and 0.5 M for modules to fit them in EPROM. So i need to keep IPv6 to the out of the game. Because it is large and i could use this space for something more necessary. So yes i really need this space. – obayhan Sep 18 '15 at 8:29

The easiest way I found was to edit /etc/default/grub with sudo powers and change the kernel command line with:

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"

Then save the file, followed by the customary:

sudo update-grub
  • İ guess you missed Bootloader is u-boot part – obayhan Oct 14 '20 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.