I’d like to share my updated script on https://github.com/sakul987/wg-container which now supports running multiple vpn connections simultaneously using multi mode while the rest of the system does not connect to a vpn.
For example you could open a firefox instance routing through a vpn in Sweden, open a firefox instance routing through a vpn in France and install a package through a vpn in Canada while the rest of your system is not connected to a vpn. Currently up to 256 simultaneous connections should be possible.
Active connections can be listed with the list command to get an overview.
I might try to create an AUR package for the script when I find some time for that.
Feel free to ask if something is unclear.
Obligatory “did you run shellcheck” ?
I see that you reference gist from jamesmcm, do you know of his application vopono
? It runs apps with OpenVPN/wireguard connections.
Slightly different use case, but I love gluetun which is a Docker image that then you attach other containers to its network namespace.
Includes tons of handy features like firewalling, DNS ad/malicious blocker, proxy support, health checks, reconnects, and more.
Would be awesome if you combined your script to use gluetun under the hood to setup and manage the VPN and then your script could extend gluetun to map local apps in to the container’s namespace.
I have to use a VM for this with open-connect or my whole internet connection gets routed half way around the earth and the locale is a language I don’t read.
Nope, didn’t know such a thing exists. Will try to improve from it, thanks
Yes I know it, I just wanted something simpler. Rust is a bit too much for me
Not sure if I understand that correctly, does the script not work for you?
Just saying how I accomplish a similar goal.
I might see if I can try your script with openconnect.