Ipv6 - Connect : Network is unreachable
I've just created a virtual Ubuntu machine in VMWare Player but ipv6 is not working.
When I try to ping Google with
ping6 I get
connect: Network is unreachableWhen I use Wireshark, I see that I'm not sending any Icmpv6 packet.
How can I fix it ? Does anyone have an idea ?
EDIT:
I can ping my router with ipv6. Thus, I can send Icmpv6 packets.
Is the problem related to ipv6 autoconfiguration ?
42 Answers
How to know if IPv6 is configured and working on ubuntu?
Run the command:
[ -f /proc/net/if_inet6 ] && echo 'IPv6 OK' || echo 'No IPv6'If the output is
IPv6 OKThen your system can work with IPV6.
Now run the command:
lsmod | grep -qw ipv6 && echo "IPv6 kernel driver loaded and configured." || echo "IPv6 not configured and/or driver loaded on the system."If the output is:
IPv6 kernel driver loaded and configured.This means the IPV6 is configured and you can use it but if(and this is your case from comment above) the answer is
IPv6 not configured and/or driver loaded on the system.this means IPV6 is not configured in your system, and for that you can't use IPV6 yet.
How to enable IPV6 in Ubuntu
Run this command:
sudo modprobe ipv6Now test if this works:
lsmod | grep ipv6The outpu should be like :
ipv6 XXXX xXsource and more information :
10Today I also encounter this issue. From the answer of Maxthux.
[ -f /proc/net/if_inet6 ] && echo 'IPv6 OK' || echo 'No IPv6' returns ok
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.And sudo modprobe ipv6 has no influence on lsmod | grep ipv6 's empty output.
After about a whole afternoon's searching, I find a way out.
Here is the detail setup for my ipv6.
I use vps of digitalocean, and I've use only ipv4 for about a year. Recently for ios app, I've to setup ipv6 of my vps. I refer to this post, and it's a little too old, so there have some changes.
A: login the degitalocean droplets manage page, click the enable link of ipv6 on the droplet page. Here it may ask you to shutdown you droplet before you enable it. After enabled, on the networking page you can see the below pic. Here I mask the ip information.
B: Temporarily add ipv6 address. Login to the system with ssh, use this command:
ip -6 addr add new_IPv6_address_in_range/64 dev eth0and check it with ip -6 addr show eth0
Here you can host -t AAAA google.com
root@xx:~# host -t AAAA google.com
google.com has IPv6 address 2404:6800:4003:c00::71but ping6 2404:6800:4003:c00::71 will result
Connect: Network is unreachable
C: Add additional ipv6 address
sudo nano /etc/network/interfacesadd below to this file, then change address and gateway according to you droplet page.
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.3Then reboot you system:
After reboot, check it.
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