Skip to main content

How disable IPv6 networking on Linux

· One min read

sysctl

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
sudo sysctl -p

or append the following lines to /etc/sysctl.conf

sudo nano /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

and apply changes (or reboot)

sudo sysctl -p

grub

Add the following param ipv6.disable=1 to /etc/default/grub

sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

and apply changes

sudo update-grub

Apply grub changes in Arch Linux

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