保存为×××.bat文件运行
@echo off
title 纪念1989—反对网络封锁!
echo
echo
cls
@echo 信息是自由的,就像空气,这是文明国家的基本原则。
chcp 936>nul
mode concols=80lines=330
echo install IPV6 &color 0a&
::WINDOWS版本定义区
set oss=Win XP3 & echo XP SP3: Microsoft Windows XP [Version 5.1.2600]
set oss=Win2003 sp2 & echo Win2003 SP2: Microsoft Windows [Version 5.2.3790]
set oss=Win2003 R2 SP2& echo Win2003 R2 SP2: Microsoft Windows [Version 5.2.3790]
set oss=win Vista SP2 & echo Vista SP2: Microsoft Windows [Version 6.0.6002]
set oss=win7 & echo Win7: Microsoft Windows [Version 6.1.7600]
set oss=win xp3 & echo XP SP3: Microsoft Windows XP [版本 5.1.2600]
:end
@echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
@echo ※ ※
@echo ※ 【 IPv6安装配置工具】 ※
@echo ※ ※
@echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
@echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
@echo ※ ※
@echo ※ ※
@echo ※ 信息和知识是抵达真理的源泉!信息和知识的自由是孕育源泉的最佳母腹! ※
@echo ※ ※
@echo ※ ※
@echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
@echo off
echo Get Admin
::ver|findstr "[6,10]\.[0-9]\.[0-9][0-9]*" > nul && (goto Main)
::ver|findstr "[3-5]\.[0-9]\.[0-9][0-9]*" > nul && (goto isBelowNT6)
:: :isBelowNT6
:Main
@echo off
cd /d "%~dp0"
cacls.exe "%SystemDrive%\System Volume Information" >nul 2>nul
if %errorlevel%==0 goto Admin
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
echo Set RequestUAC = CreateObject^("Shell.Application"^)>"%temp%\getadmin.vbs"
echo RequestUAC.ShellExecute "%~s0","","","runas",1 >>"%temp%\getadmin.vbs"
echo WScript.Quit >>"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs" /f
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
exit
:Admin
@echo off
echo Get Admin
::ver|findstr "[6,10]\.[0-9]\.[0-9][0-9]*" > nul && (goto Main)
::ver|findstr "[3-5]\.[0-9]\.[0-9][0-9]*" > nul && (goto isBelowNT6)
:: :isBelowNT6
:Main
@echo off
cd /d "%~dp0"
cacls.exe "%SystemDrive%\System Volume Information" >nul 2>nul
if %errorlevel%==0 goto Admin
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
echo Set RequestUAC = CreateObject^("Shell.Application"^)>"%temp%\getadmin.vbs"
echo RequestUAC.ShellExecute "%~s0","","","runas",1 >>"%temp%\getadmin.vbs"
echo WScript.Quit >>"%temp%\getadmin.vbs"
"%temp%\getadmin.vbs" /f
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
exit
:Admin
@echo off
@echo off
@echo 配置RpcEptMapper自动服务
sc config RpcEptMapper start=auto
sc start RpcEptMapper
@echo 配置DcomLaunch自动服务
sc config DcomLaunch start=auto
sc start DcomLaunch
@echo 配置RpcSs自动服务
sc config RpcSs start=auto
sc start RpcSs
@echo 配置nsi自动服务
sc config nsi start=auto
sc start nsi
sc config Wingmt start=auto
sc start Winmgmt
@echo 配置Dhcp 自动服务
sc config Dhcp start=auto
sc start Dhcp
@echo 配置WinHttpAutoProxySvc自动服务
sc config WinHttpAutoProxySvc start=auto
sc start WinHttpAutoProxySvc
@echo 配置并启动iphlpsvc 自动服务
sc config iphlpsvc start=auto
sc start iphlpsvc
@echo 配置ipv6 恢复服务
netsh int ipv6 reset
@echo 配置teredo 默认服务
netsh int teredo set state default
@echo 配置6to4默认服务
netsh int 6to4 set state default
@echo 配置isatap默认服务
netsh int isatap set state default
@echo 配置teredo.remlab.net默认服务
netsh int teredo set state server=teredo.remlab.net
@echo 配置 teredo为natawareclient类型
netsh int ipv6 set teredo natawareclient
@echo 配置 teredo 类型 状态
netsh int ter set state natawareclient
@echo 删除route端口
route DELETE ::/0
@echo 为ipv6增加route端口
netsh int ipv6 add route ::/0 "Teredo Tunneling Pseudo-Interface"
@echo 为ipv6的prefix 进行优先排序
netsh int ipv6 set prefix 2002::/16 30 1
netsh int ipv6 set prefix 2001::/32 5 1
@echo 修改注册表增加Dnscache缓存的 AddrConfigControl值
Reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Dnscache\Parameters /v AddrConfigControl /t REG_DWORD /d 0 /f
@echo 修改注册表增加Tcpip6的系统 DisabledComponents 值
Reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0 /f
@echo 在注册表中修改组策略增加v6Transition值以控制刷新时间——必须访问组策略实现
:: Set Group Policy
:: HKLM\Software\Policies\Microsoft\Windows\TCPIP\v6Transition -Name Teredo_DefaultQualified
:: HKLM\Software\Policies\Microsoft\Windows\TCPIP\v6Transition -Name Teredo_State
@echo 设定teredo状态
netsh int teredo set state default
@echo 设定6to4状态
netsh int 6to4 set state default
@echo 设定 isatap 状态
netsh int isatap set state default
@echo 设定teredo服务器为teredo.remlab.net
netsh int teredo set state server=teredo.remlab.net
@echo 在注册表中修改端口和刷新时间(这里是60秒/1分钟)
@echo 在注册表中修改端口和刷新时间(这里是60秒/1分钟)
set state natawareclient teredo.remlab.net. 60 443
@echo 设定teredo服务器为natawareclient类型
netsh int ipv6 set teredo natawareclient
@echo 为teredo服务器的natawareclient类型设置natawareclient状态
netsh int ter set state natawareclient
@echo 为 ipv6设端口::/0链接到Teredo
netsh int ipv6 add route ::/0 "Teredo Tunneling Pseudo-Interface"
@echo 为ipv6 的prefix 排序
netsh int ipv6 set prefix 2002::/16 30 1
netsh int ipv6 set prefix 2001::/32 5 1
@echo 刷新 DNS 解析缓存。
ipconfig /flushdns
@echo 更换IP
netsh
interface ipv6
set privacy enabled
ping -t bt.neu6.edu.cn
@echo 每隔2分钟切换临时IP
netsh int ipv6 set privacy maxpreferredlifetime=120s maxrandomtime=1s store=active
@echo 激活IP更换
netsh int ipv6 set privacy maxpreferredlifetime=1d maxrandomtime=10m store=active
@echo 参考:
@echo https://en.wikipedia.org/wiki/IPv6_address
@echo 更换IP
netsh
interface ipv6
set privacy enabled
ping -t bt.neu6.edu.cn
@echo 每隔2分钟切换临时IP
netsh int ipv6 set privacy maxpreferredlifetime=120s maxrandomtime=1s store=active
@echo 激活IP更换
netsh int ipv6 set privacy maxpreferredlifetime=1d maxrandomtime=10m store=active
@echo 参考:
@echo https://en.wikipedia.org/wiki/IPv6_address
set time=%date:~0,4%-%date:~5,2%-%date:~8,2%_%time:~0,2%%time:~3,2%%time:~6,2%
@call :output>ipv6time.txt
exit
:output
@echo 显示配置
@echo off
netstat -a -n -y -s -q -x -b
netstat -a -n -y -s -q -x -b
ipconfig /all
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
notepad >config.txt