我們的網絡全面支援 IPv6,但VPS鏡象默認不使用 IPv6。原因是若果有 IPv6 設定,系統默認首先使用 IPv6,但很多互聯網伺服器雖然有 IPv6 DNS 地址,但經常 IPv6 網絡未全面優化,速度比較慢,造成操作系統超時後才使用 IPv4。軟件下載及更新操作延遲特別顯著。
但是個別應用場景,或者可以得益於 IPv6。若果需要使用或測試 IPv6,需要在建立 VPS 後,手動作出以下更改。
CentOS
1. 修改 /etc/sysconfig/network-scripts/ 下面的網絡卡設定檔,在最後增加兩行:
IPV6INIT=yes
IPV6_AUTOCONF=yes
2. 修改 /etc/sysctl.conf ,移除所有包含 "disable_ipv6 = 1" 的行
3. 重啟
Ubuntu / Debian
1. 修改 /etc/default/grub ,移除所有 "ipv6.disable=1", 變成
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
2. 執行 "update-grub"
3. 修改 /etc/sysctl.conf ,移除所有包含 "disable_ipv6 = 1" 的行
4. 重啟
Windows
1. 執行 "regedit"
2. 修改 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents ,將數值改為 0
3. 重啟
Our network fully supports IPv6. But our VPS templates are configured with IPv6 disabled by default. The reason was that when IPv6 is enabled, the operating system will default to IPv6, but many hosts (including software downloads and gaming etc) though having IPv6 configured, does not work very well. Some hosts have IPv6 DNS addresses but the actual address is not optimally announced through IPv6 BGP, causing timeouts before falling back to IPv4. This causes long delays especially tasks like software download and installation.
But your application may be different and could benefit from IPv6. To enable IPv6 manually,
CentOS
1. Edit the interface config file in /etc/sysconfig/network-scripts/ and add these two lines at the bottom
IPV6INIT=yes
IPV6_AUTOCONF=yes
2. Edit /etc/sysctl.conf and remove all lines with "disable_ipv6 = 1"
3. Reboot
Ubuntu / Debian
1. Edit /etc/default/grub and remove all "ipv6.disable=1", so that the two lines become
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
2. Run "update-grub"
3. Edit /etc/sysctl.conf and remove all lines with "disable_ipv6 = 1"
4. Reboot
Windows
1. Run "regedit"
2. Set the registry key value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents to 0
3. Reboot