Linux, Windows, Virtualization, OpenSource & Blogging

How do i disable IPv6 on CentOS 7 / RHEL 7

2
Disable IPv6 on CentOS 7
Disable IPv6 on CentOS 7

This is mini how to on disabling ipv6 on CentOS 7 / RHEL 7. It can be disabled either by using sysctl.conf or by placing .conf in the /etc/sysctl.d directory. CentOS 7 now supports disabling IPv6 for all or a particular network adapter.

Method 1

Edit the /etc/sysctl.conf.

vi /etc/sysctl.conf

Put the following entry to disable IPv6 for all adapter.

net.ipv6.conf.all.disable_ipv6 = 1

For particular adapter. (If the network card name is eno16777736).

net.ipv6.conf.eno16777736.disable_ipv6 = 1

To reflect the changes by executing the following command.

sysctl -p

Method 2

Create file called disableipv6.conf in /etc/sysctl.d.

vi /etc/sysctl.d/disableipv6.conf

Put the following entry to disable IPv6 for all adapter

net.ipv6.conf.all.disable_ipv6 = 1

For particular adapter. (If the network card name is eno16777736).

net.ipv6.conf.eno16777736.disable_ipv6 = 1

You must reboot the server to take an effect of the changes.

reboot

That’s All.

POSTS YOU MAY LIKE -:)

You might also like
  • Guillaume Morin

    You could also use this instead of rebooting :

    sysctl -p /etc/sysctl.d/disableipv6.conf

  • Kitty

    For an on-the-fly change you can do:

    echo “1” > /proc/sys/net/ipv6/conf/all/disable_ipv6

How do i disable IPv6 on CentOS 7 / RHEL 7

2