报错:failed: Network is unreachable.

2018年6月27日 | 分类: 【技术】

刚才新建一个IPV6的VPS,执行获取外网文件时,报错:

wget amon.org/aa.zip

输出:

--2018-06-26 21:45:52--  https://amon.org/aa.zip
Resolving amon.org (amon.org)... 47.52.253.124
Connecting to amon.org (amon.org)|47.52.253.124|:80... failed: Network is unreachable.

参考:https://blog.csdn.net/liukun321/article/details/6662950
参考:https://askubuntu.com/questions/645008/ipv6-connect-network-is-unreachable
参考:https://www.howtoforge.com/community/threads/connect-network-is-unreachable.2098/
参考:https://askubuntu.com/questions/415023/connect-network-is-unreachable-ping
参考:https://serverfault.com/questions/581159/unable-to-add-a-static-route-sioaddrt-network-is-unreachable
参考:https://superuser.com/questions/667631/network-is-unreachable-when-attempting-to-ping-google-but-internal-addresses
参考:https://ubuntuforums.org/showthread.php?t=2215975

执行命令:

[ -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 。

那么怎么配置 IPV6 呢?

等待实证:

执行:

netstat -nr

输出:

192.168.0.0 0.0.0.0 255.255.255.0 u 0 0 0 eth0

执行:

/sbin/route add -net 0.0.0.0 gw 1.1.1.1 eth0

使用你的路由器(网关)的内部IP地址替换 1.1.1.1 。