UbuntuHelp:WebBrowsingSlowIPv6IPv4/zh
来自Ubuntu中文
Dgww(讨论 | 贡献)2008年7月8日 (二) 14:55的版本 (新页面: == 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
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>