Answer the question
In order to leave comments, you need to log in
How to raise 2 openvpn tunnels (udp) at the same time?
Hello, virtualbox has two openvpn servers and a client (all debian8) that use the udp protocol. The client connects to both servers at the same time, when connecting to the second one, an error appears:
TCP/UDP: Socket bind failed on local address [undef]: Address already in
use
netstat -u on the client returns empty tcp 0 0 client.lan:51801
ovpn2.lan
:10883 ESTABLISHED
tcp 0 0 client.lan:49416 ovpn1.lan:10882
ESTABLISHED listening socket:
A listening tcp socket, when a connection is established with it, creates a copy of itself and a connection is established with a copy already, a listening udp socket simply receives a datagram without establishing a connection, on one socket, from any number of clients. And I think it has something to do with my situation.
Help me to understand.
Answer the question
In order to leave comments, you need to log in
Here is the mechanics, the default behavior of the current version of openvpn is different for tcp and udp.
For tcp connections from an openvpn client, by default, it automatically selects an unoccupied non-privileged port on the client machine and uses it in connection with the server, so it turns out fine, something like this:
tcp 0 0 client:46788 ovpn1:10882 ESTABLISHED 2320/openvpn
tcp 0 0 client:38172 ovpn2:10882 ESTABLISHED 2322/openvpn
lport 44455 - первому клиенту
lport 44456 - второму клиенту
nobind
in each config, in this case, openvpn will do the assignment of local ports in the same way as tcp automatically. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question