設定 IPv6

我們的網絡全面支援 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"
2. 執行 "update-grub"
3. 修改 /etc/sysctl.conf ,移除所有包含 "disable_ipv6 = 1" 的行
4. 重啟

Windows

1. 控制台 -> 網路和網際網絡 -> 網路連線
2. 滑鼠右按相關介面卡,選擇 "內容"
3. 選取 "網際網絡通訊協定第6版 (TCP/IPv6)"
4. 按 "確定"

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"
2. Run "update-grub"
3. Edit /etc/sysctl.conf and remove all lines with "disable_ipv6 = 1"
4. Reboot

Windows

1. Control Panel -> Network and Internet -> Network Connections
2. Right click the network adaptor, choose "Properties"
3. Tick "Internet Protocol Version 6 (TCP/IPv6)"
4. Click "OK"

 

  • 4 Users Found This Useful
這篇文章有幫助嗎?