Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Issues related to configuring your network
pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by pschaff » 2011/08/06 13:44:26

You seem to have an answer there now, and it is possible. Try the suggested method and see if it helps.

Please post in that thread about that problem, and do not hijack your own thread.

OneLoveAmaru
Posts: 2
Joined: 2011/09/28 17:47:17
Contact:

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by OneLoveAmaru » 2011/09/28 17:55:17

Starting with kernel 2.6.30 ipv6 is no longer a module, it's built directly into the kernel. There is only 1 way to REALLY disable it on boot at that's on the kernel line.

ipv6.disable=1

Edit: /etc/grub.conf

title CentOS Linux (2.6.32-71.29.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-71.29.1.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet [b][color=990000]ipv6.disable=1[/color][/b]
initrd /initramfs-2.6.32-71.29.1.el6.x86_64.img



The only issue is, when you upgrade the kernel this disappears and you have to add it back in. In Debian you can edit /etc/default/grub and add it into the default line, so every time a new kernel is installed, it adds in ipv6.disable=1 automatically. I cannot find where to do this in CentOS or Redhat 6. Anybody know where?

OneLoveAmaru
Posts: 2
Joined: 2011/09/28 17:47:17
Contact:

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by OneLoveAmaru » 2011/09/28 18:07:03

Alright, with RHEL6, it looks like creating this file /etc/modprobe.d/disable-ipv6 and then add in the line: options ipv6 disable=1 and rebooting does the trick. That will survive any kernel upgrades.

Good luck.

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by TrevorH » 2011/09/28 18:42:08

[quote]
Starting with kernel 2.6.30 ipv6 is no longer a module
[/quote]

This is dependent on how you configure your kernel and Redhat and Centos build it as a module.

[quote]
it looks like creating this file /etc/modprobe.d/disable-ipv6 and then add in the line: options ipv6 disable=1 and rebooting does the trick
[/quote]

Or you can use the sysctl method I described above which does not require a reboot and can be reversed if required also without a reboot.

vdubhack
Posts: 8
Joined: 2011/10/26 03:43:42

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by vdubhack » 2011/10/27 11:32:28

I tried the sysctl method and I still have ipv6 after reboot. I even gave it a second reboot in case for some reason it did not work. I verified I had what you stated should be put in there and
[code]
ip a | grep inet6
netstat -nutlp | grep ::
ifconfig
lsmod | grep ipv6
[/code]
all show that its still running.

Also I know there is a way to keep the ipv6 setting in grub persistent I have the notes some where what file should be edited I will find it and post back the info on that. I am going to try that method next until someone else has any other ideas suggestions.

edit:
make the change to /boot/grub/grub.conf -- this should be where it will stay persistent I believe it did for my Fed install. Also I just did this way and ipv6 is now turned off after reboot. The other way does not fully turn it off some how or something on the machine is able to turn it back on and make it listen not really sure. Hope this is of some help.

Also if you use --noipv6 in a kickstart file it still enables it.

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by TrevorH » 2011/10/27 11:57:49

[quote]
I tried the sysctl method and I still have ipv6 after reboot.
[/quote]

How? What exactly did you do?

vdubhack
Posts: 8
Joined: 2011/10/26 03:43:42

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by vdubhack » 2011/10/27 12:08:34

[quote]
TrevorH wrote:
How? What exactly did you do?[/quote]

By adding:

net.ipv6.conf.all.disable_ipv6 = 1

to /etc/sysctl.conf as was stated earlier in this thread and in the FAQ

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by TrevorH » 2011/10/27 14:16:15

Well it works for me on everything except localhost. It did take a reboot to make it take effect on CentOS 5 but I am fairly sure that when I tested this before, it did not need it. So..

[code]
# tail -2 /etc/sysctl.conf
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6=1
[/code]

vdubhack
Posts: 8
Joined: 2011/10/26 03:43:42

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by vdubhack » 2011/10/27 15:03:37

Here is my ipv6 related output on sysctl.conf. Also just rebooted again
[code]
cat /etc/sysctl.conf | grep ipv6
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6 = 1
[/code]
[code]
lsmod | grep ip
ipv6 322259 14
nf_conntrack_ipv4 9440 11
nf_defrag_ipv4 1449 1 nf_conntrack_ipv4
nf_conntrack 79611 2 nf_conntrack_ipv4,xt_state
iptable_filter 2759 1
ip_tables 17765 1 iptable_filter
[/code]
[code]
ifconfig
eth0 Link encap:Ethernet HWaddr **********
inet addr:192.168.1.17 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::213:72ff:fe23:97dd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9431 errors:0 dropped:0 overruns:0 frame:0
TX packets:8686 errors:0 dropped:0 overruns:0 carrier
[/code]

That everything right after a reboot. Am I just not grasping something? Or does the way you mentioned since you stated works on 5 no longer working for 6.*? Thanks for the responses and info so far.

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Do I need disable IPv6 on CentOS 6.0? If yes, how exactly?

Post by TrevorH » 2011/10/27 15:27:41

The ipv6 modules needs to load as many other modules are now dependent on it. If you blacklist the ipv6 module or alias it to off in /etc/modprobe.conf then you will no longer be able to load those dependent modules. For example, the one that Redhat mention in their docs is the bonding module - so you cannot bond multiple interfaces together and disable ipv6 using the old method any more. Since the sysctl stuff was backported from 6 to 5, my doubt was whether it was going to work properly on Centos 5. My initial testing was done on CentOS 6 and that's where it worked for me but 5 is all I have here.

Post Reply

Return to “CentOS 6 - Networking Support”