-2

I have done research into this, however, I don't really understand how I can accomplish this.

OpenVPN FAQ Regarding this Topic: http://openvpn.net/index.php/open-source/faq/79-client/283-can-i-run-multiple-openvpn-tunnels-on-a-single-machine.html

My goal is to connect to multiple servers/have multiple connections to a server, using OpenVPN. (Specifically, using Python 3.4.)

For example, I would like to connect to a server - xxx.xxx.xxx.xxx, which uses the TCP protocol 443. In order to use multiple connections, I would need to bind it to a port, e.g. 9537. Now, for the other connection, I would like to connect to xxx.xxx.xxx.xx, which uses the same protocol. I would need to bind it to a different port, e.g. 9538.

--

Now, How would I do this? (Please give examples in Python [Any version, I can port] if you can. Or, pseudo-code that I can work from..) I'm not really sure what the whole, TUN/TAP driver thing is, how to create another driver... It's confusing. So anybody that could help, it would be greatly appreciated.

Kyron
  • 64
  • 9

1 Answers1

1

Just put one .ovpn file for each connection inside openvpn's config/ directory.

When you start openvpn (without specifying --config), it will read all of them and create a connection for each one.

Mikel Pascual
  • 1,924
  • 16
  • 24
  • But, can I specify which port it uses, for example if I want it to listen on port xxxx for a certain application. while the other listens on port yyyy for a different application. And what if the servers have different authentication details? – Kyron Jul 19 '14 at 21:25
  • You can edit the ovpn files so you specify the different port, certificates, etc. The ovpn files don't have to be the same – Mikel Pascual Jul 19 '14 at 21:34
  • I see, thank you very much. Now, on the OpenVPN FAQ, it says something about using a different TUN/TAP adapter. Do you know how I'd create whichever I need (on Debian, Linux)? Or do I not need it at all? If so, do I need to restart OpenVPN (or send a command) every time I add a new config file during my program? Thank you again, your help has been wonderful. – Kyron Jul 20 '14 at 00:06
  • OpenVPN will take care of creating those adapters for you. Also, if you change/add/remove any `.ovpn` file, you'll have to restart OpenVPN (as long as I know, there is no "reload"). By the way, if the answer is enough, should accept it so others can find it more easily. Good luck on your project! – Mikel Pascual Jul 20 '14 at 00:11