This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions.
This article has been viewed 14,293 times.
Learn more...
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.[1] 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
-
1Press Ctrl+Alt+t on the keyboard. This opens a terminal window.
-
2Type sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 and press ↵ Enter.Advertisement
-
3Type sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 and press ↵ Enter.
-
4Type sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 and press ↵ Enter.
-
5Type 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.[2]
-
6Type 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.
-
7Edit 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"
-
8Edit the value of GRUB_CMDLINE_LINUX. Change this line so it looks like this:
- GRUB_CMDLINE_LINUX="ipv6.disable=1"
-
9Save and exit the configuration file. If you're using Vi, press the esc key, type wq!, and then press Enter.
-
10Type sudo update-grub at the prompt and press ↵ Enter. This ensures that IPv6 will remain disabled when you reboot your PC.[3]
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"