Contur

Your own exit server

Besides FortiGate gateways, Contur connects to your own WireGuard server, for example your company’s VPS. In the app this connection is called “Exit node”: while it is on, the device’s internet traffic goes through your server.

Contur does not provide servers. The exit server is yours: you rent it yourself or get it from your organization, and the connection goes directly between your device and that server.

How it works

  • Only one exit node can be on. If you add a second one and turn it on, the first one is turned off.
  • FortiGate internal networks work together with the exit node: their addresses and domains go into their own tunnels, not to the exit server.
  • Addresses and domains from the Direct to the Internet list bypass the exit node and go through your regular connection.
  • The connection to the exit server itself goes directly. Connections to FortiGate gateways go directly too, unless the gateway's profile has “Connect through the exit node” turned on: then the gateway sees your server's address instead of your provider's. This is needed when a gateway only accepts addresses from certain countries, see Connecting through the exit node.
  • On Mac, while the exit node is on, the menu panel shows your server’s external IPv4 address.

What server you need

A VPS with Debian 12 or Ubuntu 22.04 or newer, a public IPv4 address and SSH sign-in as root (port 22). WireGuard needs an open UDP port: 51820 by default. Contur installs and sets up everything needed on the server by itself. If you do not have a server yet, the assistant suggests where to get one.

A WireGuard server that is already running works too: then you need its .conf settings file or the details for manual entry.

Adding a server

On Mac, Windows and Linux: settings → Connections → “Add” → “Exit node (WireGuard)”. On iPhone, iPad and Android: “+” on the main screen → “Exit node”. The assistant’s first question is “Where do the server settings come from?”:

OptionWhen to choose it
“Set up my server (VPS)”You have a server and its root password. Contur signs in to the server over SSH and sets everything up by itself.
“Paste from the clipboard”You copied Contur settings or the text of a WireGuard file someone sent you.
“Open a file…”You have a WireGuard .conf file or a Contur .json settings file. On a phone you can open such a file in Contur straight from Files, mail or a messenger (“Open in…”, “Share”).
“Enter manually”The server is already set up: you know its address, public key and the device’s tunnel address.

Setting up your server

  1. Choose “Set up my server (VPS)” and answer that you have a server.
  2. Enter the VPS address. Under “Advanced” you can change the WireGuard port (51820) and the SSH user (root).
  3. Enter the server password and click “Set up the server”. Contur connects over SSH and shows the stages: connecting, installing packages, the server key and this device’s address, routing and firewall, start. The server password is not saved anywhere. On a phone, do not lock the screen or close Contur while the setup is running.
  4. Give the exit node a name and click “Add”. Turn on “Connect right away” to connect now.

The script adds only this device to the server and leaves the others alone, so it is safe to run again.

Password sign-in is disabled on the server, or you would rather not give Contur the password? Open “Run the script myself”: copy the script, run it on the server yourself, paste its whole output into the output field and click “Apply output”.

For setup over SSH, a Linux computer needs the openssh-client package and Windows needs the “OpenSSH Client” optional feature (Settings → System → Optional features). Nothing needs installing on Mac, iPhone, iPad or Android.

A second device on the same server

Each device has its own key and its own tunnel address. If the exit node reached another device through sync, it does not yet have that device’s key, and Contur shows a note that the device has not been added to the VPS yet. Click the button in the note (“Add this Mac to the VPS…”, or the phone’s equivalent) and enter the server password: Contur creates a key, and the script hands out the next free address (for example, 10.66.66.3/32) without touching the first device.

If the exit node was added from a file, the clipboard or by hand, the same button is on the assistant’s last step, “Review and add”.

Exit node settings

On a computer, open the exit node in the connection list, Profile tab. On a phone, tap the exit node, then “Edit”. Here:

  • WireGuard keys: the server’s public key, this device’s keys, the pre-shared key (PSK). Usually left alone.
  • Tunnel: the device’s tunnel address, DNS, MTU and Keepalive. On Mac, Contur picks the packet size (MTU) by itself while running; there is usually no need to change it by hand.
  • “VPS script…” runs the server setup again: useful if the server was reinstalled or something on it broke. Running it again does not affect other devices.

Masking

Masking makes the packets look unlike WireGuard: you need it if the network you are on blocks WireGuard. Without masking the connection is faster. It is on by default.

The masking mode is one for the whole server. On Mac, Windows and Linux it is switched by the “WireGuard masking” toggle in the exit node profile; after switching, click “VPS script…” and run the script again. Other devices on this server stop connecting after the mode changes until they have the same mode. iPhone, iPad and Android have no separate toggle: during setup Contur adapts to the mode the server already runs.

DNS while the exit node is on

While the exit node is on, website names are looked up through the tunnel in the DNS set in the exit node. Names in the FortiGate internal domains are still looked up in the organization’s DNS, and domains from Direct to the Internet in your regular network’s DNS. On Mac, IPv6 on Wi-Fi and Ethernet is turned off for that time so traffic does not slip past the exit node. When you turn the exit node off, everything goes back to how it was.

On a computer, another VPN that takes all internet traffic prevents the exit node from turning on: Contur shows “Conflict with another VPN”, because two such tunnels fight over the same routes. Turn one of them off. On a phone the system keeps only one VPN, and turning Contur on turns the other one off.