Routers and modems

WireGuard files for routers

A router, a modem, a set-top box or any device you set up once and forget is easier to connect with a static plain WireGuard file. Its settings never change: the server name, the port and the keys stay the same even when we replace machines on our side.

How a static file differs from the usual one

The choice is yours. On a phone or a computer the Mayak app is the easiest.

Where to get the file

  1. Sign in to your account on the Mayak website.
  2. Find the “Static connections (WireGuard)” block — it is below the list of AmneziaWG files.
  3. Choose the location and the system (“Windows” or “Linux, macOS, router”) and press “Get a WireGuard file”.
  4. Load the file into the router: the router’s WireGuard client usually has “Import from file”.

Step by step for Windows, macOS, Android, iPhone and a Keenetic router: see the article “How to connect a WireGuard file from Mayak”.

The file takes one device slot of your plan, like any connection. If the slots are used up, the account will offer to replace the AmneziaWG file of the same location.

If an entry point goes down

Reconnecting to another entry point takes up to 2–3 minutes: in that time the name starts pointing at a live entry point, and the router notices the connection is gone and looks the address up by name again. You don’t need to do anything; pages will simply open a little later.

DNS in the file

The DNS line of the file holds several addresses separated by commas: 10.111.111.111, 1.1.1.1, 1.0.0.1, 8.8.8.8, 8.8.4.4. The first one is an internal tunnel address: name lookups sent to it go through the tunnel and reach the internet at the same place as the rest of your traffic. The others are public fallbacks: if the first one doesn’t answer, the device asks the next. The WireGuard app on a computer picks the list up by itself.

On a router, enter these addresses by hand in the same order, 10.111.111.111 first (if the router takes only one or two addresses, put 10.111.111.111 first and 1.1.1.1 second), and make sure the route to it goes through WireGuard. If only some networks go into the tunnel rather than all traffic (a narrowed AllowedIPs or your own routing table), add 10.111.111.111/32 there too. Otherwise the router asks for names outside the tunnel: the connection is up, but websites don’t open.

With such a narrowed route the fallback addresses (1.1.1.1 and the rest) go outside the tunnel, straight through your internet provider. If you want them to go through the tunnel as well, add each of them there with a /32 mask.

The key in the file

The file has a PrivateKey line — the device’s personal key. Our server creates it when you download the file; we don’t keep it. Keep the file like a password: whoever gets it connects as you and takes your device slot.

The same file can’t be downloaded again — only a new one. If the file got into the wrong hands, get a new one in your account: it has a new key, and the previous file for this location stops working.