在 Ubuntu 16.04 VPS 上启用 IPv6

Syl*_*lon 2 server ipv6 14.04

我的系统:Ubuntu 16.04 服务器,Nginx 1.10,PHP 7。我只有 VPS 的 IPv6 地址。请写好设置 IPv6 的链接或信息。

对于 IPv4:

address 188.225.32.215
netmask 255.255.255.255
gateway 188.225.32.1
Run Code Online (Sandbox Code Playgroud)

对于 IPv6:

address 2a03:6f00:4::bce1:224d
netmask 64
gateway 2a03:6f00:4::1
Run Code Online (Sandbox Code Playgroud)

如果配置:

--------------------------------
eth0      Link encap:Ethernet  HWaddr 8a:cf:f5:f9:78:c7
          inet addr:188.275.37.215  Bcast:188.275.37.255  Mask:255.255.255.0
          inet6 addr: fe80::88cf:f5ff:fef9:78c7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37797386 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54146 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1856762239 (1.8 GB)  TX bytes:47193912 (47.1 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:196 (196.0 B)  TX bytes:196 (196.0 B)
--------------------------------

/etc/network/interfaces

--------------------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
--------------------------------
Run Code Online (Sandbox Code Playgroud)

/etc/network/interfaces.d - 空的。

Tho*_*ard 8

提供的信息(以可读格式):

IPv4:(
待定或未提供)

IPv6:
地址:2a03:6f00:4::bce1:224d
网络掩码:/64
网关:2a03:6f00:4::1

这些假设是由回答者添加的,因为这些不是由 OP 提供的:
DNS Nameservers (Google DNS, IPv4): 8.8.8.8, 8.8.4.4
DNS Nameservers (Google DNS, IPv6):2001:4860:4860::8888, 2001:4860:4860::8844

从我的其他 VPS 之一(不一定来自同一提供商)获取此信息,我将使用我的/etc/network/interfaces作为指南。 更改这些设置后,您需要重新启动 VPS。

使用Debian wiki 上的此页面作为指南(在大多数情况下适用于 Ubuntu),以及您从 VPS 提供商处获得的信息,类似这样的信息就是您希望获得的信息/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
iface eth0 inet6 static
    address 2a03:6f00:4::bce1:224d
    netmask 64
    gateway 2a03:6f00:4::1
    dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844
Run Code Online (Sandbox Code Playgroud)

重新启动后,您应该将 IPv6 映射到您的系统并可用。您可以通过运行ping6 2001:4860:4860::8888来尝试和测试,以确保您可以在 v6 上访问 'net;如果它返回 ping 并且没有出错,那么你应该准备好了。否则,我们将不得不进行一些复杂的调试。