Score:0

Multiple wireguard interfaces each using the 'real' interface directly, and through either be able to reach any IP

in flag

I'm in need of setting up multiple wg-quick interfaces on a single machine, both using the real ethernet NIC directly, independently.
The issue I appear to be hitting is that through each of these I want to access the entire internet, which I assume means AllowedIPs = ::0, but wg-quick likes to add routes locally such that all traffic going anywhere will go through this new interface; including any following wg-quick attempts..

Is there a way to call wg-quick and tell it "hey, no, I'd like you to use specifically eno1, not the 'default gateway'"? Perhaps using raw wg?

I've tried reading a bunch online but I keep getting confused what others are asking when it seems like a similar question, but turns out to be hosting multiple wireguard services or something.

Depicted below is the basic gist, with two wg interfaces. wg0 in this instance is doing the normal wg-quick thing of stealing all traffic transparently, where wg1 is an available interface where I can configure apps to specifically talk to it.
I don't mind if your solution has wg0 being forced to work this way, I can set up a SOCKS and HTTP proxy for software that do not support "use this interface/IP for traffic" flags to get the same effect.

                                                             
      Home                ║      ISP       ║       Internet  
                          ║                ║                 
                          ║                ║                 
  ┌─────────────┐         ║                ║                 
  │             │         ║                ║                 
  │             │         ║                ║        ┌───┐    
  │             │         ║                ║     ╔══╪        
  │         eno1│         ║                ║     ║  └───┘    
  │   wg0      ┐│         ╙────────────────╜     ║  VPN0     
  │     ┐      └─────────────┘                   ║           
  │     ╞════════════════════════════════════════╝           
  │     ┘   ╔════════════════════════════════════╗           
  │   wg1   ║  ┌─────────────┐                   ║           
  │     ╓   ║  ┘│  router                        ║  ┌───┐    
  │     ╠═══╝   │         ╓────────────────╖     ╚══╪        
  │     ╙       │         ║                ║        └───┘    
  │             │         ║                ║        VPN1     
  │             │         ║                ║                 
  └─────────────┘         ║                ║                 
        PC                                                   
                                                             

"Why?". Using openVPN my provider allowed open ports, basically local firewall permitting, I was publically routable and could host services on any number of ports I wanted. They've moved to wireguard, which is great, but they only support one open port per wireguard connexion. So basically for every app I had a port forwarded, I want to spin up a vpn interface for it.

Is this possible using just wireguard, no ip routes or anything?

A.B avatar
cl flag
A.B
Look at the `Table` parameter in man wg-quick. The various requirements in your question (such as "including any following wg-quick attempts") doesn't let me attempt to do an answer.
in flag
so there's no way to ask `wg` to use a specific interface to initiate a connexion? Like, what if I had two interfaces, `eth0` and `wlan0` and the default route is through ethernet but the target wireguard server is only available via wifi, is that usecase just impossible?
mangohost

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.