Disable or enable the IPv6 protocol in Red Hat Enterprise Linux

來源:互聯網
上載者:User

標籤:des   class   code   http   tar   com   

Resolution

Red Hat Enterprise Linux 4, 5 and 6 enable Internet Protocol Version 6 (IPv6) by default. However, in certain situations, some users may find it desirable to disable IPv6 support or to re-enable it after it has been disabled.

For Red Hat Enterprise Linux 6, the tech brief Preparing for IPv6 Networking in Red Hat Enterprise Linux provides a broad introduction to IPv6 networking.

Disabling IPv6 support in Red Hat Enterprise Linux 6
  1. Create a file /etc/modprobe.d/ipv6.conf with the following contents:

    options ipv6 disable=1
  2. For completeness, it is a good idea to configure the ip6tables service not to start at boot by issuing the following command:

    # chkconfig ip6tables off
  3. Edit /etc/sysconfig/network and add the line NETWORKING_IPV6=no

  4. Disable ipv6 support in the kernel through /etc/sysctl.conf :

    # ipv6 support in the kernel, set to 0 by defaultnet.ipv6.conf.all.disable_ipv6 = 1net.ipv6.conf.default.disable_ipv6 = 1
  5. Optionally to prevent rpc.nfsd setting up IPv6 sockets while NFS server is running, edit /etc/netconfig for the lines starting with udp6 and tcp6; change the "v" in the third column to "-"(hyphen/dash)

  6. Reboot the system to disable IPv6 support.

Note: There is a special case where this might not work, please see The "ipv6 disable=1" option does not seem to work on Red Hat Enterprise Linux 6 system.
Disabling ipv6 in the sysctl.conf will ensure ipv6 isn‘t used even if the ipv6 module is loaded and can work as a short term solution (until a full reboot)

Re-enabling IPv6 support in Red Hat Enterprise Linux 6
  1. Review the files under /etc/modprobe.d/ and remove (or comment out) any of the following lines:

    options ipv6 disable=1install ipv6 /bin/trueblacklist ipv6
  2. Configure the ip6tables service to start at boot by issuing the following command:

    # chkconfig ip6tables on
  3. Edit /etc/sysconfig/network and add the line NETWORKING_IPV6=yes

  4. Make sure the following options to your /etc/sysctl.conf are

    # ipv6 support in the kernel, set to 0 by defaultnet.ipv6.conf.all.disable_ipv6 = 0net.ipv6.conf.default.disable_ipv6 = 0
  5. Edit /etc/netconfig for the lines starting with udp6 and tcp6; change the "-"(hyphen/dash) in the third column to "v"

  6. Reboot the system to activate IPv6 support.

Disabling IPv6 support in Red Hat Enterprise Linux 5
  1. Remove the following line (if present) from the /etc/modprobe.conf file:

    alias net-pf-10 ipv6
  2. Add the following line to the /etc/modprobe.conf file:

    alias net-pf-10 off
  3. In versions of Red Hat Enterprise Linux before 5.4, add the following line to the /etc/modprobe.conf file:

    alias ipv6 off
  4. In Red Hat Enterprise Linux 5.4 and later, add the following line to the /etc/modprobe.conf file:

    options ipv6 disable=1
  5. To prevent errors during the network initscript start routine, change the NETWORKING_IPV6 parameter in the /etc/sysconfig/network file to the following:

    NETWORKING_IPV6=no
  6. For completeness, it is a good idea to configure the ip6tables service not to start at boot by issuing the following command:

    # chkconfig ip6tables off
  7. Reboot the system to disable IPv6 support.

Re-enabling IPv6 support in Red Hat Enterprise Linux 5
  1. Remove the following lines (if present) from the /etc/modprobe.conf file:

    alias net-pf-10 offalias ipv6 offoptions ipv6 disable=1
  2. Add the following line to the /etc/modprobe.conf file (if not present already):

    alias net-pf-10 ipv6
  3. Change the NETWORKING_IPV6 parameter in the /etc/sysconfig/network file to the following:

    NETWORKING_IPV6=yes
  4. For completeness, it is a good idea to configure the ip6tables service to start at boot by issuing the following command:

    # chkconfig ip6tables on
  5. Reboot the system to re-enable IPv6 support.

Disabling IPv6 support in Red Hat Enterprise Linux 4
  1. Remove the following line (if present) from the /etc/modprobe.conf file:

    alias net-pf-10 ipv6
  2. Add the following line to the /etc/modprobe.conf file:

    alias net-pf-10 off
  3. Reboot the system to disable IPv6 support.

Re-enabling IPv6 support in Red Hat Enterprise Linux 4
  1. Remove the following line from the /etc/modprobe.conf file:

    alias net-pf-10 off
  2. Add the following line to the /etc/modprobe.conf file:

    alias net-pf-10 ipv6
  3. Reboot the system to re-enable IPv6 support.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.