An Internet Protocol Version 6 (IPv6) address is an identifier of a network interface of a computer or a network node involved in an IPv6 computer network. This article will guide the user via simple steps on how to disable or re-enable IPv6 network addresses on RHEL 8 / CentOS 8. To temporarily enable/disable the IPv6 address on RHEL 8 / CentOS 8 we will use the sysctl
command. Additionally, to permanently disable the IPv6 address we will modify the GRUB boot options.
In this tutorial you will learn:
- How to temporarily disable the IPv6 address.
- How to permanently disable IPv6 by modifying the GRUB boot options.
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | RHEL 8 / CentOS 8 |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
How to disable IPv6 on RHEL 8 / CentOS 8 step by step instructions
- To temporarily disable IPv6 address execute the following command from your terminal with administrative privileges:
# sysctl -w net.ipv6.conf.all.disable_ipv6=1
- Confirm that IPv6 network addresses are disabled. Run the
ip
command and check for anyinet6
IP address allocations:# ip a
- Permanently disable IPv6 network address allocations by modifying the GRUB boot menu. First obtain the current
kernelopts
argument list: For example:# grub2-editenv - list | grep kernelopts kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet
Next, append a new argument
ipv6.disable=1
to the previously receivedkernelopts
argument list: For example:# grub2-editenv - set "kernelopts=root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet ipv6.disable=1"
- Reboot your system to apply changes. Alternatively simply disable IPv6 as per
STEP 1 - In case you need to re-enable the IPv6 address execute:
# sysctl -w net.ipv6.conf.all.disable_ipv6=0
If you have also modified GRUB boot to disable IPv6 as per above instructions use the
grub2-editenv
command to remove theipv6.disable=1
argument.