If you're not using IPv6 on your network, there's typically no harm in leaving it enabled on your Linux PC. However, if you're using a IPv4 VPN, leaving IPv6 enabled may leak network traffic while the VPN is in use. This wikiHow teaches you how to disable IPv6 in Ubuntu, Debian, and Linux Mint. If you want to disable IPv6 permanently, you'll need to make some quick changes to your boot loader.
Steps
-
Press Ctrl + Alt + t on the keyboard. This opens a terminal window.
-
Type sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 and press ↵ Enter .Advertisement
-
Type sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 and press ↵ Enter .
-
Type sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 and press ↵ Enter .
-
Type cat /proc/sys/net/ipv6/conf/all/disable_ipv6 and press ↵ Enter . As long as you see "1" as the result, you can continue to the next step.
- If you see "0" instead, type sudo sysctl -p and press Enter . You will see three entries that all end with "1," which means you can continue. [1] X Research source
-
Type sudo vi /etc/default/grub and press ↵ Enter . The remaining steps will make it so you IPv6 remains disabled even after you reboot your PC. You'll be prompted to enter your password.
- If you prefer to use a text editor other than Vi, such as Nano or Pico, feel free to use that instead.
- Enter your password when prompted to do so.
-
Edit the value of GRUB_CMDLINE_LINUX_DEFAULT. The current value is probably blank. Edit it so it looks like this instead:
- GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
- If there were any other parameters here, such as "quiet splash," simply separate that parameter from the new one with a space (e.g., GRUB_CMDLINE_LINUX_DEFAULT="quiet spash ipv6.disable=1"
-
Edit the value of GRUB_CMDLINE_LINUX. Change this line so it looks like this:
- GRUB_CMDLINE_LINUX="ipv6.disable=1"
-
Save and exit the configuration file. If you're using Vi, press the esc key, type wq! , and then press Enter .
-
Type sudo update-grub at the prompt and press ↵ Enter . This ensures that IPv6 will remain disabled when you reboot your PC. [2] X Research source
Expert Q&A
Tips
References
About This Article
1. Run "sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1"
2. Run "sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1"
3. Run "sysctl -w net.ipv6.conf.lo.disable_ipv6=1"
4. Open /etc/default/grub for editing (needs root).
5. Make the values for GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX " ipv6.disable=1""
6. Save and exit your text editor.
7. Run "sudo update-grub"