Hi Joe,

On 10/03/17 17:47, Joe Patterson wrote:
> I'm pretty sure that the answer to this is probably "no", but I'm 
> gonna ask anyhow...
>
> For clients connecting without auth-user-pass, I get a CLIENT 
> notification for ESTABLISHED, but none for DISCONNECT. Is there a way 
> to make openvpn send DISCONNECT messages on the management interface 
> even if the client didn't authenticate with a username/password?
>
> The management app I'm writing is managing multiple openvpn instances 
> and it's fine for the ones that use username/password (because I get a 
> CLIENT notification for CONNECT, ESTABLISHED, DISCONNECT, and others), 
> but when it's managing one that doesn't use usernames/passwords, it 
> only gets ESTABLISHED and never knows when a client disconnects.
>
> So far, the only solutions that I can think of are:
> A) have a separate client-connect script that uses some sort of 
> messaging to inform my main app that something's disconnected.  That 
> seems really ugly, but might work.
> B) periodically poll for 'status' and note which clients aren't there 
> anymore.  That means I have to balance how long I'm OK with stale 
> clients versus how often I poll status.
> C) configure my password-less clients with a static username/password 
> (via the [up] file argument to --auth-user-pass) that I then ignore.  
> This is probably the best option, I just don't like it, and wanted to 
> find out if there was something simple I was overlooking.  :)
>
>

most likely you are using "proto udp": when a client disconnects, no 
message is sent to the server by default. In order to have a client 
explicitly send a 'log off' message, add
   explicit-exit-notify 3
to the client config and reconnect. When a client now disconnects, the 
"client-disconnect" script is triggered. It is not related to the 
auth-user-pass option.
Does that work for you?

HTH,

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Reply via email to