跳至内容
九溪
溪水润知林,滴露启慧心
用户工具
登录
站点工具
搜索
工具
显示页面
过去修订
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您在这里:
Home
»
ColinOL Home
»
知识标签
»
Linux
»
Linux 支持 ipv6 网络
您的足迹:
•
Office Word 无格式文本粘贴
pages:wiki:linux:ipv6-support
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== Linux 支持 ipv6 网络 ====== 如果默认的网络环境不支持ipv6(只支持ipv4), 概要:通过 https://www.tunnelbroker.net 建立tunnel隧道,使得linux能够支持ipv6网络 ===== 创建隧道 ===== - 注册 [[https://www.tunnelbroker.net|Tunnel broker]] - 创建通道“Create Regular Tunnel” * 填写VPS的公网 IP 地址。填写IP时出现“IP is a potential tunnel endpoint.”说明可以添加ipv6隧道。 * 选择隧道节点,点击Create Tunnel创建。 * 关于隧道节点的选择,大家可以在自己的云服务器上分别ping一下提供的IP,选时延低的。 - 创建IPv6隧道及路由: * 到下一页面切换到Example configurations选项卡, * 下拉菜单选择Debian/Ubuntu, * 复制出现的内容。类似下面的代码 <code> auto he-ipv6 iface he-ipv6 inet6 v4tunnel address xxxx:xxx:xxxx:xxx::x netmask 64 endpoint xxx.xxx.xxx.xx local xxx.xxx.xxx.xxx ttl 255 gateway xxxx:xxx:xxxx:xxx::x </code> ===== 在主机中添加ipv6隧道 ===== ==== 修改 ==== 编辑文件,将刚才复制的内容粘贴进去。 vim /etc/network/interfaces <code> auto he-ipv6 iface he-ipv6 inet6 v4tunnel address xxxx:xxx:xxxx:xxx::x netmask 64 endpoint xxx.xxx.xxx.xx local xxx.xxx.xxx.xxx ttl 255 gateway xxxx:xxx:xxxx:xxx::x </code> 添加DNS vim /etc/resolvconf/resolv.conf.d/base 加入以下内容 <code> nameserver 2001:4860:4860::8844 nameserver 2001:470:20::2 </code> 保存后,执行以下命令 resolvconf -u 重启网络 service networking restart 或者重启主机 reboot 然后,执行 ifconfig 应该可以看到 he-ipv6 网卡 没有的话,执行 ifup he-ipv6 ==== 检测 ==== 接着连通测试 ping6 -c 5 2001:4860:4860::8888 ping6 -c 5 ipv6.google.com Ping通了,说明网络已连通,能正常解析域名,说明DNS也正常。 其他IPv6 测试工具: - http://ipv6-test.com/ - https://ipv6test.google.com/ - http://test-ipv6.com/ 如何确定目前连接的方式为 IPv4 还是 IPv6?打开 https://www.google.com/search?hl=en&q=what+is+my+ip ,如果显示的您的 IP 地址为 IPv6 格式说明您是以 IPv6 的形式接入的,否则为 IPv4 形式。 ==== Hosts ==== 如果需要指定域名通过IPv6 访问,修改Hosts文件即可。 vi /etc/hosts 如强制使用IPV6访问谷歌,也非常简单,在/etc/hosts里添加 # Google 2607:f8b0:4005:811::200e google.com 2607:f8b0:4005:80c::2004 www.google.com # Google Scholar 2607:f8b0:4005:80a::200e scholar.google.cn 2607:f8b0:4005:80a::200e scholar.google.com 2607:f8b0:4005:80a::200e scholar.google.com.hk 2607:f8b0:4005:80a::200e scholar.google.com.sg 2607:f8b0:4005:80a::200e scholar.google.com.tw 2607:f8b0:4005:80a::200e scholar.google.com.uk 2607:f8b0:4005:80a::200e scholar.l.google.com Linux刷新dns的缓存方法是: sudo /etc/init.d/nscd restart 如果发现提示命令找不到:sudo: /etc/init.d/nscd: command not found 需要先安装nscd包: sudo apt-get install nscd 最暴力的方法刷dns,重启网络: sudo /etc/init.d/networking restart 查询可用的ip地址 * [[.find-ip]] 参考: * [[https://www.itkylin.com/xiao_bai_jiao_cheng_rang_vps_zhi_chi_ipv6.html|小白教程,让VPS支持IPv6]] * [[https://www.sudops.com/config-ipv6-via-he-tunnel.html|利用HE.net的Tunnel配置IPv6(debain)]] * [[https://hostloc.com/thread-467395-1-1.html|VIRMACH访问Google老显示异常流量 IPV6可破]] **运行 resolvconf -u 出现以下信息** /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf 解决办法: sudo rm /etc/resolv.conf sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf sudo resolvconf -u **无法使用ifconfig时,尝试运行以下命令** sudo apt install net-tools
pages/wiki/linux/ipv6-support.txt
· 最后更改: 2023/01/03 15:08 由
127.0.0.1
页面工具
显示页面
过去修订
反向链接
回到顶部