- cross-posted to:
- [email protected]
- cross-posted to:
- [email protected]
This autumn a report from Russia caught my eye: on a self-hosted VPN server abroad, only the outgoing address got banned, about two days in, while the address the devices connected to kept working (https://github.com/net4people/bbs/issues/671). The next exit IP lasted about a day. Nobody knows for sure why. But if entry and exit are the same IP, losing the exit means losing the VPN.
So I split them. The server gets a second public IPv4, and one SNAT rule for the client subnet, placed above the usual MASQUERADE, sends client traffic out through it. Devices keep connecting to the first address, and websites see the second. When the exit gets blocked, I swap that one IP and nobody has to reimport a config. That matters a lot once the VPN is on your parents’ phones.
I also checked what happens when it breaks. If the exit address drops off the interface, traffic doesn’t quietly fall back to the entry address. Connections just stall, after 9 to 28 seconds in my tests, and in the run I captured not a single client packet went out from the entry.
It’s one rule, so it works the same with plain WireGuard and wg-quick. I use AmneziaWG, a WireGuard fork with obfuscation, because plain WireGuard gets blocked there. My installer for it sets this up with an --exit-ip flag (bash, MIT): https://github.com/bivlked/amneziawg-installer
One catch: a second IP from the same hoster often sits in the same subnet, so if the whole range gets blocked, both go. Has anyone seen exit-only blocking outside Russia?


