## translation metadata
# Revision: $Revision$
# Translation-Priority: 4-optional

#include "head.wmi" TITLE="obfsproxy: Setting up an Obfsproxy Bridge on Debian/Ubuntu" CHARSET="UTF-8"

<div id="content" class="clearfix">
  <div id="breadcrumbs">
    <a href="<page index>">Home &raquo; </a>
    <a href="<page projects/projects>">Projects &raquo; </a>
    <a href="<page projects/obfsproxy>">obfsproxy</a>
  </div>
  <div id="maincol">

    <!-- PUT CONTENT AFTER THIS TAG -->

    <h1 id="instructions">Setting up an Obfsproxy Bridge on Debian/Ubuntu</h1>

    <img src="$(IMGROOT)/obfsproxy_diagram.png" alt="obfsproxy diagram"></a>

    <p>
    <img width="7%" height="7%" style="float: left;" src="$(IMGROOT)/icon-Obfsproxy.jpg">
    <b> Hey! </b>
    If you are <b>not</b> using Debian or Ubuntu, you better look
    <a href="<page projects/obfsproxy-instructions>">at this other guide</a>
    which sets up Obfsproxy from source.
    </p>
    <br><br>


    <p>
      This is a <b>Debian/Ubuntu</b> guide for installing the Python
      version of obfsproxy. If you are still using the C version, we
      recommend you to upgrade to the Python version!
    </p>

    <h3>Step 0: Install a recent version of Tor (>= 0.2.4.1)</h3>
    <br>

    <p>
    Add the <a href="<page docs/debian>#ubuntu">official Tor
    APT repository</a> and run the specified commands to install <code>tor</code>
    and <code>deb.torproject.org-keyring</code>. You need <em>Tor 0.2.4.x</em> because
    it knows how to automatically report your obfsproxy address to <a
    href="https://bridges.torproject.org/?transport=obfs3">BridgeDB</a>.
    </p>

    <h3>Step 1: Install obfsproxy</h3>
    <br>

    <p>
    Since you installed the Tor APT repository, installing obfsproxy is now a matter of running a command:
    </p>

    <pre style="margin: 1.5em 0 1.5em 2em">
\# apt-get install obfsproxy
    </pre>

    <h3>Step 2: Configure Tor</h3>
    <br>

    <p>
    Edit your <i>/etc/tor/torrc</i> to add:
    </p>

    <pre style="margin: 1.5em 0 1.5em 2em">
SocksPort 0
ORPort 443 # or some other port if you already run a webserver/skype
BridgeRelay 1
Exitpolicy reject *:*

\## CHANGEME_1 -> provide a nickname for your bridge, can be anything you like
\#Nickname CHANGEME_1
\## CHANGEME_2 -> provide some email address so we can contact you if there's a problem
\#ContactInfo CHANGEME_2

ServerTransportPlugin obfs3 exec /usr/bin/obfsproxy managed
    </pre>

    <p>
    Don't forget to uncomment and edit the <i>CHANGEME</i> fields!
    </p>

    <h3>Step 3: Launch Tor and verify that it bootstraps</h3>
    <br>

    <p>
    Restart Tor to use the new configuration file.
    (Preface with sudo if needed.)
    </p>

    <pre style="margin: 1.5em 0 1.5em 2em">
\# service tor restart
    </pre>

    <p>
    Now check <i>/var/log/tor/log</i> and you should see something
    like this:
    </p>

    <pre style="margin: 1.5em 0 1.5em 2em">
Nov 05 16:40:45.000 [notice] We now have enough directory information to build circuits.
Nov 05 16:40:45.000 [notice] Bootstrapped 80%: Connecting to the Tor network.
Nov 05 16:40:46.000 [notice] Bootstrapped 85%: Finishing handshake with first hop.
Nov 05 16:40:46.000 [notice] Bootstrapped 90%: Establishing a Tor circuit.
Nov 05 16:40:48.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Nov 05 16:40:48.000 [notice] Bootstrapped 100%: Done.
    </pre>

    <p>
    If Tor is earlier in the bootstrapping phase, wait until it gets to
    100%.
    </p>

    <h3>Step 4: Set up port forwarding if needed</h3>
    <br>

    <p>
    If you're behind a NAT/firewall, you'll need to make your bridge
    reachable from the outside world &mdash; both on the ORPort and
    the obfsproxy ports. The ORPort is whatever you defined in step two
    above. To find your obfsproxy ports, check your Tor logs for a line
    similar to this one:
    </p>

    <pre style="margin: 1.5em 0 1.5em 2em">
Oct 05 20:00:41.000 [notice] Registered server transport 'obfs3' at '0.0.0.0:42000
    </pre>

    <p>
    The last number in each line, in this case <i>26821</i> and
    <i>42000</i>, is the TCP port number that you need to forward
    through your firewall. (The ports are randomly chosen the first
    time Tor starts, but Tor will cache and reuse the same number in
    future runs.) If you want to change the number, use Tor
    0.2.4.7-alpha or later, and set something similar to
    "ServerTransportListenAddr obfs3 0.0.0.0:26821" in your torrc.
    </p>

  </div>
  <!-- END MAINCOL -->
  <div id = "sidecol">
#include "side.wmi"
#include "info.wmi"
  </div>
  <!-- END SIDECOL -->
</div>
<!-- END CONTENT -->
#include <foot.wmi>