个人工具

“UbuntuHelp: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 </...)
 
Disabling IPv6
第1行: 第1行:
== Disabling IPv6 ==
+
== 禁用IPv6==
 
Ubuntu:
 
Ubuntu:
<ol><li>Open a terminal and type: <pre><nowiki>
+
<ol><li>打开终端,并输入: <pre><nowiki>
 
gksudo gedit /etc/modprobe.d/blacklist
 
gksudo gedit /etc/modprobe.d/blacklist
 
</nowiki></pre>
 
</nowiki></pre>
</li><li>Add this line: <pre><nowiki>
+
</li><li>增加如下一行: <pre><nowiki>
 
blacklist ipv6
 
blacklist ipv6
 
</nowiki></pre>
 
</nowiki></pre>
</li><li>Save the file and restart your computer</li></ol>
+
</li><li>保存文件,并重新启动计算机</li></ol>
  
 
Kubuntu:
 
Kubuntu:
<ol><li>Open a terminal and type: <pre><nowiki>
+
<ol><li>打开终端,并输入:<pre><nowiki>
 
kdesu kate /etc/modprobe.d/blacklist
 
kdesu kate /etc/modprobe.d/blacklist
 
</nowiki></pre>
 
</nowiki></pre>
</li><li>Add this line: <pre><nowiki>
+
</li><li>增加如下一行: <pre><nowiki>
 
blacklist ipv6
 
blacklist ipv6
 
</nowiki></pre>
 
</nowiki></pre>
</li><li>Save the file and restart your computer</li></ol>
+
</li><li>保存文件,并重新启动计算机</li></ol>
  
After restarting, open up a terminal and type: <pre><nowiki>
+
在重启之后,打开终端,并输入: <pre><nowiki>
 
ip a | grep inet6
 
ip a | grep inet6
 
</nowiki></pre>
 
</nowiki></pre>
If there's no output, IPv6 is disabled.
+
如果没有任何输出,则IPv6已经禁用。
Another method (perhaps simpler) is editing /etc/modprobe.d/aliases
+
另外一种相对更简单的办法是直接编辑 /etc/modprobe.d/aliases文件,将其中的"alias net-pf-10 ipv6"替换成为"alias net-pf-10 off"
and replacing "alias net-pf-10 ipv6" with "alias net-pf-10 off". Done!
+
=== Gutsy的解决方法 ===
=== Alternative method for Gutsy ===
+
然而,对于一台新装的Gusty服务器以上的两种方法是无效的 (确实如此,当你执行命令 <code><nowiki> ip a | grep inet6 </nowiki></code>时,会产生输出,表明IPv6并没有被禁用).
On a cleanly installed Gutsy server the above methods didn't work (that is, <code><nowiki> ip a | grep inet6 </nowiki></code> kept generating output showing that IPv6 was not actually disabled).
+
参考 [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文件中增加如下内容):
According to [http://beranger.org Planète Béranger (Radu-Cristian Fotescu)], the [http://beranger.org/index.php?article=2256&page=3k best method to prevent a module from loading at boot time] is adding the following to some of the files in /etc/modprobe.d (you can do it within /etc/modprobe.d/blacklist):
+
 
<pre><nowiki>
 
<pre><nowiki>
 
install ipv6 /bin/true
 
install ipv6 /bin/true
 
</nowiki></pre>
 
</nowiki></pre>
Another variant method that works for Gutsy, is to add in /etc/modprobe.d/arch/i386:
+
另外一种在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>
(In my case having ipv6 enabled breaks Netfilter's SNAT.)
+
=== 临时禁用IPv6===
=== Disabling IPv6 temporarily ===
+
如果是想临时禁用IPv6,你会发现一旦为网络设备配置了ipv6地址,就将无法卸载ipv6内核模块。你可以使用ifconfig命令来查看当前IP设置,并使用下面的命令来禁用IPv6:
If you just want to disable IPv6 temporary, you will discover that you can't just unload the ipv6 kernel module as long as an ipv6 address is configured for your device. You can use ifconfig to see which addresses are currently configured for your devices and disabling them with the following command: <pre><nowiki>
+
<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:

  1. 打开终端,并输入:
    gksudo gedit /etc/modprobe.d/blacklist
    
  2. 增加如下一行:
    blacklist ipv6
    
  3. 保存文件,并重新启动计算机

Kubuntu:

  1. 打开终端,并输入:
    kdesu kate /etc/modprobe.d/blacklist
    
  2. 增加如下一行:
    blacklist ipv6
    
  3. 保存文件,并重新启动计算机
在重启之后,打开终端,并输入:
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>