Hi everyone,
I’m running a central WireGuard server on a MikroTik CHR (10.20.30.1) and have five “clients” and three “users” all peered directly to it. By default everyone’s traffic is NAT-ed out via the CHR’s public IP. What I’d like to do is give two of my users a “double-hop” so they egress with the public IP of a specific client.
+------------+
| Internet |
+-----+------+
|
[ CHR ]
WG @ 10.20.30.1
|
---------------------------------------------------------
| | | | | | | |
[C1] [C2] [C3] [C4] [C5] [U1] [U2] [U3]
WG@ WG@ WG@ WG@ WG@ WG@ WG@ WG@
.101 .102 .103 .104 .105 .201 .202 .203
- CHR (10.20.30.1) is the central WireGuard endpoint.
- Clients C1–C5 each have WG IPs 10.20.30.101–.105 and peer to CHR.
- Users U1–U3 each have WG IPs 10.20.30.201–.203 and peer to CHR.
On every peer:
[Peer]
PublicKey = <CHR pubkey>
AllowedIPs = 0.0.0.0/0
Endpoint = <CHR public IP>:51820
PersistentKeepalive = 25
CHR’s WG interface also has:
[Peer]
PublicKey = <each-client pubkey>
AllowedIPs = <peer’s WG IP>/32
- CHR is NAT-masquerading all wg-traffic out to the Internet (etho1 is masquerade in NAT), so all peers appear as CHR’s public IP.
Desired behavior
- User 1 (10.20.30.201)
- Still peers to CHR.
- Traffic from U1 should be forwarded to Client 1 (10.20.30.101) on the CHR box, then NAT’d out via C1’s public IP.
- User 2 (10.20.30.202)
- Similarly should egress via Client 2 (10.20.30.102) and thus use C2’s public IP.
- User 3 (10.20.30.203) and Clients 3–5 remain untouched and continue to egress directly via the CHR’s public IP.
What I’ve tried
- Adding static routes on CHR pointing 10.20.30.201 → 10.20.30.101 / 10.20.30.202 → 10.20.30.102
- Policy-based routing / mangle rules to mark packets by source IP, then routing table lookups.
Both of it works only if i add 0.0.0.0/0 in the CHR Peers allowed address but then it overlaps and only the first connected peer works for the routings
Questions
- How can I configure CHR (RouterOS) to forward U1’s WG-tunnel traffic through the C1 tunnel and then NAT it on C1’s WAN?
Limitations
- I can only have One WG interface in the CHR.