On 06/04/17 15:20, David Sommerseth wrote:
> On 06/04/17 15:09, Jan Just Keijser wrote:
>> On 06/04/17 08:28, saato...@keemail.me wrote:
>>> I was able to confirm my suspicion, if I reuse the random ports (which
>>> OpenVPN chose with `nobind`) with `lport`, I'm reassigned the previous
>>> IP addresses. This effectively resolves the IP pool exhaustion.
>>>
>>> However, I still haven't found a way to identify the port of the
>>> OpenVPN client process. I want to automate the process and would love
>>> to have an environmental variable with the port, when using `nobind`.
>>> Unfortunately the variable "local_port" is not set with `nobind`.
>>>
>>> How can I identify the port OpenVPN is binding to using environmental
>>> variables/scripting?
>>>
>> you can't : when using "nobind" openvpn does not provide any info on
>> which local port is used for a connection. It might be trivial to add
>> this , but right now it's not in there at all.
> In --nobind mode ... isn't it the OS which assigns the local port number
> and just provides that back to the application together with the "socket
> descriptor"?
>
> IIRC, when using --nobind, it makes openvpn _not_ call bind() which ties
> it to a particular preconfigured port number.
>
>
correct - and it looks like the OS does not fill in the local port 
number when the socket is created (with --nobind); hence it becomes 
quite difficult to determine whether *at some point* the application 
would know which local port was assigned by the OS...

JJK


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to