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.

من المستحسن أن تقوم بإعداد مرحلات الخروج على الخوادم المخصصة لهذا الغرض. لا يوصى بتثبيت مرحلات خروج Tor على الخوادم التي تحتاجها لخدمات أخرى أيضًا. لا تخلط حركة المرور الخاصة بك مع حركة مرور الخروج الخاصة بك.

عكس DNS وسجل WHOIS

قبل تحويل مرحل عدم الخروج الخاص بك إلى مرحل خروج ، تأكد من أنك قمت بتعيين سجل DNS عكسي (PTR) لتوضيح أن هذا هو مرحل خروج tor. شيء مثل "tor-exit" ، اسمها هو بداية جيدة.

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

لا تستخدم اسم المجال الذي تملكه. بالتأكيد لا تستخدم torproject.org as a اسم المجال لعكس DNS الخاص بك.

إخطار الخروج من صفحة HTML

لجعل الأمر أكثر وضوحًا أن هذا هو مرحل خروج Tor ، يجب أن تقدم صفحة HTML لإشعار خروج 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. سيُعرض هذا الملف لأي شخص يوجه متصفحه إلى عنوان IP الخاص بترحيل خروج Tor.

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.

سياسة الخروج

يعد تحديد سياسة الخروج أحد أهم أجزاء تكوين ترحيل الخروج. تحدد سياسة الخروج منافذ الوجهة التي ترغب في إعادة توجيهها. هذا له تأثير على كمية رسائل البريد الإلكتروني المسيئة التي ستتلقاها (قلة المنافذ تعني إساءة استخدام أقل لرسائل البريد الإلكتروني ، لكن مرحل الخروج الذي يسمح بمنافذ قليلة فقط هو أيضًا أقل فائدة). إذا كنت تريد أن تكون مرحل خروج مفيدًا ، يجب أن تسمح على الأقل بمنافذ الوجهة 80 و 443 **.

كمرحلة خروج جديدة - خاصة إذا كنت جديدًا على المستضيف - من الجيد أن تبدأ بسياسة خروج مخفضة (لتقليل كمية رسائل البريد الإلكتروني المسيئة) وفتحها أكثر كلما أصبحت أكثر خبرة. The reduced exit policy can be found on the Reduced Exit Policy wiki page.

لتصبح مخرج ترحيل تغيير ExitRelay من 0 إلى 1 في ملف التكوين torrc وأعد تشغيل البرنامج الخفيtor.

ExitRelay 1

DNS على مرحلات الخروج

على عكس الأنواع الأخرى من المرحلات ، تقوم مرحلات الخروج أيضًا بتحليل DNS لعملاء Tor. يعد حل DNS على مرحلات الخروج أمرًا بالغ الأهمية لعملاء Tor ويجب أن يكون موثوقًا وسريعًا باستخدام التخزين المؤقت.

  • يمكن أن يكون لتحليل DNS تأثير كبير على الأداء والموثوقية التي يوفرها مرحل الخروج.
  • لا تستخدم أيًا من أدوات حل DNS الكبيرة (جوجل ، OpenDNS ، Quad9 ، Cloudflare ، 4.2.2.1-6) كمحلل DNS أساسي أو احتياطي لتجنب المركزية.
  • نوصي بتشغيل التخزين المؤقت المحلي ومحلل التحقق من 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).
    • إذا لم يكن محلل محلي مثل غير منضم خيارًا لك ، فاستخدم المحلل الذي يديره موفرك في نفس النظام المستقل (لمعرفة ما إذا كان عنوان IP في نفس AS مثل الترحيل الخاص بك ، يمكنك البحث عنه باستخدام bgp.he.net).
  • تجنب إضافة أكثر من محللين إلى ملف / etc / resolv.conf الخاص بك للحد من التعرض على AS-level لاستعلامات DNS.
  • 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

هناك خيارات متعددة لبرنامج خادم DNS. غير منضم أصبح برنامج شائع ولكن لا تتردد في استخدام أي برنامج آخر تشعر بالراحة معه. عند اختيار برنامج محلل DNS الخاص بك ، تأكد من أنه يدعم التحقق من صحة DNSSEC وتصغير QNAME (RFC7816). قم بتثبيت برنامج المحلل على مدير حزم نظام التشغيل الخاص بك ، للتأكد من أنه يتم تحديثه تلقائيًا.

باستخدام محلل DNS الخاص بك ، فأنت أقل عرضة للرقابة المستندة إلى DNS التي قد يفرضها محلل المنبع.

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

لتجنب تغيير التكوين غير المرغوب فيه (على سبيل المثال بواسطة عميل DHCP):

# chattr +i /etc/resolv.conf

يأتي تكوين دبيان مع تمكين تصغير QNAME (RFC7816) افتراضيًا ، لذلك لا تحتاج إلى تمكينه بشكل صريح. يقوم محلل Unbound الذي قمت بتثبيته للتو بالتحقق من DNSSEC.

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

قم بتثبيت الحزمة unbound:

# yum install unbound

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

في /etc/unbound/unbound.conf استبدل السطر:

  qname-minimisation: no

مع

  qname-minimisation: yes

تمكين و بدء unbound:

# systemctl enable --now unbound

أخبر النظام باستخدام المحلل المحلي:

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

لتجنب تغييرات التكوين غير المرغوب فيها (على سبيل المثال بواسطة عميل 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

يشحن FreeBSD غير المربوط في النظام الأساسي ، لكن النظام الموجود في المنافذ عادة ما يتابع المنبع عن كثب ، لذلك نقوم بتثبيت الحزمة غير المنضمة:

# pkg install unbound

استبدال المحتوى في /usr/local/etc/unbound/unbound.conf مع الأسطر التالية:

الخادم:
    verbosity: 1
    qname-minimisation: yes

تمكين وابدأ unbound خدمة:

# sysrc unbound_enable=YES
# service unbound start

أخبر النظام باستخدام المحلل المحلي:

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

لتجنب تغييرات التكوين غير المرغوب فيها (على سبيل المثال بواسطة عميل DHCP):

# chflags schg /etc/resolv.conf