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.

توصیه می شود که رله های خروجی را روی سرورهایی مختص این کار تنظیم کنید. توصیه نمی شود رله های خروجی تور ررا روی سرورهایی که برای کار های دیگر به آن نیاز دارید نصب کنید. ترافیک خود را با ترافیک رله خروجی در هم نیامیزید.

ساناد معکوس و ثبت هوئیز

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.

صفحه اچ‌تی‌ام‌ال اعلان خروجی

برای اینکه آشکار تر شود که این یک رله خروجی تور است یک صفحه اچ‌تی‌ام‌ال اعلان خروجی تور را تحویل دهید. 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 /path/to/html/file

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

تعریف سیاست خروجی یکی از مهم ترین بخش های پیکربندی رله خروجی می باشد. سیاست خروجی مشخص می کند حاضر به ارسال چه درگاه های مقصدی هستید. این روی تعداد ایمیل های سو استفاده دریافتی تاثیر خواهد داشت (درگاه کمتر به معنای ایمیل سو استفاده کمتر است، ولی یک رله خروجی که تنها چند درگاه را مجاز می داند فایده کمتری دارد). اگر می خواهید یک رله خروجی مفید باشید، باید حداقل درگاه های 80 و 443 را مجاز قرار دهید.

به عنوان یک رله خروجی جدید - مخصوصاً اگر تازه با میزبان آشنا شده اید - بهتر است تا با یک سیاست خروجی کاهش یافته (برای کاهش ایمیل های سو استفاده) استفاده کنید و در گذر زمان آن را تغییر دهید. 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

ساناد روی رله های خروجی

برخلاف سایر انواع رله ها، رله های خروجی ترجمه ساناد را برای کلاینت های تور انجام می دهند. تحلیل ساناد روی رله های خروجی برای کلاینت های تور حیاتی بوده و باید با استفاده از ذخیره‌سازی قابل اعتماد و سریع باشد.

  • تحلیل ساناد می تواند تاثیر به سزایی روی عملکرد و قابل اعتماد بودن فراهم شده توسط رله خروجی شما بگذارد.
  • از تحلیلگر های ساناد بزرگ (گوگل، اوپن‌‌ دی‌ان‌اس، کلودفلر، 4.2.2.1-6) به منظور اجتناب از تمرکزگرایی استفاده نکنید.
  • توصیه ما این است تا از یک ذخیره سازی محلی و تحلیل‌گر تایید اعتبار DNSSEC بدون هیچ فرستنده ای استفاده کنید (دستورالعمل های خاص برای سیستم عامل های متفاوت در پایین آمده اند).
    • 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).
    • اگر یک تحلیل‌گر محلی مانند unbound برای شما ممکن نیست، یک تحلیل‌گر که ارائه دهنده شما در همان سامانه خودگردان اجرا می کند را استفاده کنید (برای یافتن یک نشانی آی‌پی در همان سامانه خودگردان به عنوان رله خود، می توانید از طریق 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

چندین گزینه مختلف برای نرم افزار سرور ساناد وجود دارد. Unbound به برنامه محبوبی تبدیل شده است ولی اختیار استفاده از برنامه با شماست. در هنگام انتخاب نرم‌افزار تحلیلگر ساناد خود، مطمئن شوید که از حداقل سازی QNAME و اعتبارسنجی DNSSEC (RFC7816) پشتیبانی می کند. نرم افزار تحلیلگر را روی مدیر بسته سیستم عامل خود نصب کنید تا مطمئن شوید که به صورت خودکار به روز رسانی می شود.

با استفاده از تحلیلگر ساناد خود، در برابر سانسور مبتنی بر ساناد کمتر آسیب پذیر خواهید بود.

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.

دبیان/اوبونتو

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

پیکربندی دبیان همراه حداقل سازی QNAME (RFC7816) می آید و به صورت پیش فرض فعال می باشد بنابراین نیازی به فعال کردن آن به صورت صریح نیست. 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.

سنت‌اواس/رد هت انترپرایز لینوکس

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.

فری‌بی‌اس‌دی

فری‌بی‌اس‌دی unbound را در سیستم پایه خود دارد ولی مورد در پورت‌ها معمولاً جدیدتر است بنابراین ما بسته unbound را نصب می کنیم:

# pkg install unbound

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

سرور:
    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