您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“Linux下如何解決IPV6模塊加載失敗問題”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“Linux下如何解決IPV6模塊加載失敗問題”這篇文章吧。
同事一個SUSE Linux Enterprise Server 11 SP3環境配置ipv6地址失敗,提示不支持IPv6,請求幫助,第一反應是應該ipv6相關內核模塊沒有加載。
ipv6地址是否存在
ifconfig |grep inet6
沒有默認inet6地址
ipv6模塊是否存在
# modinfo -n ipv6 /lib/modules/3.0.101-0.47.90-default/kernel/net/ipv6/ipv6.ko # modinfo -n ipv6_lib /lib/modules/3.0.101-0.47.90-default/kernel/net/ipv6/ipv6_lib.ko
系統是否加載IPv6相關模塊
lsmod |grep ipv6 # lsmod |grep ipv6 ipv6_lib 341467 0
只有ipv6_lib模塊,沒有主模塊ipv6
從上面信息得知,ipv6模塊是存在的,只是加載出現了問題,由此想到可能是配置導致的。
# cat /lib/modules/`uname -r`/modules.dep |grep -w ipv6.ko: /lib/modules/3.0.101-0.47.90-default/kernel/net/ipv6/ipv6.ko: /lib/modules/3.0.101-0.47.90-default/kernel/net/ipv6/ipv6_lib.ko
沒有問題
# cat /etc/modprobe.conf |grep -i ipv6 alias sit0 ipv6
發現一個50-ipv6.conf文件,內容如下:
# cat /etc/modprobe.d/50-ipv6.conf install ipv6 /bin/true
這句話是什么含義呢?通過modprobe.conf(5)文檔,有如下內容:
install modulename command... This is the most powerful primitive: it tells modprobe to run your command instead of inserting the module in the kernel as normal. The command can be any shell command: this allows you to do any kind of complex processing you might wish. For example, if the module "fred" works better with the module "barney" already installed (but it doesn't depend on it, so modprobe won't automatically load it), you could say "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred", which would do what you wanted. Note the --ignore-install, which stops the second modprobe from running the same install command again. See also remove below. You can also use install to make up modules which don't otherwise exist. For example: "install probe-ethernet /sbin/modprobe e100 || /sbin/modprobe eepro100", which will first try to load the e100 driver, and if it fails, then the eepro100 driver when you do "modprobe probe-ethernet". If you use the string "$CMDLINE_OPTS" in the command, it will be replaced by any options specified on the modprobe command line. This can be useful because users expect "modprobe fred opt=1" to pass the "opt=1" arg to the module, even if there's an install command in the configuration file. So our above example becomes "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred $CMDLINE_OPTS"
比較長,關鍵的第一句我們來解釋一下: This is the most powerful primitive: it tells modprobe to run your command instead of inserting the module in the kernel as normal. 這句話的意思是它讓modprobe命令執行命令行里的command命令,而不是一般情況下去加載指定的內核模塊。
該怎么理解這句話呢?我們通過兩個命令的執行來說明:
# modprobe -v -n ipv6 insmod /lib/modules/3.0.101-0.47.90-default/kernel/net/ipv6/ipv6_lib.ko install /bin/true
-n –dry-run –show 表明不做真正的插入模塊的操作 -v: 打印有關程序所做事情的信息 所以上述輸出表明modprobe只做了加載ipv6_lib.ko模塊和install /bin/true的動作, 而沒有做加載ipv6.ko模塊
# modprobe --show-depends ipv6 insmod /lib/modules/3.0.101-0.47.90-default/kernel/net/ipv6/ipv6_lib.ko install /bin/true
–show-depends 只列出模塊依賴關系,以insmod開頭; install命令也不做實際的加載操作,只列出要做的加載動作 從以上信息可以看出,也不會做ipv6.ko模塊加載。
去掉/bin/true之后,重新執行modprobe ipv6命令后檢查模塊加載情況:
# modprobe -v ipv6 # lsmod |grep ipv6 ipv6 12758 1 ipv6_lib 341467 71 ipv6 # ifconfig |grep inet6 inet6 addr: fe80::9af5:37ff:fe00:9527/64 Scope:Link inet6 addr: fe80::9af5:37ff:fee3:3ac4/64 Scope:Link inet6 addr: ::1/128 Scope:Host
綜上,可以認為是50-ipv6.conf文件的配置導致了ipv6加載不完整。
以上是“Linux下如何解決IPV6模塊加載失敗問題”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。