Inhaltsverzeichnis

Disable IPv6 persistent (Debian based systems)


Click on the code to copy to clipboard

Legacy method:

Edit the /etc/sysctl.d/99-sysctl.conf file:

sudo nano /etc/sysctl.d/99-sysctl.conf 


insert the following at the end:

# Disable IPv6 persistent
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
# optional
# net.ipv6.conf.lo.disable_ipv6 = 1 


then: enable and test with iptool:

sudo sysctl -p ; ip a 



On newer systems:


edit grub:

sudo nano /etc/default/grub



set:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"



sudo update-grub; \
sudo reboot



The proper way to disable IPv6 on a RaspberryPi:


Edit the file /boot/firmware/cmdline.txt (legacy: /boot/cmdline.txt) and add ipv6.disable=1 to the end of the line. It will look similar like this:

console=tty1 root=PARTUUID=cccba246-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=DE ipv6.disable=1



Enjoy!