Page 1 of 1

problem with unstable channel and client-disconnect

Posted: Mon Mar 14, 2011 6:35 am
by sles
Hello!

I run openvpn server over udp and some clients have unstable links, just because they use mobile phone connections (btw, over udp it works better then over tcp).
And I need to run script on client connect and disconnect:
client-connect /etc/openvpn/client-42/connect.sh
client-disconnect /etc/openvpn/client-42/disconnect.sh

problem is that sometimes I see connectivity problem on server side like this
Mar 12 13:24:47 mandela openvpn[24706]: read UDPv4 [CMSG=8|ECONNREFUSED]: Connection refused (code=111)

but server doesn't drop connection, but client drops and connects again:
Mar 12 13:24:51 mandela openvpn[24706]: MULTI: new connection by client 'yakbodinskoe' will cause previous active sessions by this client to be dropped.

result is following:
looks like (I don't see it in logs, but I can add logging ability to script to be shure) server first connect client with new session and run client-connect script, but then server drops previously existed connection and run client-disconnect, so result is as client-connect script was not executed :-)

I run old 2.1_rc7 (ubunti 8.04).

Is this problem solved in newer versions or what can I do to solve it?

Thank you!

Re: problem with unstable channel and client-disconnect

Posted: Mon Mar 14, 2011 8:10 am
by sles
btw, I looked into 2.2 sources and see no difference:
1. openvpn allows clients to connect and removes previous sessions
2. on this previous sessions removal openvpn calls client-disconnect script.

I think good idea is to have configuration parameter to call disconnect script or not in such situations.
What do you think?

Thank you!

Re: problem with unstable channel and client-disconnect

Posted: Mon Mar 14, 2011 10:43 am
by sles
hmm, after looking into sources more deeply I found that openpvpn removes old sessions before creating new one.
although I can't understand how this pluging call works...
so I added logging to my scripts, hope I'll find what is really happening.
:-)

Re: problem with unstable channel and client-disconnect

Posted: Mon Mar 14, 2011 8:34 pm
by Bebop
sles wrote:hmm, after looking into sources more deeply I found that openpvpn removes old sessions before creating new one.
although I can't understand how this pluging call works...
so I added logging to my scripts, hope I'll find what is really happening.
:-)
Excellent. Do share your findings when complete.