How to disable IPV6 on Linux

Method 1:
# echo ‘1’ > /proc/sys/net/ipv6/conf/lo/disable_ipv6
# echo ‘1’ > /proc/sys/net/ipv6/conf/lo/disable_ipv6
# echo ‘1’ > /proc/sys/net/ipv6/conf/all/disable_ipv6
# echo ‘1’ > /proc/sys/net/ipv6/conf/default/disable_ipv6
# /etc/init.d/networking restart

Method 2:
#vi /etc/sysctl.conf
# IPv6 disabled #add these 3 lines in the last
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
# /etc/init.d/networking restart

Method 3 : Disable ipv6 from GRUB

Ipv6 can also be disabled by editing the grub configuration file

$ sudo gedit /etc/default/grub
GRUB_CMDLINE_LINUX=”ipv6.disable=1″
# /etc/init.d/networking restart

Leave a Reply

Your email address will not be published. Required fields are marked *