Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

CentOS 6 關閉 IPv6 後報錯「Module off not found」完美解決方案

編輯:Linux 教學

錯誤重現

在 /etc/modprobe.d/dist.conf 加入傳統寫法:

alias net-pf-10 off
alias ipv6 off

雖能禁用 IPv6,但重啟網路服務時噴錯:FATAL: Module off not found.

根因分析

alias ipv6 off 語法在新版模組管理機制中已棄用,系統嘗試尋找名為 "off" 的模組並載入,自然找不到。

標準解法(三步驟)

  1. 改用 options 指令禁用模組
    # /etc/modprobe.d/ipv6.conf
    options ipv6 disable=1
  2. 網路服務層面關閉 IPv6
    # /etc/sysconfig/network
    NETWORKING_IPV6=off
  3. 關閉 IPv6 防火牆服務
    chkconfig ip6tables off
    service ip6tables stop

驗證

# 重啟網路或重開機後
lsmod | grep ipv6          # 應無輸出
cat /proc/sys/net/ipv6/conf/all/disable_ipv6  # 應為 1
ip a | grep inet6          # 僅剩 loopback ::1

補充說明

CentOS 7 / RHEL 7 以後建議改用 sysctl 參數或 GRUB 核心參數 ipv6.disable=1,但 CentOS 6 仍屬舊式 init 腳本架構,上述三步驟為最相容做法。

Copyright © Windows教程網 All Rights Reserved