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.
Este recomandat să configurați relee de ieșire pe servere dedicate acestui scop. Nu este recomandat să instalați relee de ieșire Tor pe serverele de care aveți nevoie și pentru alte servicii. Nu amestecați propriul trafic cu traficul de relee de ieșire.
Înregistrarea DNS inversă și 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.
Pagina HTML a avizului de ieșire - Exit Notice
Pentru a face și mai evident că acesta este un releu de ieșire Tor, ar trebui să serviți o pagină HTML pentru avizul de ieșire 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.
This file will be shown to anyone directing their browser to your Tor exit relay IP address.
If you didn't set this up before, the following configuration lines must be applied to your torrc
:
DirPort 80
DirPortFrontPage /calea/catre/fisierul/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
Definirea politicii de ieșire este una dintre cele mai importante părți ale unei configurații a releului de ieșire. Politica de ieșire definește porturile de destinație pe care doriți să le transmiteți. Acest lucru are un impact asupra cantității de e-mailuri de abuz pe care le veți primi (mai puține porturi înseamnă mai puține e-mailuri de abuz, dar un releu de ieșire care permite doar câteva porturi este, de asemenea, mai puțin util). Dacă doriți să fie un releu de ieșire util, trebuie să permiteți cel puțin porturile de destinație 80 și 443.
Dacă administrați un nou releu de ieșire - mai ales dacă sunteți nou ca gazdă - este bine să începeți cu o politică de ieșire redusă (pentru a reduce cantitatea de e-mailuri de abuz) și să o deschideți mai mult pe măsură ce veți deveni mai experimentat. 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 pentru releele de ieșire
Spre deosebire de alte tipuri de relee, releele de ieșire fac și rezoluția DNS pentru clienții Tor. Rezoluția DNS pe releele de ieșire este crucială pentru clienții Tor și ar trebui să fie fiabilă și rapidă prin utilizarea memoriei în cache.
- Rezoluția DNS poate avea un impact semnificativ asupra performanței și fiabilității oferite de releul dvs. de ieșire.
- Pentru a evita centralizarea, nu folosiți niciunul dintre marii rezolutori DNS (Google, OpenDNS, Quad9, Cloudflare, 4.2.2.1-6) ca rezolvator DNS principal sau de rezervă.
- Vă recomandăm să rulați o rezolvare locală de memorie în cache și de validare DNSSEC fără a utiliza niciun forwarder (mai jos urmează instrucțiuni specifice pentru diferite sisteme de operare).
- 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). - Dacă nu ați ales o rezolvare locală nelegată, utilizați o rezolvare pe care furnizorul dvs. o rulează în același sistem autonom (pentru a afla dacă o adresă IP este în același AS ca și releul dvs., puteți căuta cu ajutorul bgp.he.net).
- If you want to add a second DNS resolver as a fallback to your
- 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
Există mai multe opțiuni pentru software-ul serverului DNS. Nelegat a devenit unul popular, dar nu ezitați să folosiți orice alt software cu care sunteți obișnuit. Când alegeți software-ul dvs. de rezolvare DNS, asigurați-vă că acesta acceptă validarea DNSSEC și minimizarea QNAME (RFC7816). Instalați software-ul de rezolvare pe managerul de pachete al sistemului dvs. de operare, pentru a vă asigura că acesta este actualizat automat.
Folosind rezolvatorul dvs. DNS, sunteți mai puțin vulnerabili la cenzura pe bază DNS pe care ar putea-o impune rezolvarea dvs. din amonte.
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
To avoid unwanted configuration changed (for example by the DHCP client):
# chattr +i /etc/resolv.conf
Configurația Debian se livrează cu minimizare QNAME (RFC7816) activată implicit, deci nu trebuie să o activați explicit. 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
To avoid unwanted configuration changes (for example by the DHCP client):
# 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
FreeBSD este livrat în sistemul de bază, dar cel din porturi urmează de obicei mai îndeaproape upstream, așa că instalăm pachetul 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
To avoid unwanted configuration changes (for example by the DHCP client):
# chflags schg /etc/resolv.conf