# Setting Up a Tor Relay

The Tor network is made up of volunteers all over the world who donate some of their spare bandwidth by running a Tor relay. Vidalia helps you do your part by making it easy to set up a relay of your own.

### Basic Settings

If you decide you want to help the Tor network grow by running a relay, you can follow these steps to get started:

1. Open the Configuration Dialog by selecting Settings from the tray menu or Preferences from your system menubar on Macintosh systems.
2. Select the Relay configuration page.
3. Decide whether you want to run a normal Tor relay or a bridge relay (Tor 0.2.0.8-alpha or newer). Bridge relays help censored Tor users who are blocked from accessing the Tor network directly. Check the box labeled Relay traffic for the Tor network if you want to run a normal Tor relay or Help censored users reach the Tor network if you want to run a bridge relay.
4. Enter the following information:

- Nickname: The name which your relay will be known as on the Tor network. An example of a relay nickname is "MyVidaliaRelay".
- Contact Info: Your e-mail address. This address will only be used to contact you in case there is an important Tor security update or something goes wrong with your relay. You might also include your PGP or GPG key ID and fingerprint.
- Relay Port: The port on which your relay will listen for traffic from clients or other Tor relays.

5. If you would like to mirror Tor's directory of relays for others on the network you can check the box labeled Mirror the Relay Directory. If you do not have much bandwidth, uncheck this box. If you do decide to mirror the relay directory, make sure the Directory Port is different than the Relay port you entered above. Bridge relays must mirror the relay directory.

### Bandwidth Limits

Running a Tor relay 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 relay, while still keeping your network connection usable for your own use.

You should select the option in the dropdown box that best matches your connection speed. If you select Custom, you will be able to specify your own limits.

#### Custom Limits

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.

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 relay.

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 relay 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 relay directory.

### Exit Policies

Exit policies give you a way to specify what kinds of resources on the Internet you are willing let other Tor users access from your Tor relay. Tor uses a default list of exit policies that restrict some services, such as mail to prevent spam and some default file sharing ports to reduce abuse of the Tor network.

Each of the checkboxes represents a type of resource that you can allow Tor users to access through your relay. If you uncheck the box next to a particular type of resource, Tor users will not be allowed to access that resource from your relay. If the box labeled Misc Other Services is checked, Tor users will be able to access other services not covered by the other checkboxes or Tor's default exit policy.

For completeness, the following table lists the specific port numbers represented by each of the exit policy checkboxes. The Description column describes the resources Tor clients will be allowed to access through your relay, if the associated box is checked.

Checkbox | Ports | Description
Websites | 80 | Normal, unencrypted Web browsing
Secure Websites (SSL) | 443 | Encrypted Web browsing
Retrieve Mail (POP, IMAP) | 110, 143, 993, 995 | Downloading email (does not permit sending email)
Instant Messaging (IM) | 703, 1863, 5050, 5190, 5222, 5223, 8300, 8888 | Instant messaging applications like MSN Messenger, AIM, ICQ, and Jabber
Internet Relay Chat (IRC) | 6660-6669, 6697, 7000-7001 | IRC clients and servers
Misc. Other Services | * | All other applications that aren't covered by the previous checkboxes

If you do not want to let other Tor users make connections outside the Tor network from your relay, you can uncheck all of the checkboxes. Even if you uncheck all of the checkboxes, your relay is still useful to the Tor network. Your relay will allow other Tor users to connect to the Tor network and will help relay traffic between other Tor relays.

If you chose to run a bridge relay, the Exit Policies tab will be grayed out, since bridge relays do not allow exit connections. Bridges are only used by Tor clients to connect to the Tor network.

### Port Forwarding

Many home users connect to the Internet via a router, which allows multiple computers on a local network to share the same Internet connection. Some users may also be behind a firewall that blocks incoming connections to your computer from other computers on the Internet. If you want to run a Tor relay, however, other Tor clients and relays must be able to connect to your relay through your home router or firewall.

To make your relay publicly accessible, your router or firewall needs to know which ports to allow through to your computer by setting up what is known as port forwarding. Port forwarding configures your router or firewall to "forward" all connections to certain ports on your router or firewall to local ports on your computer.

If you check the box labeled Attempt to automatically configure port forwarding, Vidalia will attempt to automatically set up port forwarding on your local network connection so that other Tor clients can connect to your relay. Not all routers support automatic port forwarding, though. You can use the Test button next to the checkbox to find out if Vidalia is able to automatically set up port forwarding for you.

If the Test button finds that Vidalia is unable to set up port forwarding for you, you may need to enable this feature on your router or set up port forwarding manually. Some network devices have a feature called Universal Plug-and-Play (UPnP). If you can access your router's administrative interface, you should look for an option to enable UPnP. The administrative interface for most routers can be accessed by opening http://192.168.0.1 or http://192.168.1.1 in your Web browser. You should consult your router's instruction manual for more information.

If you need to set up port forwarding manually, the website portforward.com has instructions for how to set up port forwarding for many types of routers and firewalls. At a minimum, you will need to forward your Relay Port, which defaults to port 443 on Windows and 9001 on all other operating systems. If you also checked the checkbox labeled Mirror the relay directory, then you will also need to forward your Directory Port. The Directory Port is set to port 9030 by default on all operating systems.