Openvpn – multiple client istances for openvpn connections

openvpn

Good day

At my company, on windows machines, we have different client connections open with openvpn like this:

10.1.x.x for Eastern Europe
10.2.x.x for Middle East
10.3.x.x Cuba
10.4.x.x China

They are completely different servers in different locations with their own subnets and iptables rules, this because we have offices running in heavily censored places that need specific rules for each country.

In windows with Viscosity or OpenVpn Gui we just import the file in .ovpn format, or setup them manually, new tap interfaces are automatically created and that's it. All the connections are up and running with no problem.

Now we started using linux on some clients notebooks and I noticed I cannot run multiple istances of the vpn client like we do on windows, because when we connect to one of the mentioned subnets, automatically the other interface and relative connection is dropped.

Actually to setup vpn connections, I've tried installing the packages network-manager-openvpn and network-manager-openvpn-gnome on Debian and derivates.

I'm sure there is any setup I can do directly form the command line, enabling two tun interfaces like tun0 and tun1 and run them at the same time.

I've searched but found nothing so far, specifically for run multiple clients istances on linux.

Actually I've have no need to switch them on or off, or manage them form a gui, it is good to have them permanently enabled.

Thanks in advance.

Best Answer

Debian-based systems should be able handle multiple VPN connections just fine. Just put the configs in /etc/openvpn/*.conf. If you haven't modified your /etc/default/openfile then the startup scripts will startup an instance of openvpn for each *.conf in this directory.

Of course this assumes that your various VPNs don't have conflicting routes or configuration that prevent each other from starting properly.