How does one disable IPv6 completely (for all interfaces, resp. for the whole machine?
Keep in mind, I don't want any kind of GUI solution.
OS in question:
Linux Mint 18.x Cinnamon 64-bit
GNU/Linux Debian 9.x Cinnamon 64-bit
One needs to edit the following file:
/etc/sysctl.conf to add the following lines, preferably to the end of the file:
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 Once done, you may either reboot the machine, or type the following:
sudo sysctl --load=/etc/sysctl.conf For other OSes it might be worth noting, if it does not read that file at boot time, there's an alternative approach.
One needs to edit the following file:
/etc/default/grub to add the following appendix:
ipv6.disable=1 to the following variable:
GRUB_CMDLINE_LINUX_DEFAULT so it might look like for instance in my case like this:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
Once edited, you need to call:
sudo update-grub and reboot the machine.
But as pointed out by Rui F Ribeiro, you should do both methods, because:
If you in the future upgrade allow update of your grub file, you have the safety in form of sysctl settings.
With only the sysctl method, the ipv6 module is still loaded.