How to Disable IPv6 on Linux
Published on 2023-11-27
sysctl
Do not use the sysctl
method. Other tutorials show it and IPv6 will just re-enable itself after packages update.
GRUB
sudo nano /etc/default/grub
Locate this like: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
.
Add ipv6.disable=1
.
Now, it will look like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
.
Press Ctrl + O then Enter.
Run: sudo update-grub
Restart your PC.