Using corridor, a Tor traffic whitelisting gateway with Whonix ™

From Whonix



corridor [archive] is a Tor traffic whitelisting gateway. It is a filtering gateway, not a proxying gateway and can also be configured as a BridgeFirewall [archive].

Connecting to corridor before Tor[edit]


Info corridor configurations are only possible in Qubes-Whonix ™. Non-Qubes-Whonix ™ is unsupported at present. [1] [2]

It is possible to configure Whonix-Gateway ™ (sys-whonix) to use corridor as a local proxy to establish the following tunnel:

This is not necessarily more anonymous, but it does provide an additional fail-safe -- a Tor traffic whitelisting firewall that helps protect against accidental clearnet leaks (hypothetical clearnet leak bugs in Whonix ™). As corridor's project description [archive] states: "... it cannot prevent malware on a client computer from finding out your clearnet IP address."

corridor is mostly useful for developers and auditors of Whonix ™, along with advanced users who would like to have an additional safety net. Note that it cannot protect from hypothetical bugs affecting Qubes' ProxyVM; a physically-isolated, standalone corridor-Gateway [archive] is necessary to cover that leak vector.

corridor does not increase the tunnel length, meaning no more relays are added between a user and the destination. Users interested in this configuration should read Tunnels/Introduction.


Ambox warning pn.svg.png By default, the following instructions will result in:

  1. The Debian tor package [archive] being installed.
  2. Thereby automatically connecting to the Tor [archive] public network.
  3. Downloading of corridor from Whonix-APT-Repository.

This behavior might be dangerous if users need / want to hide Tor and Whonix ™ from the ISP.

If Whonix ™ is already in use, then configuring a second running instance of Tor will ensure that it is independent of the one running inside Whonix-Gateway ™ (sys-whonix). From the ISP's perspective, the user will have a different network Fingerprint. The anonymity impact should be no worse than running Tor Browser, or system-tor and Whonix ™ at the same time.

dom0 Setup[edit]

Create a new standalone ProxyVM called sys-corridor based on the Debian buster template:

Qube ManagerCreate new Qubeenable 'Standalone qube based on a template'name: sys-corridortemplate: debianOK

Enable the corridor qvm service:

Qube Managerleft-click sys-corridorright-clickQube settingsservicestype in the fieldcorridorpress +press OK

sys-corridor Setup[edit]

If a BridgeFirewall is required, first configure Tor to use bridges before installing corridor. All the following steps should be applied in Qubes' [archive] Debian template [archive].

Install corridor[edit]

Start sys-corridor and open a terminal using Qubes start menu.

Complete the following steps to add the Whonix Signing Key to the system's APT keyring. [3]

Open a terminal.

Install curl, gpg, gpg-agent. [4]

Install curl gpg gpg-agent --no-install-recommends.

1. Update the package lists.

sudo apt-get update

2. Upgrade the system.

sudo apt-get dist-upgrade

3. Install the curl gpg gpg-agent --no-install-recommends package.

sudo apt-get install curl gpg gpg-agent --no-install-recommends

The procedure of installing curl gpg gpg-agent --no-install-recommends is complete.

Download Whonix Signing Key. [5]

If you are using a Qubes TemplateVM, run.

curl --proxy --tlsv1.2 --proto =https --max-time 180 --output ~/patrick.asc

If you are using Debian, run.

curl --tlsv1.2 --proto =https --max-time 180 --output ~/patrick.asc

Users can check Whonix Signing Key for better security.

Add Whonix signing key to APT trusted keys.

sudo apt-key --keyring /etc/apt/trusted.gpg.d/whonix.gpg add ~/patrick.asc

The procedure of adding Whonix signing key is now complete.

Add Whonix ™ Repository.

Choose either: Option A, Option B OR Option C.

Option A: Add Whonix ™ Onion Repository.

To add Whonix ™ Repository over Onion please press on expand on the right.

Install apt-transport-tor from the Debian repository.

sudo apt-get install apt-transport-tor

