Ipv6 – 连接:网络无法访问

我刚刚在VMWare Player中创建了一个虚拟的Ubuntu机器,但ipv6无法运行。

当我尝试ping谷歌时

ping6 www.google.be 

我明白了

 connect: Network is unreachable 

当我使用Wireshark时,我发现我没有发送任何Icmpv6数据包。

我该如何解决? 有没有人有想法?


编辑:

我可以用ipv6 ping我的路由器。 因此,我可以发送Icmpv6数据包。

问题与ipv6自动配置有关吗?

如何知道IPv6是否已配置并正在使用ubuntu?

运行命令:

 [ -f /proc/net/if_inet6 ] && echo 'IPv6 OK' || echo 'No IPv6' 

如果输出是

 IPv6 OK 

然后您的系统可以使用IPV6。

现在运行命令:

 lsmod | grep -qw ipv6 && echo "IPv6 kernel driver loaded and configured." || echo "IPv6 not configured and/or driver loaded on the system." 

如果输出是:

 IPv6 kernel driver loaded and configured. 

这意味着IPV6已配置,您可以使用它,但如果(以上是评论的情况),答案是

 IPv6 not configured and/or driver loaded on the system. 

这意味着系统中未配置IPV6,因此您无法使用IPV6。

如何在Ubuntu中启用IPV6

运行此命令:

 sudo modprobe ipv6 

现在测试一下是否有效:

 lsmod | grep ipv6 

outpu应该像:

 ipv6 XXXX xX 

来源和更多信息: http : //www.tldp.org/HOWTO/Linux+IPv6-HOWTO/systemcheck-kernel.html

今天我也遇到了这个问题。 从Maxthux的答案。

[ -f /proc/net/if_inet6 ] && echo 'IPv6 OK' || echo 'No IPv6' [ -f /proc/net/if_inet6 ] && echo 'IPv6 OK' || echo 'No IPv6'返回正常

 lsmod | grep -qw ipv6 && echo "IPv6 kernel driver loaded and configured." || echo "IPv6 not configured and/or driver loaded on the system." returns IPv6 not configured and/or driver loaded on the system. 

sudo modprobe ipv6lsmod | grep ipv6没有影响 lsmod | grep ipv6的空输出。

经过大约一整个下午的搜索,我找到了出路。

这是我的ipv6的详细设置。

我使用vps of digitalocean,我只使用ipv4大约一年。 最近对于ios应用程序,我要设置我的vps的ipv6。 我指的是这篇文章,它有点太旧了,所以有一些变化。

:登录degitalocean drops管理页面,点击Droplet页面上ipv6的启用链接。 在启用它之前,它可能会要求您关闭Droplet。 启用后,在网络页面上,您可以看到下面的图片。 在这里我掩盖了ip信息。

在此处输入图像描述

B :暂时添加ipv6地址。 使用ssh登录系统,请使用以下命令:

 ip -6 addr add new_IPv6_address_in_range/64 dev eth0 

并使用ip -6 addr show eth0

在这里你可以host -t AAAA google.com

 root@xx:~# host -t AAAA google.com google.com has IPv6 address 2404:6800:4003:c00::71 

ping6 2404:6800:4003:c00::71将导致ping6 2404:6800:4003:c00::71

连接:网络无法访问

C :添加额外的ipv6地址

 sudo nano /etc/network/interfaces 

将以下内容添加到此文件中,然后根据您的Droplet页面更改地址和网关。

 iface eth0 inet6 static address primary_ipv6_address netmask 64 gateway ipv6_gateway autoconf 0 dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888 209.244.0.3 

然后重启系统:

重启后,检查一下。

 root@xx:~# host -t AAAA google.com google.com has IPv6 address 2404:6800:4003:c00::66 root@xx:~# ping6 -c4 2404:6800:4003:c00::66 PING 2404:6800:4003:c00::66(2404:6800:4003:c00::66) 56 data bytes 64 bytes from 2404:6800:4003:c00::66: icmp_seq=1 ttl=51 time=2.08 ms 64 bytes from 2404:6800:4003:c00::66: icmp_seq=2 ttl=51 time=2.01 ms 64 bytes from 2404:6800:4003:c00::66: icmp_seq=3 ttl=51 time=1.83 ms 64 bytes from 2404:6800:4003:c00::66: icmp_seq=4 ttl=51 time=1.81 ms --- 2404:6800:4003:c00::66 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 1.815/1.937/2.085/0.118 ms