412 字
1 分钟
zju-connect 代替 aTrust 客户端
背景
继上一次 解决毒瘤深信服easyconnect,校方随大流已将 VPN 升级为深信服的 aTrust。当然,🐶改不了吃💩,软件换皮不能改变其强兼你电脑的本质。好在互联网冲浪时发现浙江大学的同学提供了 ZJU RVPN 客户端的 Go 语言实现,经实测其可完全使用与常规 aTrust VPN 的使用场景。
下载
下载 zju-connect 的 beta 或者 nightly 版本。由于是独立二进制文件,因此解压后即可使用。如果是生产环境上需要,也可以考虑 Docker 部署。
配置文件
zju-connect 以 toml 作为配置文件,配置字段可参考 参数说明。下面给出一个基本配置文件:
protocol = "atrust"# 修改为学校的 vpn 地址server_address = "vpn.nmu.edu.cn"server_port = 443username = "账号"password = "密码"
# 代理端口socks_bind = ":1090"http_bind = ":1091"
# 非浙大人员请将以下两项置为 true 以避免冲突disable_zju_config = truedisable_zju_dns = true
dns_ttl = 3600disable_keep_alive = falsezju_dns_server = "auto"secondary_dns_server = "114.114.114.114"debug_dump = false
port_forwarding = []custom_dns = []
# aTrust 设置auth_type = "auth/psw"login_domain = "BMD"
client_data_file = "client_data.json"graph_code_file = "graph_code.jpg"update_best_nodes_interval = 300关于上述配置文件中的 aTrust 设置,需要根据实际情况进行配置。具体来说,当启动 zju-connect 后,终端显示如下:
❯ .\zju-connect.exe -config .\config.toml2026/02/22 09:58:02 Start ZJU Connect v1.0.0-beta.4-b5931402026/02/22 09:58:02 Read client data file error: open client_data.json: The system cannot find the file specified.2026/02/22 09:58:02 Will create a new client data file if log in successfully2026/02/22 09:58:02 VPN protocol: atrust2026/02/22 09:58:02 Perform GET /passport/v1/public/authConfig# --------------注意这一行-----------------2026/02/22 09:58:02 Available authentication methods: [{LoginDomain:BMD AuthType:auth/psw AuthName:师生用户 LoginURL:} {LoginDomain:local AuthType:auth/psw AuthName:非师生用户 LoginURL:}]# ------------------------------2026/02/22 09:58:02 Login error: auth type/login domain combination not found: auth type: auth/psw, login domain: Radius2026/02/22 09:58:02 VPN client setup error: auth type/login domain combination not found: auth type: auth/psw, login domain: Radius首次启动失败后的日志中会显示 Available authentication methods,将其中的 LoginDomain 和 AuthType 分别对应地写入 toml 配置文件中即可。然后重新启动 zju-connect 即可。
代理配置
NOTE此处以 clash 系列为例,v2ray 等其他代理内核的原理一致。
根据上述配置文件中设置的代理端口,需要给 clash 添加新的代理节点、策略组和分流规则。
# 代理端口socks_bind = ":1090"http_bind = ":1091"clash 配置文件变动如下:
# 注意: 新增的分流规则添加在顶部rules: # vpn 地址保持直连 - DOMAIN,vpn.nmu.edu.cn,🎯 全球直连 # 内网域名和IP段走策略组 - DOMAIN-SUFFIX,nmu.edu.cn,🏫 校园网 - IP-CIDR,10.0.0.0/8,🏫 校园网,no-resolve - IP-CIDR,172.16.0.0/12,🏫 校园网,no-resolve
proxies:- name: zju-local type: socks5 server: 127.0.0.1 port: 1090 udp: true
proxy-groups: - type: select name: 🏫 校园网 proxies: - 🚀 节点选择 - 🎯 全球直连 - zju-local - DIRECT # 学术科研的策略组根据实际情况添加 # 我这里是因为对文献库做了分流 - type: select name: 📚 学术科研 proxies: - 🚀 节点选择 - 🎯 全球直连 - 🏫 校园网 - DIRECTWARNING出于特殊原因,我无需使用脚本完成配置文件修改,因此本文不提供 clash 桌面端的脚本。
zju-connect 代替 aTrust 客户端
https://blog.085404.xyz/posts/zju-connect-代替-atrust-客户端/ 部分信息可能已经过时









