“UbuntuHelp:WebBrowsingSlowIPv6IPv4”的版本间的差异
来自Ubuntu中文
小 |
小 |
||
第8行: | 第8行: | ||
</nowiki></pre> | </nowiki></pre> | ||
</li><li>Add this line: <pre><nowiki> | </li><li>Add this line: <pre><nowiki> | ||
− | blacklist ipv6 | + | blacklist ipv6 |
</nowiki></pre> | </nowiki></pre> | ||
</li><li>Save the file and restart your computer</li></ol> | </li><li>Save the file and restart your computer</li></ol> | ||
第16行: | 第16行: | ||
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>Add this line: <pre><nowiki> |
− | blacklist ipv6 | + | blacklist ipv6 |
</nowiki></pre> | </nowiki></pre> | ||
</li><li>Save the file and restart your computer</li></ol> | </li><li>Save the file and restart your computer</li></ol> | ||
− | After restarting, open up a terminal and type: <pre><nowiki> | + | After restarting, open up a terminal and type: <pre><nowiki> |
− | ip a | grep inet6 | + | ip a | grep inet6 |
</nowiki></pre> | </nowiki></pre> | ||
If there's no output, IPv6 is disabled. | If there's no output, IPv6 is disabled. | ||
Another method (perhaps simpler) is editing /etc/modprobe.d/aliases | Another method (perhaps simpler) is editing /etc/modprobe.d/aliases | ||
and replacing "alias net-pf-10 ipv6" with "alias net-pf-10 off". Done! | and replacing "alias net-pf-10 ipv6" with "alias net-pf-10 off". Done! | ||
+ | === Alternative method for Gutsy === | ||
+ | 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). | ||
+ | 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> | ||
+ | install ipv6 /bin/true | ||
+ | </nowiki></pre> | ||
+ | Another variant method that works for Gutsy, is to add in /etc/modprobe.d/arch/i386: | ||
+ | <pre><nowiki> | ||
+ | # no ipv6 | ||
+ | alias net-pf-10 off | ||
+ | </nowiki></pre> | ||
+ | (In my case having ipv6 enabled breaks Netfilter's SNAT.) | ||
+ | === Disabling IPv6 temporarily === | ||
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> | 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> | ||
sudo ifconfig <interface> inet6 del <ipv6address>/<prefixlength> | sudo ifconfig <interface> inet6 del <ipv6address>/<prefixlength> |
2008年4月23日 (三) 12:03的版本
Ubuntu has a newer Internet protocol called IPv6 turned on by default. However, some hardware — such as NICs and modems — shows broken behavior when exposed to IPv6 related DNS requests. This leaves you wondering why DNS resolution seems slower or doesn't work at all. This guide shows how to disable this new protocol.
目录
Disabling IPv6
Ubuntu:
- Open a terminal and type:
gksudo gedit /etc/modprobe.d/blacklist
- Add this line:
blacklist ipv6
- Save the file and restart your computer
Kubuntu:
- Open a terminal and type:
kdesu kate /etc/modprobe.d/blacklist
- Add this line:
blacklist ipv6
- Save the file and restart your computer
ip a | grep inet6
If there's no output, IPv6 is disabled. Another method (perhaps simpler) is editing /etc/modprobe.d/aliases and replacing "alias net-pf-10 ipv6" with "alias net-pf-10 off". Done!
Alternative method for Gutsy
On a cleanly installed Gutsy server the above methods didn't work (that is, ip a | grep inet6
kept generating output showing that IPv6 was not actually disabled).
According to Planète Béranger (Radu-Cristian Fotescu), the 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):
install ipv6 /bin/true
Another variant method that works for Gutsy, is to add in /etc/modprobe.d/arch/i386:
# no ipv6 alias net-pf-10 off
(In my case having ipv6 enabled breaks Netfilter's SNAT.)
Disabling IPv6 temporarily
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:sudo ifconfig <interface> inet6 del <ipv6address>/<prefixlength>
Identifying the Broken Device
The real reason for the problem is because IPv6 does DNS queries for "AAAA" records which request the IPv6 address of an internet hostname. You can identify the problem from a terminal, by making a specific DNS query such as:
dig AAAA www.kame.net
The corresponding query for an IPv4 address would be:
dig A www.kame.net
If the first one of these queries times out without returning a valid IPv6 address then your internet router is not working correctly and you may want to see if there is a firmware upgrade available to fix the real problem.