What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

two openvpn clients at same time?

janosek

Regular Contributor
Has anyone figured out how to get two openvpn clients to work at the same time?


I find when I start the second one, it takes over.
 
Last edited:
Are you trying to connect to VPN services like HideMyAss or StrongVPN? Usually when you connect to these then they redirect all traffic to go over the tunnel by pushing the redirect-gateway def1 option so when you start the second VPN connection, it overwrites the routes for the first one. I have used the route no-pull option in my config so that there are no defaults added automatically to my routing table and then I create the routes that I need. Sometimes this doesn't work so I have created a script to delete the default route that it is added and then add my own routes.

Can you describe exactly what it is you are trying to do? I am curious to see if I can get this working too.
 
Last edited:
I did a quick test and got it working. I am not sure what you are trying to do but I connected to two separate VPN servers and then used rules to make one client use a one server and the other to use the other. Here's is a quick rundown of what I did.

I started the second openvpn service using the route no-pull option. Then created a routing table for that "gateway"

Code:
ip route add default dev tun1 table 20

Then I added a rule to make the traffic from a specific client use that tunnel interface as the gateway.

Code:
ip rule add from 192.168.1.125 table 20

Next was to make sure that the firewall is configured.

Code:
iptables -t nat -I POSTROUTING -s 192.168.1.125 -o tun1 -j MASQUERADE
iptables -I FORWARD -s 192.168.1.57 -o tun1 -j ACCEPT
iptables -I FORWARD -i tun1 -j ACCEPT -m state --state RELATED,ESTABLISHED

This was a quick test but is showed that two openvpn clients could work at the same time. Let me know if this helps.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top