Separate entry and exit IPs on one AmneziaWG server

If your AmneziaWG server has two public IPv4 addresses, clients can connect to one while their traffic leaves to the internet from the other. For traffic that goes through the VPN, websites and apps see only the exit address. When the exit gets blocked, you swap that one address and every client config keeps working. amneziawg-installer sets this up with a flag at install time or one command on a running server.

One server, two IPv4 addresses Client configs stay the same No fallback to the entry if the exit disappears

How it works

Clients only know the entry address. The exit lives in one rule on the server.

Client Endpoint = entry ISP sees the entry Your server ENTRY 198.51.100.2 SNAT EXIT 203.0.113.7 Websites and apps see 203.0.113.7
One server, two addresses. The client connects to the entry; client traffic leaves from the exit; the server's own traffic (updates, DNS) keeps using the main address.
Who sees which address
WhoSees
The client's ISP and its DPIthe entry address
Websites and apps, for traffic inside the tunnelthe exit address
Your hosting providerboth
Services the server itself talks to (updates, DNS, NTP)the main address, usually the entry

One SNAT rule

The installer adds a rule for the client subnet that rewrites the source to the exit address. It sits above the usual MASQUERADE, so it wins for client traffic and leaves the server's own connections alone.

Clients only know the entry

The Endpoint in every client config is the entry address. The exit appears nowhere on the client side, so changing it never means reissuing configs or QR codes.

No silent fallback

If the exit address disappears from the server while the rule is in place, the rule still uses it as the source. Client traffic does not quietly leave from the entry; the connection usually just stops until the address is back. Without the rule, traffic goes back to the main address, and that is how exit-ip off works.

When this helps

One reason is new and specific to Russia, the other is as old as datacenter IPs.

