How to disable IPV6 on Linux

Posted byShailesh Posted onMarch 12, 2019 Comments0

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

Category

Leave a Comment