The IP address also known as Internet Protocol is a unique identification number that is assigned to every Internet-connected device and allows devices to receive and send information over the Internet. Without an IP address of devices, Internet access would not be possible. There are mainly two types of IP addresses used by the system: IPv4 (32-bit) and IPv6 (128-bit).
The latest version of Internet Protocol known as IPv6 (Internet Protocol Version 6) is used to identify devices on networks. It is supported and enabled on Mac, Linux, and Windows devices. On Debian 12, it is enabled by default. However, in some cases, Debian users want to disable it because some hardware, software, and network connected devices are incompatible with IPv6. Thus, causing issues and may not work properly on your system.
The main purpose of this guide is to demonstrate the steps to disable IPv6 on Debian 12.
Quick Outline
- What is IPv6
- Is it Safe to Disable IPv6 on Debian 12
- How to Verify IPv6 Status on Debian 12
- How to Disable IPv6 on Debian 12
- How to Temporarily Disable IPv6 on Debian 12
- Conclusion
What is IPv6
IPv6 is an advanced form of IPv4 and is more unique and longer compared to IPv4. It has eight sets of four hexadecimal numbers, with colons rather than full stops between them. It is more efficient and provides auto-configuration, simplified package headers, and advanced security features.
Is it Safe to Disable IPv6 on Debian 12
Yes, it is safe to disable IPv6 as there might be some reasons users want to only use IPv4. IPv6 can cause accessibility issues as supported by only one-third of devices. However, it is not recommended to disable IPv6 as it has a solution to many limitations of IPv4.
In the following specific scenarios, you can disable the IPv6 on Debian 12:
- You are more familiar with the tools of IPv4 used for managing networks.
- Certain Firewall configurations don’t support IPv6.
- IPv6 can be complex in structure and management.
- Some users disable IPv6 because they do not run any devices or applications that depend on IPv6.
- Users might want to disable IPv6 while troubleshooting network issues.
How to Verify IPv6 Status on Debian 12
By default, IPv6 is enabled on your system, which you can also check by running the following sysctl command on Debian:
In the above screenshot, 0 is showing that IPv6 is enabled.
You can aslo run the below-given ifconfig command to check for the status of IPv6 on your Debian system:
Or simply run the following ip command to get the similar output if ifconfig command is not working:
How to Disable IPv6 on Debian 12
The following are the two ways to disable IPv6 on Debian 12:
How to Disable IPv6 on Debian 12 Through Terminal
You can disable IPv6 on Debian 12 by:
Note: You must have root privileges to disable IPv6 using the above-mentioned methods.
1: Use sysctl.config File to Disable IPv6 on Debian 12 Through Terminal
The sysctl file is a configuration file on Linux system that is used for reading and modifying the current Kernel configuration settings including disabling the IPv6 as well. You can follow the below-given steps to disable IPv6 by making changes in sysctl.config file on Debian:
Step 1: On the Debian 12 terminal, execute the following command to open the sysctl.conf file:
If nano is not installed on your system, execute the following command to install nano or use another file editing utility:
Step 2: Next, scroll down and add the following three lines at the end of the file:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Press Ctrl + X, add Y and press Enter to save the file and exit back to the terminal.
Step 3: Next, on the terminal, run the following command to apply changes to the configuration file:
Step 4: Now check the status of IPv6 on Debian by executing the following command:
If you see 1 in the output of the above command, the IPv6 is not running on your device anymore as the 1 means IPv6 is disabled, whereas the 0 means IPv6 is enabled.
Note: To re-enable the IPv6 repeat the above steps and remove the lines you have added in Step 2 from the sysctl.config file, then apply the changes and reboot the system to enable IPv6.
2: Disable IPv6 on Debian Using GRUB on Terminal
You can also disable IPv6 on Debian from the GRUB menu, however, before disabling the IPv6, first run the following sysctl command to ensure IPv6 is enabled on Debian:
The output suggests IPv6 is enabled on your Debian system.
Now, use the following steps to disable IPv6 using GRUB on Debian 12:
Step 1: First, open the GRUB configuration file on Debian using the following command:
Step 2: Next, find the below-mentioned lines in the file:
GRUB_CMDLINE_LINUX=""
Replace these lines with the following lines in the file and save the file:
GRUB_CMDLINE_LINUX="ipv6.disable=1"
Step 3: Save the GRUB configuration file using CTRL+X, add Y and press Enter, then run the following command to update the GRUB:
After updating the GRUB, reboot the system using the sudo reboot command.
Step 4: After the reboot, verify the status of IPv6 using the following command:
If IPv6 is disabled on your system, no output will appear on your console when you execute this command.
Note: To re-enable IPv6 on Debian, follow the same steps mentioned above and replace the lines you have added in Step 2 with the original lines.
How to Disable IPv6 on Debian 12 Through GUI
You can also disable IPv6 on Debian 12 through GUI from the System Settings; to do so, follow these steps properly:
Step 1: Navigate to Activities and search for Settings:
Step 2: From the left side of the opened window, click on Network and next click on the gear icon present in front of the Connected network:
Step 3: Switch to the IPv6 tab, choose Disable, and click on Apply to save the changes:
How to Temporarily Disable IPv6 on Debian 12
If you want to disable the IPv6 temporarily, then run the below-written commands one by one on your terminal:
You have successfully disabled the IPv6 temporarily on your system. Next time when you restart your system, it will be enabled again.
Conclusion
IPv6 has various advantages but sometimes you may require disabling it on your system. We have discussed the two methods to disable IPv6 on Debian 12: through the terminal and GUI. On the terminal, you can make changes in the sysctl.config file or in the GRUB file for disabling the IPv6. These methods will permanently disable the IPv6 until you make the necessary changes to enable it back. The GUI method is simple and only requires disabling the IPv6 from the system settings. Further, you will also find commands to disable the IPv6 temporarily on your Debian system in the above section of this guide.
Hi there! I am a Bioinformatician and a technical content writer. My passion for Linux motivates me to explore various dimensions of Linux OS and write for Linuxways. By combining my skills and IT knowledge, I craft user-friendly and engaging content that helps others to understand complex topics.