1. Install Tor and dependencies

  • CentOS / RHEL:

# yum install epel-release -y

Then add the following to the /etc/yum.repos.d/tor.repo file.

[tor]
name=Tor for Enterprise Linux $releasever - $basearch
baseurl=https://rpm.torproject.org/centos/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://rpm.torproject.org/centos/public_gpg.key
cost=100

And then install the following packages.

# yum install git golang tor policycoreutils-python-utils

  • OpenSUSE:

# zypper install tor go git

2. Build obfs4proxy and move it into place.

גירסות מאד עתיקות של git יכולות לגרום ל go get להכשל, כך שנסו לשדרג לגירסה מתקדמת יותר אם נתקלתם בקשיים.

  • CentOS / RHEL:

export GOPATH='mktemp -d'

go get gitlab.com/yawning/obfs4.git/obfs4proxy

sudo cp $GOPATH/bin/obfs4proxy /usr/local/bin/

# chcon --reference=/usr/bin/tor /usr/local/bin/obfs4proxy

  • OpenSUSE:

export GOPATH='mktemp -d'

go get gitlab.com/yawning/obfs4.git/obfs4proxy

sudo cp $GOPATH/bin/obfs4proxy /usr/local/bin/

3. Edit your Tor config file, usually located at /etc/tor/torrc and replace its content with:

  • CentOS / RHEL / OpenSUSE:
RunAsDaemon 1
BridgeRelay 1

# החליפו "TODO1" עם ערוץ  Tor לפי בחירתכם.  הערוץ הזה צריך להיות זמין מבחוץ.
# המנעו מערוץ 9001 כיון שהוא בדרך כלל מזוהה עם Tor 
# וצנזורים עלולים לבצע סריקות של האינטרנט לערוץ הזה..
ORPort TODO1

ServerTransportPlugin obfs4 exec /usr/local/bin/obfs4proxy

# החליפו את "TODO2" עם ערוץ obfs4 לבחירתכם.  This port must be
# שיהיה זמין מבחוץ וחייב להיות שונה מזה שהוגדר עבור  ORPort.
# המנעו מערוץ  9001 מכיון שבדרך כלל הוא מזוהה עם
# Tor וצנזורים עלולים לבצע סריקות אינטרהט לערוץ הזה.
ServerTransportListenAddr obfs4 0.0.0.0:TODO2

# ערוץ תקשורת פנימי בין  Tor ו obfs4.  תמיד הגדירו זאת כ  "auto".
# "Ext" משמעו "extended", לא "external".  אל תנסו להגדיר מספר ערוץ ספציפי
# או תאזינו על  0.0.0.0.
ExtORPort auto

# החליפו "<address@email.com>" בכתובת הדוא"ל שלכם כדי שנוכל לתקשר עמכם אם
# אם יש בעיות עם הגשר שלכם.  הדבר אופציונלי אך אנו מעודדים זאת.
ContactInfo <address@email.com>

# בחרו שם כרצונכם עבור הגשר שלכם. הדבר אופציונלי.
Nickname PickANickname

לא לשכוח לשנות את אפשרויות ORPort, ServerTransportListenAddr, ContactInfo, ו Nickname.

  • שימו לב שגם ערוץ Tor OR וגם ערוץ obfs4 שלו חייבים לאפשר גישה אליהם. אם הגשר שלכם נמצא מאחורי חומת אש או NAT, וודאו שפתתחתם את שניהם.. אתם יכולים להעזר ב our reachability test tכדי לבחון אם ערוץ obfs4 ניתן לגישה מהאנטרנט.

4. Restart Tor

  • CentOS / RHEL:

sudo semanage port -a -t tor_port_t -p tcp [OR port set earlier, in TODO1]

sudo semanage port -a -t tor_port_t -p tcp [obfs4 port set earlier, in TODO2]

  • CentOS / RHEL / OpenSUSE:

sudo systemctl restart tor

5. Monitor your logs (usually in your syslog)

לאשר שהגשר שלכם פועל ללא תקלות, אתם צריכים לראות משהו כגון זה:

[notice] Your Tor server's identity key fingerprint is '<NICKNAME> <FINGERPRINT>'
[notice] Your Tor bridge's hashed identity key fingerprint is '<NICKNAME> <HASHED FINGERPRINT>'
[notice] Registered server transport 'obfs4' at '[::]:46396'
[notice] Tor has successfully opened a circuit. Looks like client functionality is working.
[notice] Bootstrapped 100%: Done
[notice] Now checking whether ORPort <redacted>:3818 is reachable... (this may take up to 20 minutes -- look for log messages indicating success)
[notice] Self-testing indicates your ORPort is reachable from the outside. Excellent. Publishing server descriptor.

6. הערות אחרונות

If you are having trouble setting up your bridge, have a look at our help section. If your bridge is now running, check out the post-install notes.