Linux How-To

How you can disable IPv6 on Linux

SEOClerks

Quick submit on disable IPv6 in RHEL, Suse or Ubuntu Linux.

How to disable IPv6 on LinuxDisable IPv6 on RHEL, SUSE, Ubuntu Linux

How you can disable IPv6 in RHEL 7

Edit /and so forth/default/grub and append ipv6.disable=1 to GRUB_CMDLINE_LINUXline like beneath :

GRUB_CMDLINE_LINUX=”rd.lvm.lv=rhel/swap crashkernel=auto rd.lvm.lv=rhel/root ipv6.disable=1″

 

GRUB_CMDLINE_LINUX=“rd.lvm.lv=rhel/swap crashkernel=auto rd.lvm.lv=rhel/root ipv6.disable=1”

 

Now, that you must regenerate the grub.cfg file by working the grub2-mkconfig command :

root@kerneltalks # grub2-mkconfig -o /boot/grub2/grub.cfg

 

root@kerneltalks # grub2-mkconfig -o /boot/grub2/grub.cfg

 

That’s it. Reboot and it’ll disable IPv6 in your system.

One other methodology is to disable it utilizing /and so forth/sysctl.d/ipv6.conf file.

Add beneath entry in file :

# To disable for all interfaces
internet.ipv6.conf.all.disable_ipv6 = 1
#Disable default
internet.ipv6.conf.default.disable_ipv6 = 1
#Disable on loopback
internet.ipv6.conf.lo.disable_ipv6 = 1

 

# To disable for all interfaces

internet.ipv6.conf.all.disable_ipv6 = 1

#Disable default

internet.ipv6.conf.default.disable_ipv6 = 1

#Disable on loopback

internet.ipv6.conf.lo.disable_ipv6 = 1

 

Now, reload sysctl file,

root@kerneltalks # sysctl -p /and so forth/sysctl.d/ipv6.conf

 

root@kerneltalks # sysctl -p /and so forth/sysctl.d/ipv6.conf

 

You’ll want to re-build the Preliminary RAM Disk as properly. You are able to do it utilizing :

root@kerneltalks # dracut -f

 

root@kerneltalks # dracut -f

 

That’s it. You’re performed.

Disable IPv6 in RHEL 6

Create a brand new file /and so forth/modprobe.d/ipv6.conf with beneath one liner –

root@kerneltalks # echo “choices ipv6 disable=1” >/and so forth/modprobe.d/ipv6.conf

 

root@kerneltalks # echo “choices ipv6 disable=1” >/and so forth/modprobe.d/ipv6.conf

 

Cease ip6tables service from loading at boot by utilizing chkconfig

root@kerneltalks # chkconfig ip6tables off

 

root@kerneltalks # chkconfig ip6tables off

 

And you’re performed Reboot the system to run it with out IPv6.

Disable IPv6 in Suse Linux

Add beneath traces in /and so forth/sysctl.conf

internet.ipv6.conf.all.disable_ipv6 = 1
internet.ipv6.conf.default.disable_ipv6 = 1
internet.ipv6.conf.lo.disable_ipv6 = 1

 

internet.ipv6.conf.all.disable_ipv6 = 1

internet.ipv6.conf.default.disable_ipv6 = 1

internet.ipv6.conf.lo.disable_ipv6 = 1

 

Reload file with sysctl -p and you’re performed.

In case you are having GUI entry of server then  you are able to do it underneath community settings. Navigate to Functions > System Instruments > YaST > Community Settings . Goto World Choices tab and uncheck Allow IPv6.

Disable ipv6 in suseDisable ipv6 in suse

You’ll require to reboot server to take this impact.

Disable IPv6 in Ubuntu Linux

Above strategy of Suse Linux applies to ubuntu as properly. You’ll want to edit /and so forth/sysctl.conf and add above traces. Reload the file with sysctl -p and you’re performed.

To confirm if IPv6 is disabled on server use beneath command –

root@kerneltalks # cat /proc/sys/internet/ipv6/conf/all/disable_ipv6

 

root@kerneltalks # cat /proc/sys/internet/ipv6/conf/all/disable_ipv6

 

If output is 1 then IPv6 is disabled. If output is zero then IPv6 is enabled.

 

Source link

Related Articles

Leave a Reply

Back to top button