Add Whonix's APT repository for default Whonix using Debian stable. At the time of writing this was buster.

echo "deb tor+http://deb.dds6qkxpwdeubwucdiaord2xgbbeyds25rbsgr73tbfpqpt4a6vjwsyd.onion buster main contrib non-free" | sudo tee /etc/apt/sources.list.d/whonix.list

Option B: Add Whonix ™ Clearnet Repository over Tor.

To add Whonix ™ Repository over torified clearnet please press on expand on the right.

Install apt-transport-tor from the Debian repository.

sudo apt-get install apt-transport-tor

Add Whonix's APT repository for default Whonix using Debian stable. At the time of writing this was buster.

echo "deb tor+ buster main contrib non-free" | sudo tee /etc/apt/sources.list.d/whonix.list

Option C: Add Whonix Clearnet Repository over clearnet.

To add Whonix ™ Repository over clearnet please press on expand on the right.

Add Whonix's APT repository for default Whonix using Debian stable. At the time of writing this was buster.

echo "deb buster main contrib non-free" | sudo tee /etc/apt/sources.list.d/whonix.list

Install corridor.

Install corridor.

1. Update the package lists.

sudo apt-get update

2. Upgrade the system.

sudo apt-get dist-upgrade

3. Install the corridor package.

sudo apt-get install corridor

The procedure of installing corridor is complete.

While these instructions remain experimental, it is advised to run the following systemctl commands to check everything is functioning correctly.

sudo systemctl --no-pager status corridor-data
sudo systemctl --no-pager status corridor-init-forwarding 
sudo systemctl --no-pager status corridor-init-logged 
sudo systemctl --no-pager status corridor-init-snat

Reboot sys-corridor.

Optional: BridgeFirewall corridor Configuration[edit]

Info "Bridges are less reliable and tend to have lower performance than other entry points. If you live in a uncensored area, they are not necessarily more secure than entry guards." [6]

In order to use corridor as a BridgeFirewall [archive], configure Tor to use bridges [archive] before installing corridor. [7]

1. Start sys-corridor and open a terminal using Qubes start menu.
2. Create folder /etc/corridor.d and configuration file /etc/corridor.d/21-bridges-user.conf first. [8]
3. Create a bridges configuration file.

Open file /etc/corridor.d/21-bridges-user.conf in an editor with root rights.

(Qubes-Whonix ™: In TemplateVM)

This box uses sudoedit for better security [archive]. This is an example and other tools could also achieve the same goal. If this example does not work for you or if you are not using Whonix, please refer to this link.

sudoedit /etc/corridor.d/21-bridges-user.conf

4. Add the following text. (Syntax: like torrc) [9]

TODO: This step is currently untested.



Test corridor[edit]

Test Preparation[edit]

  1. Run the above systemctl commands again.
  2. Create or use an appropriate existing AppVM named corridor-client (or similar).
  3. Install / run either system-tor (from Debian or Fedora package sources) or Tor Browser.
  4. Set Networking of corridor-client to sys-corridor. Tor should be still able to connect.

Testing Steps[edit]

To test system-tor, start watching Tor's log.

sudo tail -f /var/log/tor/log

Check if it made an initial, successful connection.

Then restart Tor.

sudo service tor restart

Check if Tor is still able to connect.

To test Tor Browser:

  1. First check Tor Browser can make an initial connection to the Internet while Networking is still set to sys-firewall.
  2. Next set Networking to sys-corridor and confirm it is still able to connect. If so, that is a positive sign.
  3. Finally attempt an untorified connection by using an application like Chromium or Firefox browser. Untorified applications should fail to connect to the Internet.

Test Logging[edit]

Whenever corridor blocks attempted actions (like the tests above), a message will appear in syslog. To inspect /var/log/syslog

Open /var/log/syslog in an editor as a regular, non-root user.

If you are using a graphical environment, run.

mousepad /var/log/syslog

If you are using a terminal, run.

nano /var/log/syslog

To check for blocks inside sys-corridor, run.

