Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【融】WIN下IPV6通用批处理(双11更新) #8254

Open
ylwszb opened this issue Nov 11, 2017 · 9 comments
Open

【融】WIN下IPV6通用批处理(双11更新) #8254

ylwszb opened this issue Nov 11, 2017 · 9 comments

Comments

@ylwszb
Copy link

ylwszb commented Nov 11, 2017

随着 “墙” 越来越高,给电脑开IPV6成为了一个热门话题,有不少计算机网络爱好者都在研究此问题,俺也是其中一员。

在Issues内已经有不少关于如何开启IPV6的相关帖子,在wiki内还有如何开启IPv6的很多教程可以借鉴。

但是,直到目前为止,对于部分WIN系统用户而言开启IPV6仍然是个难题。

开启IPV6最常见的两大难题(遇到了我也很棘手,不能保证都能处理):

(1)系统无法自动识别与正确安装隧道适配器

IPV6的隧道适配器分为三种,分别是:teredo、6to4、isatap

teredo:是大家最常用的隧道适配器,主要用于内网。
6to4:具有公网IP且ISP服务商必须提供IPV6服务的才能使用。
isatap:一般是教育网专用,非教育网几乎无法使用。

如能使用原生IPv6是最好不过了,很遗憾大部分用户仍然无法使用。

如果在issues内,咨询和提问都不能解决适配器正确安装和使用的问题,那就请重装系统解决吧!

(2)无法通过公共隧道服务器获取IPV6的IP地址

如果你的适配器能够正常工作,就是收不到公共隧道服务器分配给你的IPV6的IP地址时,请尝试更换新的公共隧道服务器,这样有可能会解决IPV6获取IP地址的问题。

当然,如果你的ISP服务器商屏蔽了你的公共隧道服务器使用,就算更换多少个公共隧道服务器也是无济于事,彻底放弃吧!

言归正传,下面来说说通用批处理:

只有在运行批处理时才能发现上面的两大难题,如果遇到了先在issues内提问或反馈,看看是否能解决,如不能很好的解决,就只能重装系统或更换新的隧道服务器来解决问题了。

本批处理融合了三个隧道,但关闭了6to4和isatap隧道,因为在测试中发现,同时开启三个隧道,有网络干扰和网络不稳定的情况发生。所以只保留开启了teredo隧道,提高稳定性。

本批处理已在 WIN 7/8/10 以及WIN SERVER 2008/2012 下通过测试
XP用户请看wiki中相关教程:https://github.com/XX-net/XX-Net/wiki/IPv6-WinXP

批处理特点(适合大部分WIN系统用户使用):

(1)无需修改组策略,算是系统无组策略的用户福音
2

(2)无需开启“本地连接”中的IPV6协议,但必须要安装
1

(3)正常安装且能使用的teredo适配器是这样的
3
还有部分teredo适配器,显示(位置:在 Microsoft IPv4 IPv6 转换适配器总线 上),这样也是正常的。

综上所述,“IPV6 Teredo 隧道通用批处理” 就这样诞生了,批处理文件会放在后面,供大家下载,研究和使用。

@echo ==================================================
@echo WINDOWS 7/8/10 IPV6 Teredo 隧道通用批处理
@echo 6to4 和 isatap 隧道默认是关闭的,需要的可自行开启
@echo 测试中发现三个隧道同时开启,会出现互相干扰等情况
@echo **************************************************
@echo 提示1:请使用 “管理员身份运行” 本批处理文件。
@echo 提示2:执行批处理后如遇问题,请到 issues 内反馈。
@echo **************************************************
@echo 开启IPV6:请按任意键继续——( 等待完成 )
@echo 暂不开启:请直接关闭本窗口即可——( End )
@echo ==================================================
pause

@echo off

net start "ip helper"
netsh winsock reset

netsh int teredo show state

@echo ++++++++++++++++++++++++++++++++++++++++++++++++++
@echo 【6to4】具有公网IP且ISP服务商提供IPV6服务才可开启
netsh int ipv6 6to4 set state disabled
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++
@echo 【isatap】教育网专用隧道,非教育网请勿开启
netsh int ipv6 isatap set router isatap.tsinghua.edu.cn
netsh int ipv6 isatap set state disabled
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++
netsh int teredo set state default
netsh int teredo set state enterpriseclient server=default
netsh int teredo set state server=teredo.remlab.net
netsh int ipv6 set teredo client teredo.remlab.net
netsh int ipv6 set teredo enterpriseclient
netsh int teredo set state enterpriseclient
route delete ::1/128
route DELETE ::/0
netsh int ipv6 add route ::/0 "Teredo Tunneling Pseudo-Interface"
netsh int ipv6 set prefix 2002::/16 30 1
netsh int ipv6 set prefix 2001::/32 5 1
Reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache\Parameters /v AddrConfigControl /t REG_DWORD /d 0 /f

