运行Tor服务器


Tor网络由分布于世界各地的志愿者构建,他们通过运行服务器, 贡献自己的空余带宽。Vidalia协助您更容易地建立起自己的Tor服务器。

安装基础

如果您决定通过运行服务器来帮助Tor网络成长,可按如下步骤进行:

  1. 通过托盘菜单选择配置(苹果机上是通过系统菜单栏的属性),打开配置对话框
  2. 选择服务器配置页;
  3. 勾选为Tor网络中继传输标签;
  4. 输入以下信息:
  5. 如果您想要为网络上的其他服务器做Tor目录镜像,请勾选镜像服务器的目录。 如果您没有那么多带宽,则不要勾选此项。如果您决定做镜像目录,请确保其端口 不同于上面输入的服务器端口
  6. 如果通信从您这里路由退出Tor网路,将显示您的IP地址。如果您不希望如此,请勾选 只进行其他Tor服务器之间的中继传输,这样只扮演中间人的角色。

Rate Limiting

Running a Tor server can consume a large amount of bandwidth; however, Tor allows you to limit the amount of bandwidth that you are willing to contribute to the Tor network. You can run a server, while still keeping your network connection usable for your own use.

The average rate is the maximum long-term average bandwidth allowed (in kilobytes per second). For example, you might want to choose 2 megabytes per second (2048 KB/s), or 50 kilobytes per second (a medium-speed cable connection). Tor requires a minimum of 20 kilobytes per second to run a server.

The maximum rate is a pool of bytes used to fulfill requests during short periods of traffic higher than your specified average rate, but still maintains the average over a long period. A low average rate but a high maximum rate enforces a long-term average while still allowing more traffic during peak times if the average hasn't been reached lately. If your average rate is the same as your maximum rate, then Tor will never exceed the specified rate. Your maximum rate must always be greater than or equal to your average rate.

It is important to remember that Tor measures bandwidth in bytes, not bits. Also, Tor only looks at incoming bytes instead of outgoing bytes. For example, if your server acts as a directory mirror, you may be sending more outgoing bytes than incoming. If you find this is the case and is putting too much strain on your bandwidth, you should consider unchecking the checkbox labeled Mirror the server directory.

退出策略

有了退出策略,您就可以对自己的Tor服务器,设定退出时允许的通信类别。 Tor默认使用的退出策略,对信件做了限制,以防止垃圾邮件, 有的则针对共享文件的端口,以防止Tor网络被滥用。 提醒:如果您是作为中间人服务器,就不需要考虑退出策略,因为没有任何流量会通过您服务器退出。

一项退出策略由零行到多行组成,每行代表了一项动作,只要通过您服务器的连接匹配其中某行指定的地址或端口,相应动作就会被执行。

Tor按照从头到尾的顺序来考虑策略,按照第一个找到的匹配动作来执行。任何您新添加的规则都会放到Tor退出策略列表的开头,由于优先级是从头到尾,可能就需要对策略重新排序。您可以通过上下箭头的按钮,来调整顺序。

动作

每行策略都对应着一项关联动作,这些动作可以是:

地址

策略中的地址可以是IP地址(比如 123.45.67.8)、IP地址与掩码(比如 123.45.0.0/16),或者通配符"*",这里的"*"表示"匹配所有地址"。

端口

每项策略都关联有一个端口或者一段范围内的端口,合法的端口范围是从 1 到 65535,或者你可以指定一个"*"以匹配所有"所有端口"。

例子

以下是几个合法的退出策略样例,以及相应的作用描述: