English · Русский · 中文 · فارسی
AWG Router
A web panel for AmneziaWG: users, tunnel settings, cascade routing and individual routing for each client in one place.
It installs its own AmneziaWG server — in a Docker container or on the host — or takes over a server that already runs, the one the AmneziaVPN app installed (the amnezia-awg2 container) included, with all its users. Protocol support goes up to AmneziaWG 3.1.
Quick start — on an Ubuntu or Debian server, as root (Docker is installed if it's missing):
curl -fsSL https://raw.githubusercontent.com/r-slashslash/AWG-Router/main/install.sh | bash
The installer sets up everything, including Docker Compose, and prints the panel link and password at the end. Details: Install.
┌── RU / CN / IR ──────────► internet (this server's IP)
clients ──AWG──► this server ─┤
├── everything else ──AWG──► server #2 ──► internet
└── client "Dad" ─────AWG──► server #3 ──► internet
Cascade VPN (double VPN): local traffic direct, the rest through a server abroad
AWG Router makes your AmneziaWG server the entry point of a cascade. Clients connect to it only, and the server decides where each connection leaves for the internet:
- traffic to the countries, networks or sites you choose goes out directly from the entry server, with its local IP and no detour;
- everything else goes through a second AmneziaWG server (or a SOCKS5 proxy) in another country and reaches the internet from that server's IP;
- there can be several exits: different lists to different servers, or a separate exit for a single client;
- the split (split tunneling) lives on the server, so client configs stay ordinary — nothing to set up on phones or routers;
- exits, lists and rules are set up in the panel instead of hand-written iptables and ipset scripts;
- if an exit goes down, traffic doesn't slip past it: it goes direct, is blocked or moves to another exit, as you choose.
A fallback helps only when it fails separately from the main exit. Two exits to the same server are one path, not two: if its address is blocked entirely, a SOCKS5 proxy over that address and a direct AmneziaWG tunnel to it stop working at the same moment.
So put an exit on a different server in the fallback — a different address, a different host, a different autonomous system. And where possible don't reach the final server directly from a country that blocks: if it is only reached from abroad, its address is not visible there.
Details are in How routing works.
Features
Clients
- Add, rename, disable and delete clients.
- Connect a device with a QR code, a
.conf file or a vpn:// link for the AmneziaVPN app.
- Clients created in the AmneziaVPN app show up and can be managed too. The panel can't show their config, because the private key exists only on the device.
- A disabled client stays in the config as a comment, so nobody else takes its address.
- Traffic per client for the month and all time; it survives restarts. A client that is online also shows its speed right now (download and upload) in the list. Sort by name, address, traffic or activity.
- All-time traffic through the server next to the panel name (it stays when clients are deleted).
- The panel's status line starts with what the panel is doing: Running (green); Starting…, Restarting the AWG server…, Switching the engine… or Updating… (yellow, an update started in the server console too); Error or No connection to the panel (red; hover for the reason, click to jump to the messages at the top), then the server's CPU and memory load (hover for the load average and how much memory is in use), then clients online.
- If the AmneziaWG server's interface disappears while the container keeps running (for example, the kernel killed
amneziawg-go when memory ran out), the panel restarts the server by itself and tells you in Telegram. Server → Restart the AWG server does it by hand.
- An end date and a traffic limit (per month or in total). When they run out, the client turns off by itself; a monthly limit resets on the 1st at 00:00 UTC (the panel shows when that is in your time) and the client turns back on. Three days before the end date and at 90% of the limit you get a warning, and Ending soon in the client list shows who is close.
- Speed limits (off until you set them): a cap for all clients together, a personal cap per client and a cap per exit, download and upload separately. Within the common cap the speed is split evenly between those downloading right now. Connections don't drop, the internet just gets slower, and latency stays low under load.
- A personal link: the person opens it, downloads their config or scans the QR code, and sees their traffic and end date — no panel sign-in. The link exists from the moment the client is created, and the same key is the client's invitation to the Telegram bot: there they see the same and get their config, nothing else of the panel; by choice the bot also reminds them about the end date and the limit (System → Telegram). Both are in the client window, under Connect; Renew there replaces both.
- Light and dark themes with a day/night button in the header. The browser tab shows the server's address or a name you give it (System → Settings → Server name) — handy with several servers open.
Server
- Every AmneziaWG parameter: Jc/Jmin/Jmax, S1–S4, H1–H4, I1–I5, HeaderProtectionKey, ContentPaddingAddition, AWG 3 timings, RandomTrailers and DisableCookies.
- Ready-made masking for the signature packets I1–I5: STUN (calls, WebRTC), QUIC (HTTP/3), DNS query, SIP and a DNS response for icloud.com with Apple’s real address, with random parts so no two handshakes look alike. The packet AmneziaVPN puts in by default (the same everywhere, with icloud.com pointing to a Yandex address) is replaced with this one by the panel itself. I1–I5 are checked strictly (only tags every AmneziaWG understands, packet size shown) and can be set per client: if a client's provider starts blocking, give that one client another masking.
- Fresh parameters on demand, generated the same way as the AmneziaVPN installer does for AWG 3.1.
- Port, subnet, client DNS/MTU/keepalive, public address and the address in client configs (IPv4 or IPv6).
- Additional server addresses: other IPs or domains of this server. Any of them can go into all configs or into one client's config (for example, when one address is blocked for that client); websites still see the server's main address or the exit's.
- DNS on the server (optional): clients ask the server for DNS, and it asks the servers from the settings the same way the client's traffic goes, with a cache and encryption (DoH or DoT). See DNS on the server.
- Adding or removing a client is applied live without dropping anyone. Server-side parameters restart the interface, which takes a few seconds.
Routing
- Exits are client configs from other AmneziaWG servers or SOCKS5 proxies (
socks5://login:password@host:port). Both TCP and UDP go through a SOCKS5 exit (UDP if the proxy supports UDP ASSOCIATE); HTTP/3 (QUIC, UDP 443) only with “Let QUIC through the proxy” in the exit's window — without it browsers open sites over HTTPS right away. Check on the exit shows whether the proxy passes UDP. If an exit fails, its traffic goes direct, gets blocked or moves to another exit, whichever you choose.
- Traffic per exit and direct for the month and all time, and each client's monthly traffic split by exit. An exit can have a monthly limit; when it is used up, its traffic until the 1st goes direct, gets blocked or moves to another exit, whichever you choose (or you only get a notification).
- Rules map a list to an exit. Lists can be countries, autonomous systems (ASN), lists fetched from a URL, your own subnets or domains, and they refresh automatically. Each rule is set up in its own window (Routing → + Add rule, or a click on the rule): name, lists — existing ones, a country or a new one made right there — the own DNS of a domain rule, and the exit. There is no separate lists section: a list that is no longer in any rule is deleted with it.
- Domain rules for any exit (AmneziaWG, SOCKS5, Direct or Block):
example.com on a list also covers all its subdomains, and a whole zone works too (.ru, .cn, .net); you can paste a link to a ready-made list (plain domains, dnsmasq, hosts, Adblock, v2ray). The server learns the site from its name at the start of an HTTPS, HTTP or HTTP/3 connection (TCP 443 and 80, UDP 443). Through SOCKS5 it passes the name to the proxy, which finds the address itself, so DNS spoofing by the ISP doesn't matter; through AmneziaWG and Direct the connection goes to the address the device got from its DNS; DNS on the server resolves such names through the rule's exit, so the address isn't spoofed and is near the exit. Client DNS and configs don't change. Such rules are checked before address rules.
- A rule in a policy reads like what it catches and where it goes: its lists on the left (
Domains work (20), an exit's own sites by their first domain youtube.com +19, Russia, China +1, Office (12 networks)), then the exit — right after them on a wide screen, at the right edge on a phone, where a rule whose exit doesn't fit next to its lists shows only the first one and +N; a rule's own name shows above it in small grey; a rule that is off stays in its place, grey and struck through.
- The exit window asks for the type first (AmneziaWG or SOCKS5). For SOCKS5 there are separate fields for the address, port, login and password (they make up the connection string; a pasted string fills them in). For both types the routing for that exit is set in the same window: sites (domains) to send through it, domain and network lists, or all traffic. This is saved as ordinary global rules; rules you turned off, rule names and their order stay as they are.
- Each client can have its own exit and its own rules: they replace the shared ones and are set up in the same rule window.
- Load balancing (optional) instead of the default exit: each client gets the least busy of the chosen exits, measured against the exit's speed limit when one is set. If one exit is overloaded while another sits idle, some clients are moved over within a few minutes without dropping their open connections; a failed exit's clients move at once. Rules and clients' own exits still apply.
- Route check shows which way an IP or domain would go.
Panel
- HTTPS with a Let's Encrypt certificate for the server's IP or your domain, renewed by itself, or with your own certificate (for example, from certbot). If nginx or Apache already holds port 80, validation goes through it.
- Alternatively, the panel can be reachable only through an SSH tunnel.
- The address uses a random port and a secret path, and login is password-protected with brute-force protection. A sign-in lasts 4 hours.
- Optional second factor: a 6-digit code from an authenticator app (Google Authenticator, Aegis, 2FAS…). Turned on in System.
- Optional Telegram notifications: an exit stops or recovers or nears its limit, the AmneziaWG server is unreachable or restarted, server memory stays above 90% or CPU above 95%, a client nears or hits its end date or limit, a new client connects for the first time, panel sign-ins, a certificate that can't be renewed, a new panel version. Set up in System. Where Telegram is blocked (Russia, China, Iran), the bot can send through one of your exits; if the chosen path doesn't work, the bot tries others (If it fails, try other paths, on from the start): from Direct — your exits one by one, from an exit — the other exits, but never directly. A path that works is kept, the chosen one is tried again every 10 minutes; if nothing works, messages wait for a connection. This covers everything the bot does: notifications, control, messages to clients and backups. Turn on the bot is the main switch: off means the bot is silent.
- Optional control from Telegram: the bot becomes a remote:
/start opens the menu in a single message — the panel logo with the host, panel version, clients, how many are online and all-time traffic under it — and everything happens in that message, with a ‹ Menu button to go back. Server holds the status (versions, IPv4 and IPv6, DNS on the server, uptime, RAM, traffic this month) and the exits (tap an exit to check it or make it the default); Clients starts with New client. Also: turning a client on or off or deleting it (after a confirmation), its QR code and config file, +30 days or +10 GB, a new client with /add