micahmo / WgServerforWindows

Wg Server for Windows (WS4W) is a desktop application that allows running and managing a WireGuard server endpoint on Windows
MIT License
818 stars 78 forks source link

Running additional outbound WG connections along side or within the WS4W install #123

Open bpapa9013 opened 1 year ago

bpapa9013 commented 1 year ago

Hey, first of all great package, worked for me right out of the box to deploy a home WG server node on Windows. I had reviewed the previous material on how to do it manually and thankfully found WS4W before I attempted it.

My question is basically just about running other WG tunnels on the same windows machine (but outbound client tunnels). The particular arrangement to sort my needs would be without any default routing, and would only be used by local software that can be manually configured to use the adapter associated with that other outbound tunnel.

Is there a way to integrate additional outbound tunnels directly in the WG instance that WS4W spins up? Or can I just run a vanilla windows WG instance along side WS4W? I think I have a good understanding of the networking configs involved, so this is more of a sysadmin inquiry, my priorities are more ease of setup than eking out every ounce of efficiency from the server. After all it's just a home setup used for convenience, testing, and learning.

micahmo commented 1 year ago

Hey @bpapa9013, good question! This is not something I have set up personally, so your best bet may be to just give it a try.

I will say that WS4W doesn't really spin up an instance of WG so much as it uses the instance that's installed on your system (or lets you install it). For your outbound tunnels, I would do them directly in the WireGuard app. I don't see why you couldn't both have a server listening and an outbound tunnel active at the same time.

I'm not sure how the two will interact with each other though. I know you said you'd configure individual apps to use the WireGuard client adapter, but I feel like WG might try to route everything in Allowed IPs over that adapter, including potentially the incoming traffic from the server adapter.

Again, I'm mostly guessing having not done this myself. But I'd say give it a try!

bpapa9013 commented 1 year ago

Cool, thanks for the info! I guess I was confused about there possibly being a separate instance of WG installed by WS4W because when I open up the WG interface I don't see the server profile WS4W sets up in that ui. But I think I just realized that has to do with which config files are loaded by default rather than there being a whole separate instance...

But I'll go ahead and start playing around with it. I thought I had figured out a solution to the routing over the additional client tunnel, but I had stepped away from this project for a bit so I will need to review my previous research on that.

I'll post back with results if you think that you and/or the userbase here would be interested to know.

micahmo commented 1 year ago

I guess I was confused about there possibly being a separate instance of WG installed by WS4W because when I open up the WG interface I don't see the server profile WS4W sets up in that ui.

You are right. I think this is mostly due to the official WireGuard client not being designed for servers. But it's all the same instance under the hood, and you can even see server logs on the Log tab.

I thought I had figured out a solution to the routing over the additional client tunnel . . . I'll post back with results if you think that you and/or the userbase here would be interested to know.

That sounds great, please do!