On paper, IPv6 is a great thing because there are 340 undecillion addresses available, and it can be allocated uniquely to every device connected to the internet.
But along with that, it comes with many issues. One thing that we found during our testing is that all the services that are running on your device are directly exposed to the internet if you are not using any firewall that monitors inbound connection.
The best thing we could do was turn off IPv6 network-wide using the router settings. But on our Raspberry Pi, we found one other issue. Since we are using docker to run multiple services, it has IPv6 on by default. Combining that with the Cloudflare Tunnel that we use to access the device creates a lot of conflict with IPv6, and sometimes, we cannot access the Raspberry Pi remotely even if it is connected to the internet.
Also read: How to Automatically Spin Down or Sleep HDD on Raspberry Pi
To us, disabling IPv6 was the only feasible way to go, and this is valid for most of the users.
Steps to Disable IPv6 Permanently on Raspberry Pi
Disabling IPv6 system-wide on Raspberry Pi is quite simple, using a few steps.
- Check if the IPv6 address is showing for any available network interfaces using the command below
ifconfig
- Type the following to edit /boot/cmdline.txt
sudo nano /boot/cmdline.txt
- Add the following at the end of the file
ipv6.disable=1
- Save the file and reboot
sudo reboot
- Check again to see if the IPv6 is disabled for all network interfaces.
ifconfig
Also read: How to Setup Watchdog on Raspberry Pi
So that was all. There are various methods that you will find online, but this is the simplest and the most effective one.