Is there a way to connect through a VPN by using a socks5 proxy in firefox? I want to have different connections per browser profile and container tabs. I know that some services allow this BUT they require their app to be open and connected which means the whole OS is going through the VPN so its pointless for what I want. Is there a way to do this with Opnsense maybe?
You could do it with a small linux vm/container. It needs to act as the VPN client and you need to enable your default route through the VPN. Depending on the VPN protocol, you need to enable that on the server and client at the same time. Once that is done, you need to enable routing/forwarding on the linux box.
To act as a SOCKS proxy, look into the configuration of your SSH daemon. You can then point your Firefox profile to the linux box.
Mind you, these are just very crudely pointed out steps, but this should be easily achievable.
Yes, this would also work with OPNsense, pfSense or if you want it very lightweight, you can use OpenWrt. The latter runs on ARM/MIPS devices but can also run on x86 hardware or as a VM.