sudo tail -f /var/log/syslog

If corridor blocks anything, the output will be similar to this.

Jul 19 00:58:27 localhost kernel: [  954.706833] corridor:

Interpreting the Results[edit]

The safest configuration is only setting sys-whonix to use sys-corridor for Networking. The reason is the qubes-update-check.service [archive] will try to use the Internet without Tor, and other programs [archive] may also try to use clearnet. Therefore, always shut down corridor-client.

Configure sys-whonix[edit]

To set Networking of sys-whonix to sys-corridor:

Qube Managerleft-click sys-whonixright-clickQube settingsNetworkingsys-corridorOK

The procedure is now complete.


If problems are encountered, this section provides tips on gathering useful information for debugging.

Check if the corridor_relays ipset gets populated.

sudo ipset list corridor_relays

It is recommended to also install the usability-misc package from Whonix ™ repository, since it provides the iptables-save-deterministic command. Alternatively, retrieve the package from elsewhere.

sudo apt-get install usability-misc

Run iptables-save-deterministic.

sudo iptables-save-deterministic

In Qubes, the output should be similar to the following.

-A CORRIDOR_FILTER -m set --match-set corridor_relays dst,dst -j RETURN
-A CORRIDOR_FILTER -m set --match-set corridor_logged src -j LOG --log-prefix "corridor: reject " --log-macdecode
-A CORRIDOR_FILTER -j REJECT --reject-with icmp-host-prohibited


The author of corridor is rustybird [archive]. Patrick Schleizer [archive] is the author of the corridor for Debian [archive] fork [archive] used in these Whonix ™ instructions.


  1. Corridor for Whonix ™ KVM ticket [archive].
  2. Without third party contributions to corridor, Non-Qubes-Whonix ™ is unlikely to be supported in the near future.
  3. The following is unreliable due to gpg connectivity bugs [archive].
    sudo apt-key --keyring /etc/apt/trusted.gpg.d/whonix.gpg adv --keyserver hkp:// --recv-keys 916B8D99C38EAF5E8ADC7A2A8D66066A2EEACCDA

  4. gpg is required by apt-key. gpg-agent is required due to the following error message.
    sudo apt-key --keyring /etc/apt/trusted.gpg.d/whonix.gpg add ~/patrick.asc
    gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
    gpg: can't connect to the agent: No such file or directory
  5. See Secure Downloads to understand why curl and the parameters --tlsv1.2 --proto =https are used instead of wget.
  6. bridge vs non-bridge users anonymity [archive].
  7. The Whonix ™ Bridges page can help, but the steps do not apply one-to-one.
  8. This skip is stepped if Tor entry guards [archive] are preferred.
  9. [archive]

text=Jobs in USA
Jobs in USA

Search engines: YaCy | Qwant | ecosia | MetaGer | peekier | Whonix ™ Wiki

Follow: Twitter.png Facebook.png 1280px-Gab text logo.svg.png Iconfinder news 18421.png Rss.png Matrix logo.svg.png 1024px-Telegram 2019 Logo.svg.png Discourse logo.svg Reddit.jpg Diaspora.png Gnusocial.png Mewe.png 500px-Tumblr Wordmark.svg.png Iconfinder youtube 317714.png 200px-Minds logo.svg.png 200px-Mastodon Logotype (Simple).svg.png 200px-LinkedIn Logo 2013.svg.png

Donate: Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contriute

Whonix donate bitcoin.png Monero donate whonix.png United Federation of Planets 1000px.png

Share: Twitter | Facebook

https link onion link

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation. Policy of Whonix Website and Whonix Chat and Policy On Nonfreedom Software applies.

Copyright (C) 2012 - 2020 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)

Whonix ™ is a derivative of and not affiliated with Debian [archive]. Debian is a registered trademark [archive] owned by Software in the Public Interest, Inc [archive].

Whonix ™ is produced independently from the Tor® [archive] anonymity software and carries no guarantee from The Tor Project [archive] about quality, suitability or anything else.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint, Contact.