8

I want to disable IPV6 in the new Centos6 virtual server I have just setup in Xen. I have already followed the instructions here and then rebooted/restarted networking.

Update: followed the below, that seems to have worked, but now it hasn't picked up an ipv4 address?

eth0      Link encap:Ethernet  HWaddr 9A:F0:43:47:04:F1 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:941 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:89952 (87.8 KiB)  TX bytes:0 (0.0 b)
          Interrupt:14
MDMarra
  • 100,183
  • 32
  • 195
  • 326
AliGibbs
  • 2,303
  • 20
  • 34

1 Answers1

9

You need to make changes in a few different places.

First, disable IPv6 in the user-land network configuration scripts by modifying the file
/etc/sysconfig/network
Make sure to set the variable
NETWORKING_IPV6=no

Next disable the ipv6 kernel module. You should be able to create a new modprobe.d file to disable it, or outright blacklist it. So either

  1. Create a new file /etc/modprobe.d/ipv6.conf containing

alias net-pf-10 off
alias ipv6 off

  1. Add the following lines to /etc/modprobe.d/blacklist.conf

blacklist net-pf-10
blacklist ipv6

IPTables is enabled by default, and has a separate service for IPv4 and v6, so we need to disable the v6 version as well.

service ip6tables stop
chkconfig ip6tables off

In theory, once all this is set up, you should be able to restart networking, and unload the module. However, you may require a full reboot to make sure all the cruft is cleaned up. After doing this I would recommend verifying that the disable took by looking at the loaded modules, your running network config, listening/sockets, etc for any v6 indicators.

Scott Pack
  • 14,717
  • 10
  • 51
  • 83
  • Odd that [the CentOS FAQ](http://wiki.centos.org/FAQ/CentOS6#head-d47139912868bcb9d754441ecb6a8a10d41781df) doesn't cover this info, which will really disable IPv6 instead of not. Thanks Scott. – mbrownnyc Sep 18 '12 at 17:40