I have a php / bash application on top of a linux machine (centos or debian but assume redhat just in case the reply need different dialect) connecting to port 80.
Actually I'm perfectly able to open a VPN via openvpn on linux command line. I use the "route-nopull" option into the .ovpn config file in order to keep the server reachable, so I have the tuntap device handy in active standby as soon as I decide to route traffic through it.
Good to know that I have both tun and tap providers, but my favorite provider uses tun.
Until today I just had to route traffic:
sudo route add 123.123.123.123 tun0
simple & funky. Now I need to open several independent requests, and the route-nopull enables me to connect multiple VPNs ready to be used: tun0 tun1 tun2... My problem is that my "route solution" forces the app requests only in a serial way through one device and I need to wait before a second connection! In addition it's too much for my skills... I need sharing ideas and some technical help.
I have poor skills with iptables and I though that perhaps reverse proxy could enable me to rotate requests to e.g. localhost:9990 -> tun0, localhost:9991 -> tun1 etc, but I have no experience in reverse proxying and they tipically dont support tuntap devices. I'm quite sure that another solution is iptables with multiple routing tables: 123.123.123.123:9990 -> marked for rt0 -> rewritten as 123.123.123.123:80 -> rt0 routes it through tun0 which is its default gateway etc etc for tun1 ans so on.
But this is really too much for my skills!!! In addition I'm scared about compromising my working setup with a bad assumption and messy tests.
Thank you for reading and helping.