sing-box+hy2绕过校园网认证
sing-box+hy2绕过校园网认证
First前置条件:
首先连接上你的校园网(不要登录认证),然后打开cmd,然后拿最好的测网络的工具:“百度” 进行测试是否可行。
nslookup www.baidu.com |
如果返回结果类似如下,则可以利用 DNS 查询来绕过验证。
服务器:UnKnown |
你的返回结果不一定和上图一模一样,如果你成功查询到了 www.baidu.com 的服务器 IP<span> </span>,80% 就能成功,本教程将适合你。
教程开始(以下教程在Ubuntu系统下进行):
服务端(服务器操作)
一、确保服务器已安装docker和OpenSSL
二、把自己的一个域名A记录指向服务器IP,记住这个域名
三、使用OpenSSL签发域名自签证书
- 创建需要的文件夹
sudo mkdir -p /opt/docker/sing-box /opt/docker/sing-box/cert
- 生成私钥:使用以下命令生成一个私钥文件
openssl genpkey -algorithm RSA -out /opt/docker/sing-box/cert/key.pem
- 生成证书请求:**
*.example.com替换为步骤二域名**openssl req -new -key /opt/docker/sing-box/cert/key.pem -out /opt/docker/sing-box/cert/csr.pem -subj "/CN=*.example.com"
- 自签名证书
openssl x509 -req -days 5475 -in /opt/docker/sing-box/cert/csr.pem -signkey /opt/docker/sing-box/cert/key.pem -out /opt/docker/sing-box/cert/cert.pem
四、在/opt/docker/sing-box目录下创建config.json文件,内容如下(sing-box配置文件)
注:listen_port 可以是 53, 65, 66, 67, 68 哪个可以用用哪个 优先 53,其余字段自行按照说明自改
Ubuntu系统 53 端口可能被systemd-resolved占用,解决方法如下:
### 打开 systemd-resolved 配置文件: |
config.json内容:
{ |
五、docker启动sing-box
docker run -itd \ |
到此,各处防火墙请放行用到的端口(udp),服务端操作全部完成
客户端(windows为例)
六、下载clash客户端 clash-nyanpasu 或 clash-verge-rev,安装,连接上你的校园网(不要登录认证)
七、在软件内新建本地配置,内容见如下链接,根据实际修改,并启用
https://gist.githubusercontent.com/aurorax-neo/f5b961447048182a5051bd727b665c84/raw/44f873977f9054b5ef5ba4db7620f383acc2469f/template.yaml |
## 链接内的内容如下 |
八、软件切换到代理
1.开启全局模式并选择hy2-tun节点
九、软件切换到设置
1.安装服务模式并启用
2.开启tun模式
如果不出以意外,你的电脑已经有网络了,享受吧!!!
评论
匿名评论隐私政策