In the realm of computing, there are two primary types of IP addresses: IPv4 and IPv6. While IPv6 offers a significantly larger addressing scheme compared to IPv4, the latter remains the more prevalent choice among many organizations for various reasons.
There are times when disabling IPv6 on a RHEL system is necessary, such as when an application does not support IPv6 or when the hardware is incompatible.
This guide outlines one of the simplest methods to disable IPv6 on a RHEL system.
How to Disable IPv6 using Grubby
The grubby utility is an effective tool for making persistent changes to the grub.cfg file. This represents one of the easiest approaches to disable IPv6, especially on Red Hat-based systems.
Step 1: Check if IPv6 is Enabled
Begin by verifying if your system is utilizing IPv6 with the ip command. If you see any 'inet6'
entry in the output below, it indicates that IPv6 is enabled on your devices.
ip a | grep -i inet6 inet6 ::1/128 scope host inet6 fe80::b5c2:565a:e972:e572/64 scope link noprefixroute
Step 2: Disable IPv6
Execute the following command to add the parameter 'ipv6.disable=1'
to the ‘grub.cfg’ file across all installed kernels, as RHEL systems typically have the last three kernels.
The value '1'
signifies that IPv6 will be disabled for the device.
grubby --update-kernel ALL --args ipv6.disable=1
Step 2a: Disable IPv6 (Optional)
If you’d prefer to disable IPv6 only for the latest kernel, you can add the following entry to the ‘grub.cfg’ file.
grubby --update-kernel DEFAULT --args ipv6.disable=1
Step 3: Verify the grub.cfg File
To confirm that IPv6 is disabled, check that the ‘ipv6.disable=1’ parameter has been added to the ‘grub.cfg’ file before restarting the system. You should see this parameter for all kernels, as shown below:
grubby --info=ALL
Step 4: Reboot the System
Reboot your system for the changes to take effect.
reboot
or
init 6
Step 5: IPv6 Verification
After rebooting, check if IPv6 is disabled using the ip command as shown below:
ip a | grep -i inet6
If no ‘inet6’ entries appear in the output, it confirms that IPv6 is disabled for all devices.
Conclusion
This tutorial has guided you through the straightforward process of disabling IPv6 on a RHEL system.
If you have any questions or feedback, please feel free to leave a comment below.