CentOS 6.7 禁用 IPV6網路的方法

來源:互聯網
上載者:User

標籤:禁用   ipv6   



在安裝系統的時候啟用了IPV6,但是在實際使用的時候,並不需要使用IPV6,所以需要將其禁用。以下是我處理的方法。


一開始我也踩了好多坑,在網上看了很多分享的方法都不行,驗證是否啟用了IPV6可以使用:

ifconfig |grep inet6

lsmod |grep ipv6


1)、關閉ip6tables

# chkconfig ip6tables off




2)、禁用ipv6網路(/etc/sysconfig/network)

# vim /etc/sysconfig/networkNETWORKING_IPV6=no



3)、禁用網卡IPV6設定

# vim /etc/sysconfig/network-scripts/ifcfg-eth0IPV6INIT=noIPV6_AUTOCONF=no


4)、修改/etc/hosts,禁用ipv6設定,將ipv6解析注釋:

# vim /etc/hosts#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6



在網路上很多都是介紹了以上的4個方法,然後重啟系統,還是沒有能禁用ipv6,然後就折騰了,使用如下方法經驗證是可以的。

A、/etc/modprobe/dist.conf 檔案追加如下配置

# vim /etc/modprobe/dist.confalias net-pf-10 offalias ipv6 off


然後重啟系統,就可以了。檢查的方法是在執行

ifconfig |grep inet6

lsmod |grep ipv6


如果沒有返回任何資料,則說明已經禁用了。


另外,也有網上分享的辦法是在/boot/grub/grub.conf 檔案上 kernel開頭quiet結尾後面增加 disable.ipv6=1,這種方法在使用ifconfig | grep inet6驗證的時候,確實沒有ipv6了,但是使用lsmod |grep ipv6 驗證,還是存在的的。




本文出自 “balich” 部落格,請務必保留此出處http://balich.blog.51cto.com/6641781/1759892

CentOS 6.7 禁用 IPV6網路的方法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.