757 字
4 分钟
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 = 443
username = "账号"
password = "密码"
# 代理端口
socks_bind = ":1090"
http_bind = ":1091"
# 非浙大人员请将以下两项置为 true 以避免冲突
disable_zju_config = true
disable_zju_dns = true
dns_ttl = 3600
disable_keep_alive = false
zju_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.toml
2026/02/22 09:58:02 Start ZJU Connect v1.0.0-beta.4-b593140
2026/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 successfully
2026/02/22 09:58:02 VPN protocol: atrust
2026/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: Radius
2026/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,将其中的 LoginDomainAuthType 分别对应地写入 toml 配置文件中即可。然后重新启动 zju-connect 即可。

代理配置#

根据上述配置文件中设置的代理端口,需要给 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:
- 🚀 节点选择
- 🎯 全球直连
- 🏫 校园网
- DIRECT
支持作者
支付宝收款码
支付宝
微信收款码
微信
zju-connect 代替 aTrust 客户端
https://blog.085404.xyz/posts/zju-connect-代替-atrust-客户端/
作者
Sun2ot
发布于
2026-02-22
许可协议
CC BY-NC-SA 4.0

分享文章

生成精美分享图或复制链接,与更多人分享本文。

继续阅读

沿着主题读

基于共同的标签与分类

换条路线

从其他文章中稳定抽取

最后更新于 ,距今已过 199

部分内容可能已过时