We assume you read through the relay guide and technical considerations already. This subpage is for operators that want to turn on exiting on their relay.

É recomendável que você configure os nós de saída em servidores dedicados a esse propósito. Não é recomendável instalar nós de saída do Tor em servidores que você usa para outros serviços. Não misture seu próprio tráfego com o tráfego do seu nó de saída.

DNS reverso e registro WHOIS

Before turning your non-exit relay into an exit relay, ensure that you have set a reverse DNS record (PTR) to make it more obvious that this is a tor exit relay. Something like "tor-exit" in its name is a good start.

If your provider offers it, make sure your WHOIS record contains clear indications that this is a Tor exit relay.

Do use a domain name that you own. Definitely do not use torproject.org as a domain name for your reverse DNS.

Página HTML de Aviso de Saída

Para ser mais claro que este é um nó de saída do Tor, você deve exibir uma página HTML de aviso de nó de saída do Tor. Tor can do that for you: if your DirPort is on TCP port 80, you can make use of tor's DirPortFrontPage feature to display an HTML file on that port. Este arquivo será mostrado para qualquer um direcionando o navegador para o endereço IP do seu retransmissor de saída Tor.

If you didn't set this up before, the following configuration lines must be applied to your torrc:

DirPort 80
DirPortFrontPage /caminho/para/arquivo/html

We offer a sample Tor exit notice HTML file, but you might want to adjust it to your needs.

We also have a great blog post with some more tips for running an exit relay.

Note: DirPort is deprecated since Tor 0.4.6.5, and self-tests are no longe being showed on tor's logs. For more information read its release notes and ticket #40282.

Exit policy

Definir a política de saída é uma das partes mais importantes da configuração de um retransmissor de saída. A política de saída define quais portas de destino você deseja encaminhar. Isso tem um impacto na quantidade de e-mails abusivos que você receberá (menos portas significa menos e-mails abusivos, mas um nó de saída permitindo apenas algumas portas também é menos útil). Se você quiser ser um nó de saída útil, deve pelo menos permitir as portas de destino 80 e 443 .

Como um novo retransmissor de saída - especialmente se você é novo para o seu hospedeiro - é bom iniciar com uma política de saída reduzida (para diminuir a quantidade de emails de abuso) e futuramente expandi-la na medida que você se torne mais experiente. The reduced exit policy can be found on the Reduced Exit Policy wiki page.

To become an exit relay change ExitRelay from 0 to 1 in your torrc configuration file and restart the tor daemon.

ExitRelay 1

DNS em nós de saída

Ao contrário de outros tipos de retransmissores, os de saída fazem também resolução de DNS para clientes Tor. Resolução DNS nos retransmissores de saída é crucial para os clientes Tor e isso deve ser confiável e rápido ao usar 'caching'.

  • Resolução de DNS podem ter um impacto significativo na performance e confiabilidade que o seu retransmissor de saída fornece.
  • Não use nenhum dos grande resolvedores de DNS (Google, OpenDNS, Quad9, Cloudfare, 4.2.2.1.-6) como seu resolvedor princial ou substituto de DNS para evitar centralização.
  • Nós recomendamos executar um caching local e um resolvedor DNSSEC-validaddor sem usar nenhum encaminhador ( para instruções específicas, vários sistemas operacionais, siga abaixo).
    • If you want to add a second DNS resolver as a fallback to your /etc/resolv.conf configuration, choose a resolver within your autonomous system and make sure that it is not your first entry in that file (the first entry should be your local resolver).
    • Se um resolver como o Unbound não é uma opção para você, use um resolvedor que o seu provedor executa no mesmo sistema autônomo (para descobrir se um endereço de IP está no mesmo SA que o seu retransmissor, você pode verificar isso usando bgp.he.net).
  • Avoid adding more than two resolvers to your /etc/resolv.conf file to limit AS-level exposure of DNS queries.
  • Ensure your local resolver does not use any outbound source IP address that is used by any Tor exit or non-exits, because it is not uncommon that Tor IPs are (temporarily) blocked and a blocked DNS resolver source IP address can have a broad impact. For unbound you can use the outgoing-interface option to specify the source IP addresses for contacting other DNS servers.
  • Large exit operators (>=100 Mbit/s) should make an effort to monitor and optimize Tor's DNS resolution timeout rate. This can be achieved via Tor's Prometheus exporter (MetricsPort). The following metric can be used to monitor the timeout rate as seen by Tor:
tor_relay_exit_dns_error_total{reason="timeout"} 0

Existem múltiplas opções para programas de servidor DNS Unbound se tornou um software popular, mas fique à vontade para usar qualquer outro software com o qual você se sinta confortável. Quando estiver escolhendo seu programa de resolvedor DNS, tenha certeza que ele suporta validação DNSSEC e minimização (RFC7816) QNAME . Instale o programa resolvedor através do administrador de pacotes do seu sistema operacional, para garantir que esteja atualizado automaticamente.

Ao usar seu próprio resolvedor DNS, você esta menos vulnerável à censura baseada em DNS que o seu resolvedor acima pode impor.

Below are instructions on how to install and configure Unbound - a DNSSEC-validating and caching resolver - on your exit relay. Unbound has many configuration and tuning knobs, but we keep these instructions simple and short; the basic setup will do just fine for most operators.

After switching to Unbound, verify that it works as expected by resolving a valid hostname. If it does not work, you can restore your old /etc/resolv.conf file.

Debian/Ubuntu

The following commands install unbound, backup your DNS configuration, and tell the system to use the local resolver:

# apt install unbound
# cp /etc/resolv.conf /etc/resolv.conf.backup
# echo nameserver 127.0.0.1 > /etc/resolv.conf

Para evitar alterações indesejadas na configuração (por exemplo, pelo cliente DHCP):

# chattr +i /etc/resolv.conf

A configuração do Debian vem com minimização QNAME (RFC7816) habilitada como padrão, então você não precisa habilita-la expressamente. The Unbound resolver you just installed also does DNSSEC validation.

If you are running systemd-resolved with its stub listener, you may need to do a bit more than just that. Please refer to the resolved.conf manpage.

CentOS/RHEL

Install the unbound package:

# yum install unbound

If you are using a recent version of CentOS/RHEL, please use dnf instead of yum.

In /etc/unbound/unbound.conf replace the line:

  qname-minimisation: no

with

  qname-minimisation: yes

Enable and start unbound:

# systemctl enable --now unbound

Tell the system to use the local resolver:

# cp /etc/resolv.conf /etc/resolv.conf.backup
# echo nameserver 127.0.0.1 > /etc/resolv.conf

Para evitar alterações de configuração indesejadas (por exemplo, pelo cliente DHCP):

# chattr +i /etc/resolv.conf

If you are running systemd-resolved with its stub listener, you may need to do a bit more than just that. Please refer to the resolved.conf manpage.

FreeBSD

O FreeBSD é fornecido com unbound no sistema básico, mas o da portas está geralmente seguindo o "upstream" mais de perto, então instalamos o pacote unbound:

# pkg install unbound

Replace the content in /usr/local/etc/unbound/unbound.conf with the following lines:

server:
    verbosity: 1
    qname-minimisation: yes

Enable and start the unbound service:

# sysrc unbound_enable=YES
# service unbound start

Tell the system to use the local resolver:

# cp /etc/resolv.conf /etc/resolv.conf.backup
# echo nameserver 127.0.0.1 > /etc/resolv.conf

Para evitar alterações de configuração indesejadas (por exemplo, pelo cliente DHCP):

# chflags schg /etc/resolv.conf