特殊:Badtitle/NS100:WebBrowsingSlowIPv6IPv4/zh:修订间差异
来自Ubuntu中文
跳到导航跳到搜索
新页面: == Disabling IPv6 == Ubuntu: <ol><li>Open a terminal and type: <pre><nowiki> gksudo gedit /etc/modprobe.d/blacklist </nowiki></pre> </li><li>Add this line: <pre><nowiki> blacklist ipv6 </... |
|||
第1行: | 第1行: | ||
== | == 禁用IPv6== | ||
Ubuntu: | Ubuntu: | ||
<ol><li> | <ol><li>打开终端,并输入: <pre><nowiki> | ||
gksudo gedit /etc/modprobe.d/blacklist | gksudo gedit /etc/modprobe.d/blacklist | ||
</nowiki></pre> | </nowiki></pre> | ||
</li><li> | </li><li>增加如下一行: <pre><nowiki> | ||
blacklist ipv6 | blacklist ipv6 | ||
</nowiki></pre> | </nowiki></pre> | ||
</li><li> | </li><li>保存文件,并重新启动计算机</li></ol> | ||
Kubuntu: | Kubuntu: | ||
<ol><li> | <ol><li>打开终端,并输入:<pre><nowiki> | ||
kdesu kate /etc/modprobe.d/blacklist | kdesu kate /etc/modprobe.d/blacklist | ||
</nowiki></pre> | </nowiki></pre> | ||
</li><li> | </li><li>增加如下一行: <pre><nowiki> | ||
blacklist ipv6 | blacklist ipv6 | ||
</nowiki></pre> | </nowiki></pre> | ||
</li><li> | </li><li>保存文件,并重新启动计算机</li></ol> | ||
在重启之后,打开终端,并输入: <pre><nowiki> | |||
ip a | grep inet6 | ip a | grep inet6 | ||
</nowiki></pre> | </nowiki></pre> | ||
如果没有任何输出,则IPv6已经禁用。 | |||
另外一种相对更简单的办法是直接编辑 /etc/modprobe.d/aliases文件,将其中的"alias net-pf-10 ipv6"替换成为"alias net-pf-10 off"。 | |||
=== Gutsy的解决方法 === | |||
=== | 然而,对于一台新装的Gusty服务器以上的两种方法是无效的 (确实如此,当你执行命令 <code><nowiki> ip a | grep inet6 </nowiki></code>时,会产生输出,表明IPv6并没有被禁用). | ||
参考 [http://beranger.org Planète Béranger (Radu-Cristian Fotescu)]中的这篇文章 [http://beranger.org/index.php?article=2256&page=3k best method to prevent a module from loading at boot time] ,我们在/etc/modprobe.d文件中增加如下行(你也可以在/etc/modprobe.d/blacklist文件中增加如下内容): | |||
<pre><nowiki> | <pre><nowiki> | ||
install ipv6 /bin/true | install ipv6 /bin/true | ||
</nowiki></pre> | </nowiki></pre> | ||
另外一种在Gutsy系统下有效的方法是,在/etc/modprobe.d/arch/i386 文件中增加如下行: | |||
<pre><nowiki> | <pre><nowiki> | ||
# no ipv6 | # no ipv6 | ||
alias net-pf-10 off | alias net-pf-10 off | ||
</nowiki></pre> | </nowiki></pre> | ||
=== 临时禁用IPv6=== | |||
=== | 如果是想临时禁用IPv6,你会发现一旦为网络设备配置了ipv6地址,就将无法卸载ipv6内核模块。你可以使用ifconfig命令来查看当前IP设置,并使用下面的命令来禁用IPv6: | ||
<pre><nowiki> | |||
sudo ifconfig <interface> inet6 del <ipv6address>/<prefixlength> | sudo ifconfig <interface> inet6 del <ipv6address>/<prefixlength> | ||
</nowiki></pre> | </nowiki></pre> |
2008年7月8日 (二) 15:21的版本
禁用IPv6
Ubuntu:
- 打开终端,并输入:
gksudo gedit /etc/modprobe.d/blacklist
- 增加如下一行:
blacklist ipv6
- 保存文件,并重新启动计算机
Kubuntu:
- 打开终端,并输入:
kdesu kate /etc/modprobe.d/blacklist
- 增加如下一行:
blacklist ipv6
- 保存文件,并重新启动计算机
在重启之后,打开终端,并输入:
ip a | grep inet6
如果没有任何输出,则IPv6已经禁用。 另外一种相对更简单的办法是直接编辑 /etc/modprobe.d/aliases文件,将其中的"alias net-pf-10 ipv6"替换成为"alias net-pf-10 off"。
Gutsy的解决方法
然而,对于一台新装的Gusty服务器以上的两种方法是无效的 (确实如此,当你执行命令 ip a | grep inet6
时,会产生输出,表明IPv6并没有被禁用).
参考 Planète Béranger (Radu-Cristian Fotescu)中的这篇文章 best method to prevent a module from loading at boot time ,我们在/etc/modprobe.d文件中增加如下行(你也可以在/etc/modprobe.d/blacklist文件中增加如下内容):
install ipv6 /bin/true
另外一种在Gutsy系统下有效的方法是,在/etc/modprobe.d/arch/i386 文件中增加如下行:
# no ipv6 alias net-pf-10 off
临时禁用IPv6
如果是想临时禁用IPv6,你会发现一旦为网络设备配置了ipv6地址,就将无法卸载ipv6内核模块。你可以使用ifconfig命令来查看当前IP设置,并使用下面的命令来禁用IPv6:
sudo ifconfig <interface> inet6 del <ipv6address>/<prefixlength>