Okay, got a conceptual diagram made, and a ton of explanation of the what and wh...
The Psychotic Network Ferret @nuintari@bsd.cafe
Okay, got a conceptual diagram made, and a ton of explanation of the what and why incoming!
Almost everything in this picture is virtualized. The physical devices are the firewall, the virtualization server this all runs on(not pictured), the workstations, and the mobile devices. The rest is all VMs, containers, and VLANs.
My home router/firewall is a Juniper SRX300, which supports neither Wireguard nor OpenVPN. My VPN provider only supports those. So, right there, I needed something separate. I have an OpenBSD based router which handles the OpenVPN to Switzerland. Everything "behind" the VPN router uses the default route over the VPN.
Not that it matters, but I used OSPF to signal all my internal routes, you could do this, or use statics, or I have some other ideas on how to get this same/similar effect (see below). Also doesn't matter, but the VPN segment of the network is restricted from speaking to the primary network. The primary network can see in, the VPN network cannot see back out. It goes over the VPN or it goes nowhere.
So, "behind" the the VPN router is an assortment of virtual machines and containers that I want to always use the VPN. Obviously my bit torrent handler lives here, have a few other things as well. I also have a socks proxy server here that my web browsers on my workstations and laptops can use I use Foxy Proxy, which allows you to set a browser wide proxy server, or you can define a proxy server on a tab by tab basis. Pretty handy for selectively bypassing GeoIP content restrictions.
I have never found a way to actually set a proxy server on Android, and my wife and I each have a tablet and a phone. So instead, I also run Wireguard on the VPN router, and when I want to use the VPN on those devices, I enable the connection. I use the WG Tunnel app.
So I can turn VPN usage on and off on individual tabs on full fledged computers, and on and off for the whole device on mobile devices. I used to have a wireless network attached "behind" the VPN router, but I never used it and therefore decommissioned it. Whenever I need something other than web traffic through the proxy on my workstation, I typically just SSH tunnel via the VPN router.
I could do the socks, wireguard, and openvpn all on one device, but I prefer to keep things isolated. The only reason I haven't moved the internal wireguard server to its own instance is because I just built that piece in the last month or so as a proof of concept. I want to separate it, but because it's summertime, my garden takes priority right now.
So that is how I did it. You may not have the necessary assets to build such a beast, and/or your needs may be a bit different from mine.
--------------------------------
Probably the easiest way to get what you want is to have a separate wireless network on a separate VLAN and IP subnet. This is one of those cases where NAT makes this easy, and eliminates the need for any fancy routing. If it comes from subnet X: Source NAT via the physical interface. If it comes in via subnet Y: Source NAT via the VPN interface. This of course assumes your Network OS of choice has this capability. I can see how to configure it in pf in my head. This also assumes your wireless APs can map VLANs to SSIDs.
I am happy to answer any questions you have! I hope this helps you get started!