How To Disable IPv6 On CentOS 8 / RHEL 8
Abstract: systctl.d Create a file called disableipv6.conf in /etc/sysctl.d directory. vi /etc/sysctl.d/disableipv6.conf Place the following entry to disable IPv
Most of the organizations still use IPv4 for network communications and not in need of IPv6. In these cases, your system doesn’t need to support IPv6.
IPv6 Enabled On Network InterfacesThis post helps you to disable IPv6 on CentOS 8 / RHEL 8.
THIS DOCUMENT IS ALSO AVAILABLE FOR CentOS 7 CentOS 6 Debian 10 Debian 9 Ubuntu 18.04 Ubuntu 16.04 Disable IPv6 On CentOS 8 / RHEL 8IPv6 can be disabled either by using sysctl.conf or by placing .conf file in the /etc/sysctl.d directory. CentOS 8 supports the disabling of IPv6 for all interfaces or specific to a particular network interface.
Method 1: systctl.dCreate a file called disableipv6.conf in /etc/sysctl.d directory.
vi /etc/sysctl.d/disableipv6.conf
Place the following entry to disable IPv6 for all adapter
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1You can use the following entry to disable IPv6 for a particular network interface. (Assuming that the network card name is enp0s3).
net.ipv6.conf.enp0s3.disable_ipv6 = 1
Run the following command to reflect the changes.
systemctl restart systemd-sysctlMethod 2: sysctl.conf
Edit the /etc/sysctl.conf file.
vi /etc/sysctl.conf
Place the following entry to disable IPv6 for all adapter.
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1You can use the following entry to disable IPv6 for a particular network interface. (Assuming that the network card name is enp0s3).
net.ipv6.conf.enp0s3.disable_ipv6 = 1
Run the following command to reflect the changes.
sysctl -pVerify
Use the ifconfig command to see the network interfaces. You should see IPv6 address is no longer set on interfaces.
IPv6 Disabled On Network Interfaces ConclusionThat’s All. I hope you learned how to disable IPv6 on CentOS 8 / RHEL 8. You can now proceed to configure IP Address on your CentOS 8 / RHEL 8 systems.