zh

Tor中继节点搭建教程:贡献带宽支持全球网络自由

Tor网络的速度和可靠性依赖于全球志愿者运营的中继节点。运行Tor中继节点是对抗互联网审查的直接贡献,帮助包括中国、俄罗斯、伊朗在内的受审查地区用户访问自由互联网。本教程指导你在AnubizHost境外VPS上搭建并维护Tor中继节点。

Need this done for your project?

We implement, you ship. Async, documented, done in days.

Start a Brief

Tor中继节点类型

Tor网络中有三种节点类型,法律责任和技术要求各不同:

  • Guard/Middle节点(推荐):中转用户流量,但不处理出口流量(用户访问的最终网站流量不经过你的节点)。法律风险极低,你的节点无法看到用户的请求内容。适合大多数志愿者。
  • Exit节点(高风险,不推荐新手):作为Tor用户与目标网站之间的最后一跳。目标网站会看到你的IP,可能收到滥用投诉。运营Exit节点需要法律知识,并且理想情况下应在专门的数据中心(有明确的Exit节点政策)运行。
  • Bridge节点:未公开列出的中继,专门帮助审查地区用户连接。对于来自中国的用户贡献价值最大。IP不会出现在公开的Tor中继列表中。

AnubizHost允许在VPS上运行Guard/Middle节点和Bridge节点。Exit节点请事先与我们的客服确认。

安装配置Guard/Middle中继

在AnubizHost VPS(Ubuntu 22.04)上:

apt update && apt install tor -y

编辑 /etc/tor/torrc:

ORPort 9001
DirPort 9030
Nickname MyCoolRelay
ContactInfo anonymous@protonmail.com
RelayBandwidthRate 10 MB
RelayBandwidthBurst 20 MB
AccountingStart month 1 0:00
AccountingMax 1 TB
ExitPolicy reject *:*
Log notice file /var/log/tor/notices.log

关键参数说明:

  • ExitPolicy reject *:* - 拒绝所有出口流量,使此节点成为中间节点而非出口节点
  • RelayBandwidthRate - 持续带宽限制(确保不超过VPS带宽上限)
  • AccountingMax - 每月流量上限(如果VPS有流量限制,必须设置)
systemctl enable tor && systemctl start tor
cat /var/log/tor/notices.log | grep Bootstrapped

看到「Bootstrapped 100%」表示节点已成功加入Tor网络。

配置Bridge节点(帮助中国用户)

Bridge节点的配置与普通中继类似,但不公开注册,专门帮助受审查地区用户:

BridgeRelay 1
ORPort 443
ServerTransportPlugin obfs4 exec /usr/bin/obfs4proxy
ServerTransportListenAddr obfs4 0.0.0.0:444
ExtORPort auto
Nickname MyBridge
ContactInfo anonymous@protonmail.com
RelayBandwidthRate 5 MB
RelayBandwidthBurst 10 MB
ExitPolicy reject *:*
PublishServerDescriptor 0

安装obfs4proxy:

apt install obfs4proxy -y

PublishServerDescriptor 0 确保你的Bridge不会出现在公开的Tor节点列表,只能通过bridges.torproject.org或私下分享获得你的Bridge地址。

启动后,查看你的Bridge地址:

cat /var/lib/tor/pt_state/obfs4_bridgeline.txt

分享这个地址给需要的用户,他们就可以通过你的Bridge连接Tor。

监控和维护

检查节点状态:

systemctl status tor
tor --verify-config
journal -u tor -n 50

ARM(Tor的监控工具):

apt install tor-arm -y
arm

ARM提供实时流量图、连接数、带宽统计等信息。

在线查看节点状态:节点上线约24-48小时后,可以在 metrics.torproject.org 搜索你的节点Nickname,查看带宽贡献情况和在线时间。Guard flag通常需要68天以上的稳定运行才会获得。

定期更新:

apt update && apt upgrade tor -y

Tor软件有定期安全更新,保持更新是必要的安全实践。

Why Anubiz Host

100% async — no calls, no meetings
Delivered in days, not weeks
Full documentation included
Production-grade from day one
Security-first approach
Post-delivery support included

Ready to get started?

Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.

Anubiz Chat AI

Online