2012年5月11日 星期五

CentOS 關閉 IPV6 網路功能

為了從 Linux Kernel 中關閉 IPV6 網路功能,會修改到底下兩個檔案,必須使用 root 權限

  • /etc/modprobe.conf - Kernel 驅動程式組態檔
  • /etc/sysconfig/network - RHEL / CentOS 網路組態檔

clip_image001
▲關閉前

clip_image002
▲關閉後

修改 /etc/modprobe.conf

  1. 使用 vi 編輯 /etc/modprobe.conf 檔案
    # vi /etc/modprobe.conf
  2. 在檔案最後面加上底下的指令,儲存並關閉檔案
    install ipv6 /bin/true

修改 /etc/sysconfig/network

  1. 使用 vi 編輯 /etc/sysconfig/networ 檔案
    # vi /etc/sysconfig/networ
  2. 修改底下的設定,儲存並關閉檔案
    NETWORKING_IPV6=no
    IPV6INIT=
    no

 

重啟網路服務

  1. 重啟網路服務
    # service network restart
    # rmmod ipv6

    或者直接重啟系統
    # reboot
  2. 檢查 IPV6 是否已經被關閉
    # lsmod | grep ipv6
    # /sbin/ifconfig

參考資料

0 意見:

張貼留言