In autumn 2026 people in Russia started reporting that only the outgoing address of a foreign VPN server got banned, while the address clients connected to kept working (net4people #671). Nobody has proven why. But if entry and exit are the same address, losing the exit means losing the VPN. With separate addresses you lose only the exit, and swapping it is one command.

The other reason is reputation. Datacenter addresses end up on blocklists and behind CAPTCHAs. With a separate exit you can change the address websites see and leave clients alone, which matters once your VPN runs on the phones of people who will never reimport a config.

What it does not give you

Both addresses usually come from the same hoster and often from the same subnet. While addresses are blocked one by one, that is enough. If both addresses are in a range that gets blocked, both go down, and you need a server elsewhere or a cascade.

The exit is IPv4 only and does not combine with the IPv6 tunnel for clients (--allow-ipv6-tunnel). In full-tunnel configs from my installer device IPv6 stops inside the tunnel, so it does not bypass the exit; the FAQ below has the details.

The exit has to be already on an external interface of the server and differ from the entry (tunnels and loopback do not count); the installer and manage check this.

Setting it up

Available since version 6.3.0. Example addresses: entry 198.51.100.2, exit 203.0.113.7.

  1. Put the second IPv4 on the server.

    The hoster assigns it, but sometimes you have to add it to the interface yourself. On Ubuntu with netplan, use the same interface key as in your existing file in /etc/netplan/ (usually the name from ip -br addr, but not always). Debian with ifupdown is covered in the step-by-step article.

    # /etc/netplan/60-exit-ip.yaml
    network:
      version: 2
      ethernets:
        ens3:
          addresses: [203.0.113.7/32]

    Then sudo netplan apply. Before installing, check the address: curl -s --interface 203.0.113.7 https://api.ipify.org should print 203.0.113.7. On my test server the address only started working after a reboot from the hoster's panel. After the install this check no longer works: the installer's MASQUERADE rule rewrites the server's own traffic to the main address.

  2. On a new server: two flags.

    --endpoint is the address clients get, --exit-ip the one their traffic leaves from. Set --endpoint explicitly: without it the installer takes the address the server is seen from on the internet, usually the main one, and that is not always the one you want clients to use.

    sudo bash install_amneziawg_en.sh --endpoint=198.51.100.2 --exit-ip=203.0.113.7
  3. On a running server: one command.

    Client configs do not change. The service restarts and clients lose the connection for a few seconds (about 13 on my test server). exit-ip off removes the exit, and --json gives a one-line answer for scripts.

    sudo bash /root/awg/manage_amneziawg.sh exit-ip 203.0.113.7

    Open connections (a long download, a call) do not move to the new address on their own. If conntrack is on the server, the command tries to drop their entries, and apps then have to reconnect through the new exit; without it they keep the old address until they reconnect. Install it before changing the exit: sudo apt update && sudo apt install conntrack (the installer clears the package lists at the end).

  4. Check from a client, and swap when needed.

    curl -4 ifconfig.me on a connected device should print the exit address. When the exit gets blocked, get a new address from the hoster, put it on the interface and run exit-ip with it. The entry stays the same, so nobody has to reimport anything. manage check reports an exit address that is missing from the interface.

Tested on my own server

Including the unpleasant case.

I removed the exit address from the interface of a running test server and watched what happened. In three runs client connections stalled after 9 to 28 seconds; the spread probably comes from the ARP cache of the hoster's router. In the run with a full packet capture not a single client packet left from the entry address, and in a later check the connection came back within two seconds of the address returning. If your hoster routes the address to the server without ARP, the connection may even keep working. The step-by-step article goes further: the manual SNAT rule for plain WireGuard, a server set up by the Amnezia VPN app, and every check along the way.

Frequently asked

Do clients need new configs when I change the exit IP?
No, client configs stay the same, because they only contain the entry address. The exit address lives in a single rule on the server, so changing it is one command, manage exit-ip with the new address. Clients lose the connection for a few seconds while the service restarts.
What do I do if the exit IP gets blocked?
Swap only the exit: get a new IPv4 from the hoster, put it on the server interface and run manage exit-ip with the new address. The entry stays the same, so nobody has to reimport anything. If the hoster's whole range gets blocked, another address from it will not help, and you need a server elsewhere or a cascade.
Does this work with plain WireGuard?
Yes, the mechanism is not specific to AmneziaWG: it is one Linux SNAT rule for the client subnet, placed above the MASQUERADE rule. My installer sets it up only for AmneziaWG, but the same rule works in the PostUp of a wg-quick config; the step-by-step article shows the manual version.
How is this different from a cascade?
A separate exit needs one server with two IPv4 addresses, while a cascade links two servers. With two addresses on one server both belong to the same hoster and usually the same country. A cascade puts the exit on another machine, so the entry can be in Russia and the exit abroad, at the cost of a second VPS. In my cascade guide Russian traffic leaves straight from the entry server on purpose.
What happens if the exit address disappears from the server?
Client traffic does not fall back to the entry address while the SNAT rule is in place: the rule keeps the exit as the source. Usually the connection just stops. On my test server it stalled after 9 to 28 seconds and came back within a couple of seconds once the address returned. manage check reports a missing exit address.
Can the exit address be IPv6?
No, the exit address is IPv4 only, and it does not combine with the IPv6 tunnel for clients (--allow-ipv6-tunnel): the installer and manage refuse that combination. In full-tunnel configs from my installer (issued or regenerated since v5.31.0) device IPv6 goes into the tunnel and stops there, so it does not bypass the exit. Older configs and split-tunnel setups (--route-amnezia, --route-custom) are worth checking yourself.
Where do I get a second IP address?
A second IPv4 address for the same server comes from your hosting provider, usually as a paid add-on. Sometimes the hoster only assigns it, and you add it to the interface yourself, for example with netplan. Check that the address is really there with ip -br addr before setting it as the exit.
What happens to connections that are already open when the exit changes?
Open connections do not move to the new exit address on their own. If conntrack is on the server, manage exit-ip tries to drop their entries, and apps have to reconnect through the new exit. Without it a long download or a call keeps the old address until it reconnects. Install it beforehand with sudo apt update && sudo apt install conntrack.