TommyLau / docker-ocserv

Docker OpenConnect VPN Server
352 stars 245 forks source link

Reconnecting appear every 4 minutes #17

Closed dapao9999 closed 2 years ago

dapao9999 commented 7 years ago

2016-11-24_224942 Reconnecting every 4 minutes as described in the image

TommyLau commented 7 years ago

It seems to be a problem(or designed to?) of ocserv.

This is just a Docker container of ocserv, it cannot solve the program issue running in Docker.

I will keep this open for awhile, and check whether the issue is related to Docker.

TheNomad11 commented 7 years ago

I observed the same issue. Now I installed a non-docker version of ocserv and the issue disappeared. The reconnecting issue might be related to Docker then

TommyLau commented 7 years ago

@TheNomad11 Thank you for your information. And it reminds me that mine got the same issues, the client will reconnect in a few minutes too. And before we know anything further, it might as you said it could be related to Docker itself.

fxpester commented 7 years ago

image

hit this just now, running on google cloud on ubuntu 16.04

fxpester commented 7 years ago

funny part, I used this - https://github.com/evshiron/docker-ocserv - and everything working ok, no reconnects

TommyLau commented 6 years ago

It seems that image is using Fedora as the base image, could it be the problem of the Linux system? Looking into it, thanks again for your information.

TommyLau commented 6 years ago

Are you using AnyConnect as the client, or you are just using OpenConnect as the client? I saw that Dockerfile had disabled Cisco compatibility in the config file.

fxpester commented 6 years ago

ok, new attempt to use your solution: docker run --name ocserv --privileged -p 443:443 -p 443:443/udp -d tommylau/ocserv

docker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd -d test
docker exec -ti ocserv ocpasswd -c /etc/ocserv/ocpasswd -g "Route,All" tommy
fxpester commented 6 years ago

looks like problem in chinese character in group description, for now fixed it by editing ./ocserv.conf remove 'Route' group and set group 'All' as default

TommyLau commented 6 years ago

@s7lx Do you have time to look into this issue? I'm not using the group function, and I setup ocserv.conf file separately.

fxpester commented 6 years ago

I guess it is cause I don`t have chinese lang support in my win10, and cisco anyconnect works ok for first connect, then it tries to cache group description, but fails to read cache afterwards. So first connect is ok, but all next fail.

TommyLau commented 6 years ago

Have you ever removed the Chinese characters and have another try? Whether it works correctly or not?

fxpester commented 6 years ago

yes, I removed them, cleared anyconnect cache, and now I can connect to both groups

long1215 commented 6 years ago

最新版本还是每4分钟重新连接

TommyLau commented 6 years ago

@long1215 Yup, looks like a program with Docker or maybe something else, which I have no clue at all.

itshaadi commented 6 years ago

I have the same problem openconnect keeps saying:

SSL read error: The TLS connection was non-properly terminated.; reconnecting.

it is worth mentioning that this error occurs on a TCP based connection. also UDP packets are unable to reach the server. (I'm guessing that my ISP is responsible for that)

DTLS handshake failed: Error in the push function.
(Is a firewall preventing you from sending UDP packets?)
TommyLau commented 6 years ago

@itshaadi Are you using UDP? Have you ever tried to use TCP protocol?

itshaadi commented 6 years ago

UDP is completely blocked in iran. I am using 443/TCP at the moment. and this problem occurs on TCP.

TommyLau commented 6 years ago

I cannot reproduce this issue, only the reconnect occurs to me, could it be the low level network issue from your Internet provider?

itshaadi commented 6 years ago

DTLS handshake failed: Error in the push function. is indeed a low level network issue from my ISP. as I said UDP ports are completely unreachable. however reconnect error could be an issue related to Docker. or your configuration for ocserv.

chunlaw commented 5 years ago

Quick fix: set the isolate-worker in the .conf file to false

My colleague @jonathan-tan has found that it is the problem of the kernel function seccomp_init() and seccomp_rule_add() in the function disable_system_calls in the source code. You can see if you change the auth-timeout in the .conf file from 240 to 10, the reconnecting behaviour occurs every 10 seconds.

Edited: As it is the system function, it is related to Alpine Linux (the docker base image) has overriden alarm() to setitimer() and hence causing the misbehaviour.