Last update: March 17, 2019. This website uses cookies. 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. More information


Using corridor, a Tor traffic whitelisting gateway with Whonix


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

Connecting to corridor before Tor[edit]


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

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 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 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.


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-9 template:

Qube Manager -> Create new Qube -> enable 'Standalone qube based on a template' -> name: sys-corridor -> template: debian-9 -> OK

Enable the corridor qvm service:

Qube Manager -> left-click sys-corridor -> right-click -> Qube settings -> services -> type in the field -> corridor -> press + -> 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' Debian template.

Install corridor[edit]

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

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 stretch.

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

Update the package lists.

sudo apt-get update

Install corridor.

sudo apt-get install corridor

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]

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

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. [5]
3. Create a bridges configuration file.

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

If you are using a graphical Whonix or Qubes-Whonix with KDE, run.

kdesudo kwrite /etc/corridor.d/21-bridges-user.conf

If you are using a graphical Whonix or Qubes-Whonix with XFCE, run.

kdesudo mousepad /etc/corridor.d/21-bridges-user.conf

If you are using a terminal-only Whonix, run.

sudo nano /etc/corridor.d/21-bridges-user.conf

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

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 the NetVM 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 the NetVM is still set to sys-firewall.
  2. Next set the NetVM 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.

If you are using a graphical environment, run.

kwrite /var/log/syslog

If you are using a terminal (Konsole), 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 as a NetVM. The reason is the qubes-update-check.service will try to use the Internet without Tor, and other programs may also try to use clearnet. Therefore, always shut down corridor-client.

Configure sys-whonix[edit]

To set the NetVM of sys-whonix to sys-corridor:

Qube Manager -> left-click sys-whonix -> right-click -> Qube settings -> NetVM -> sys-corridor -> OK

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. Patrick Schleizer is the author of the corridor for Debian fork used in these Whonix instructions.


  1. Corridor for Whonix KVM ticket.
  2. Without third party contributions to corridor, non-Qubes-Whonix is unlikely to be supported in the near future.
  3. bridge vs non-bridge users anonymity.
  4. The Whonix Bridges page can help, but the steps do not apply one-to-one.
  5. This skip is stepped if Tor entry guards are preferred.

No user support in comments. See Support.

Comments will be deleted after some time. Specifically after comments have been addressed in form of wiki enhancements. See Wiki Comments Policy.

Add your comment
Whonix welcomes all comments. If you do not want to be anonymous, register or log in. It is free.

Random News:

Don't mind having your name connected to Whonix? Follow us on Twitter / Facebook.

https | (forcing) onion

Share: Twitter | Facebook

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.

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

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.