Disabling IPv6 from Raspbian and RHEL

Quick tip on how to disable IPv6 from Raspberry Raspbian and RHEL-like distributions:


Open (or create) /boot/cmdline.txt file and add the following line:


Reboot your Rasp and it is done.

RHEL (RHEL, CentOS, Fedora, …)

Open /etc/default/grub file and add the ipv6.disable=1 parameter to the end of GRUB_CMDLINE_LINUX:

GRUB_CMDLINE_LINUX="rhgb quiet ipv6.disable=1"

Then you need to recreate the grub.cfg config file to reflect this new change.

If you are running on BIOS/Legacy mode:

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

If you are running on UEFI mode:

$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Reboot your machine for this change to take effect.

Share Comments