I have 2 openvpn clients connected to 2 different servers, on tun0 and tun1 devices.
I need to add 2 static routes, for the same host IP, and map them to 2 different gateways and tun devices.
I've ran these 2 commands:
route add -host 69.30.217.90 gw 10.197.2.1 dev tun0
route add -host 69.30.217.90 gw 10.197.14.1 dev tun1
When I make a CURL request, and specify the device to use, only the 2nd route works. Once I deleted it (by stopping the openvpn instance) the first route works.
Is there any way I can make both routes work, depending on which device I use to make the request?
EDIT:
I should add that this is a simplified example.
I actually need to have upward of 5 openvpn tunnels up at the same time, and the lifetime of the route is ~1s, only enough to do a single curl request.
My purpose for doing this is to test VPN servers if they are working properly, in a similar fashion a client would during normal use, by connecting to the server, making a request through the tunnel, and comparing against expected response.
Running a single instance of the testing daemon works just fine, however the full test suite takes ~20s, and would take a long time to test 100s of servers. I can run multiple of them in parallel, however they end up stepping on each other's routes.