@echo ++++++++++++++++++++++++++++++++++++++++++++++++++
@echo 【6to4】具有公网IP且ISP服务商提供IPV6服务才可开启
netsh int ipv6 6to4 set state disabled
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++
@echo 【isatap】教育网专用隧道,非教育网请勿开启
netsh int ipv6 isatap set router isatap.tsinghua.edu.cn
netsh int ipv6 isatap set state disabled
@echo ++++++++++++++++++++++++++++++++++++++++++++++++++
netsh int teredo set state default
netsh int teredo set state enterpriseclient server=default
netsh int teredo set state server=teredo.remlab.net
netsh int ipv6 set teredo client teredo.remlab.net
netsh int ipv6 set teredo enterpriseclient
netsh int teredo set state enterpriseclient
route delete ::1/128
route DELETE ::/0
netsh int ipv6 add route ::/0 "Teredo Tunneling Pseudo-Interface" metric=1
netsh int ipv6 set prefix 2002::/16 30 1
netsh int ipv6 set prefix 2001::/32 5 1
Reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache\Parameters /v AddrConfigControl /t REG_DWORD /d 0 /f

ipconfig /all
ipconfig /flushdns
ipconfig /registerdns
netsh int ipv6 show teredo
netsh int ipv6 show route
netsh int ipv6 show int
netsh int ipv6 show prefix
netsh int ipv6 show address
route print

ipconfig /all
netsh int ipv6 show route
netsh int ipv6 show int
netsh int teredo show state

@echo ==================================================
@echo 所有命令都已执行完毕,如遇错误信息请反馈到 issues
@echo 如需修复 IPV6 请按任意键继续;不修复请直接关闭窗口
@echo ==================================================
pause
pause
netsh int ip reset
netsh int ipv6 reset
cmd

【重要提示】

(1)执行下面两条命令如报错是正常现象,无需纠结。
route delete ::1/128
route DELETE ::/0

(2)请注意你的teredo适配器名称,如果不是"Teredo Tunneling Pseudo-Interface",请更换。

(3)执行到批处理最后一步时,会询问是否修复 IP & IPV6 ,如果 IP & IPV6 工作正常,请勿修复,直接关闭窗口即可。

(4)随时用命令观察teredo运行状态,如不稳定请更换teredo公共服务器。
netsh int teredo show state
netsh int ipv6 show teredo

批处理文件下载:IPV6 update.zip
相关参考:
https://github.com/XX-net/XX-Net/wiki/%E5%A6%82%E4%BD%95%E5%BC%80%E5%90%AFIPv6
#7241

@ylwszb
Copy link
Author

ylwszb commented Nov 11, 2017

@Michael-X-Net

还没发表就被关闭了,这是啥情况?

@macroxmu
Copy link

试了下,感觉和之前的脚本执行起来没啥差异,执行都正常的,没有报错,但IPV6测试页就是通不过....T_T

@Marlect
Copy link

Marlect commented Nov 12, 2017

还是不行

@308901951
Copy link

我的环境是window7 专业版,组策略配置 6to4 ISATAP 配置为禁用状态 teredo默认限定 配置为已启用,在这之前teredo默认限定为 未配置,导致teredo适配器出现感叹号不能正常使用,但是今天配置teredo默认限定 为已启用,虽然出现感叹号,但是卸载teredo适配器,重新安装一次就恢复正常了,在没有配置teredo默认限定为已启用之前,也出现过感叹号也有自已恢复情况,具体情况还在摸索中,XX-NET今天就出现teredo适配器正常但是不能用,各种折腾,没作用,过了近2小时自己又恢复了正常了

@ylwszb
Copy link
Author

ylwszb commented Nov 12, 2017

IPV6开启失败,最主要的两个原因就是适配器和无法通过公共隧道服务器获取IPV6的地址。

前者(适配器):由于系统的原因经常会抽风,用着好好的也许适配器就出问题了,或者根本就装不上也无法识别,如果动用了命令、组策略、注册表、修复程序都不能解决,最好的办法就是重装系统。

后者(获取IPV6地址):一般都是公共隧道服务器不稳定引发的问题,遇到了换服务器地址就能解决。
如果是ISP服务商给屏蔽了,就别试了,再怎么折腾也没用。

@ylwszb
Copy link
Author

ylwszb commented Nov 12, 2017

@Marlect

用的是什么系统?在哪里出的问题?是否有截图?

@styrenes
Copy link

你这个就是个命令行集合而已,
显然很多系统,命令行根本不起作用的。比如我用netsh int teredo set state server=改变服务器,是不会起作用。
还实用的还是组策略。

@ylwszb
Copy link
Author

ylwszb commented Nov 12, 2017

@macroxmu

与老版本对比,只是对命令做了一些小小的变动和优化,为了提高执行成功率和稳定性。

比如增加了一些提示性的文字;增加了LSP修复命令;关闭了三个隧道中的两个,为了提高Teredo隧道稳定性;将修复IP & IPV6的命令放到最后,有需要的可以执行修复。都是些小变动……

@ylwszb
Copy link
Author

ylwszb commented Nov 12, 2017

@styrenes

netsh int teredo set state server=teredo.remlab.net
netsh int ipv6 show teredo

netsh int teredo set state server=teredo.trex.fi
netsh int ipv6 show teredo

使用这两个隧道服务器设置完后查询teredo状态时,服务器名称是不一样的。
也就意味着获取IPV6地址,是从两个不同的服务器上获取的。
怎么会不起作用呢?
除非隧道服务器都被封了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants