linux 關閉停用ipv6方法

來源:互聯網
上載者:User

.修改/etc/sysconfig/network 相應網卡,追加:

 代碼如下 複製代碼

NETWORKING_IPV6=no

2.修改/etc/hosts,把ipv6的那句本地主機名稱解析的也注釋掉:

 代碼如下 複製代碼

#::1   localhost localhost6 localhost6.localdomain6

3.建立檔案/etc/modprobe.d/ipv6off.conf(名字隨便起)

註:RHEL6.0之後沒有了/etc/modprobe.conf這個檔案

 代碼如下 複製代碼

alias net-pf-10 off
options ipv6 disable=1

4. 重啟系統,然後確認:

 代碼如下 複製代碼
[root@test ~]# lsmod | grep -i ipv6
[root@test ~]# ifconfig | grep -i inet6

如果上述2個命令執行的結果沒有任何顯示,那麼說明ipv6已經被完全禁止了。

其它:
在不載入ipv6模組的方法裡,有人會有類似這樣的設定方法:

 代碼如下 複製代碼
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1

雖然這樣在系統重啟後,ipv6的確沒被載入,但是因為第二句,在有的版本的系統裡,當我們重啟網路的時候,會出現錯誤:FATAL: Module off not found.

RedHat 5.x

To disable IPv6 in a virtual machine running RedHat 5.x:
1.Log in as root or superuser. www.111cn.net

2.If the /etc/sysconfig/network file contains the line NETWORKING_IPV6=yes, change the line to:

NETWORKING_IPV6=no

 


3.In the file /etc/modprobe.conf, add this line:

options ipv6 disable=1

 

4.Save the file and reboot the system.

After you disable IPv6, you should be able to install and configure VMware Tools successfully.

聯繫我們

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