UNIX BLOG
Blog for NIX system based administrators
Disable ipv6 on centos 5 6 or other system like debian ubuntu
Usually it’s very important to disable ipv6 feature , anyway on the most virtual servers it’s not in use, also it’s interfere in the work of commands like netstat -n or iptables.
In this article I will show how to disable ipv6 definitivly from the server.
first of all
echo "options ipv6 disable=1" > /etc/modprobe.d/disable-ipv6
if it doesn’t work use the next scheme
/etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
/etc/modprobe.d/blacklist-compat or nano /etc/modprobe.d/blacklist
blacklist ipv6
/etc/modprobe.d/modprobe.conf.dist or /etc/modprobe.d/modprobe.conf or /etc/modprobe.conf
install ipv6 /bin/true
now especially for CENTOS 5 and 6
/etc/sysconfig/network
NETWORKING_IPV6=no
/etc/sysconfig/network-scripts/ifcfg-eth0 or /etc/sysconfig/network-scripts/ifcfg-eth1
IPV6INIT=no
IPV6_AUTOCONF=no
After these changes, reboot the mashine
and you will get something like this in ifconfig , without ipv6
eth0 Link encap:Ethernet HWaddr 00:22:3E:66:FE:55
inet addr123.512.232.222 Bcast:123.512.232.222 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:592 (592.0 b) TX bytes:774 (774.0 b)
Interrupt:246
Thank you for you atention, if you have other ideas how to extend this article , tell us, you are welcome!
Tags: centos, debian, disable, ifconfig, ipv6, ipv6 disable, ipv6 turn off, turn off, ubuntu
Leave a Reply