How to isolate interfaces on a wireguard proxy server

pl flag

I have a Wireguard server that I want to act as a public proxy to all my WG VPNs.

My first wg config (wg0) is a standard road warrior scenario. This is the setup:

  • ProxyPeer - wg0 address, publicly reachable
  • LANPeer - inside of LAN, using NAT, wg0 address
  • MobilePeer - wg0 address

This is working well - I can connect from MobilePeer to ProxyPeer and ping anything in LAN using the LANPeer no problem.

Now I want to add a secong config (wg1) to ProxyPeer, that allows me to bridge two LANs like so:

  • ProxyPeer - wg1 address, publicly reachable
  • LANPeer - the same LANPeer as in wg0, but with wg1 address
  • OfficePeer - wg1 address, inside of LAN

Now when I try to start the wg1 interface in ProxyPeer, it fails with the following error (taken from sysctl status wg-quick@wg1):

Feb 12 20:28:39 debian wg-quick[19307]: [#] ip -4 route add dev wg1
Feb 12 20:28:39 debian wg-quick[19372]: RTNETLINK answers: File exists

I know it's becuase I have AllowedIPs = for the LANPeer, but that's what I need.

Any ideas how to fix this?

I've tried adding (on ProxyPeer) Table = 100 to wg0 interface and Table = 101 to wg1, but that broke event the working wg0 setup.

vidarlo avatar
ar flag
Why do you want to reuse subnets like that? It's a recipe for disaster.
hKaspy avatar
pl flag
It's one peer (NATed) in one subnet trying to be in two VPNs together.
vidarlo avatar
ar flag
Why not use different subnets for... each subnet?
hKaspy avatar
pl flag
Apologies, I've edited the question to better explain what I'm trying to do.
djdomi avatar
za flag
if more as one vpn is used, use subnet ting and route to the targets
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.