kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.77k stars 2.39k forks source link

Frequently restarting #343

Closed sajjadG closed 6 years ago

sajjadG commented 6 years ago

I have a setup according to the readme guide but all the clients with different platforms (mobile, PC, etc.) have reconnecting issue. After a while client disconnects and connects again.

Inactivity timeout (--ping-restart), restarting

Fri Dec 15 12:44:07 2017 OpenVPN 2.4.0 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 18 2017
Fri Dec 15 12:44:07 2017 library versions: OpenSSL 1.0.2l  25 May 2017, LZO 2.08
Fri Dec 15 12:44:07 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:44:07 2017 UDP link local: (not bound)
Fri Dec 15 12:44:07 2017 UDP link remote: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:44:08 2017 [my.vps.ip.addr] Peer Connection Initiated with [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:44:09 2017 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:1: block-outside-dns (2.4.0)
Fri Dec 15 12:44:09 2017 TUN/TAP device tun0 opened
Fri Dec 15 12:44:09 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Fri Dec 15 12:44:09 2017 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 15 12:44:09 2017 /sbin/ip addr add dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:44:09 2017 Initialization Sequence Completed
Fri Dec 15 12:46:12 2017 [my.vps.ip.addr] Inactivity timeout (--ping-restart), restarting
Fri Dec 15 12:46:12 2017 /sbin/ip addr del dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:46:12 2017 SIGUSR1[soft,ping-restart] received, process restarting
Fri Dec 15 12:46:17 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:46:17 2017 UDP link local: (not bound)
Fri Dec 15 12:46:17 2017 UDP link remote: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:46:17 2017 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1549', remote='link-mtu 1541'
Fri Dec 15 12:46:17 2017 WARNING: 'cipher' is used inconsistently, local='cipher AES-256-GCM', remote='cipher BF-CBC'
Fri Dec 15 12:46:17 2017 WARNING: 'auth' is used inconsistently, local='auth [null-digest]', remote='auth SHA1'
Fri Dec 15 12:46:17 2017 WARNING: 'keysize' is used inconsistently, local='keysize 256', remote='keysize 128'
Fri Dec 15 12:46:17 2017 [my.vps.ip.addr] Peer Connection Initiated with [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:46:19 2017 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:1: block-outside-dns (2.4.0)
Fri Dec 15 12:46:19 2017 TUN/TAP device tun0 opened
Fri Dec 15 12:46:19 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Fri Dec 15 12:46:19 2017 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 15 12:46:19 2017 /sbin/ip addr add dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:46:19 2017 Initialization Sequence Completed
Fri Dec 15 12:48:20 2017 [my.vps.ip.addr] Inactivity timeout (--ping-restart), restarting
Fri Dec 15 12:48:20 2017 /sbin/ip addr del dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:48:20 2017 SIGUSR1[soft,ping-restart] received, process restarting
Fri Dec 15 12:48:25 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:48:25 2017 UDP link local: (not bound)
Fri Dec 15 12:48:25 2017 UDP link remote: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:48:25 2017 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1549', remote='link-mtu 1541'
Fri Dec 15 12:48:25 2017 WARNING: 'cipher' is used inconsistently, local='cipher AES-256-GCM', remote='cipher BF-CBC'
Fri Dec 15 12:48:25 2017 WARNING: 'auth' is used inconsistently, local='auth [null-digest]', remote='auth SHA1'
Fri Dec 15 12:48:25 2017 WARNING: 'keysize' is used inconsistently, local='keysize 256', remote='keysize 128'
Fri Dec 15 12:48:25 2017 [my.vps.ip.addr] Peer Connection Initiated with [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:48:27 2017 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:1: block-outside-dns (2.4.0)
Fri Dec 15 12:48:27 2017 TUN/TAP device tun0 opened
Fri Dec 15 12:48:27 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Fri Dec 15 12:48:27 2017 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 15 12:48:27 2017 /sbin/ip addr add dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:48:27 2017 Initialization Sequence Completed
Fri Dec 15 12:50:30 2017 [my.vps.ip.addr] Inactivity timeout (--ping-restart), restarting
Fri Dec 15 12:50:30 2017 /sbin/ip addr del dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:50:30 2017 SIGUSR1[soft,ping-restart] received, process restarting
Fri Dec 15 12:50:35 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:50:35 2017 UDP link local: (not bound)
Fri Dec 15 12:50:35 2017 UDP link remote: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:50:36 2017 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1549', remote='link-mtu 1541'
Fri Dec 15 12:50:36 2017 WARNING: 'cipher' is used inconsistently, local='cipher AES-256-GCM', remote='cipher BF-CBC'
Fri Dec 15 12:50:36 2017 WARNING: 'auth' is used inconsistently, local='auth [null-digest]', remote='auth SHA1'
Fri Dec 15 12:50:36 2017 WARNING: 'keysize' is used inconsistently, local='keysize 256', remote='keysize 128'
Fri Dec 15 12:50:36 2017 [my.vps.ip.addr] Peer Connection Initiated with [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:50:38 2017 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:1: block-outside-dns (2.4.0)
Fri Dec 15 12:50:38 2017 TUN/TAP device tun0 opened
Fri Dec 15 12:50:38 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Fri Dec 15 12:50:38 2017 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 15 12:50:38 2017 /sbin/ip addr add dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:50:38 2017 Initialization Sequence Completed
Fri Dec 15 12:52:37 2017 [my.vps.ip.addr] Inactivity timeout (--ping-restart), restarting
Fri Dec 15 12:52:37 2017 /sbin/ip addr del dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:52:37 2017 SIGUSR1[soft,ping-restart] received, process restarting
Fri Dec 15 12:52:42 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:52:42 2017 UDP link local: (not bound)
Fri Dec 15 12:52:42 2017 UDP link remote: [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:52:43 2017 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1549', remote='link-mtu 1541'
Fri Dec 15 12:52:43 2017 WARNING: 'cipher' is used inconsistently, local='cipher AES-256-GCM', remote='cipher BF-CBC'
Fri Dec 15 12:52:43 2017 WARNING: 'auth' is used inconsistently, local='auth [null-digest]', remote='auth SHA1'
Fri Dec 15 12:52:43 2017 WARNING: 'keysize' is used inconsistently, local='keysize 256', remote='keysize 128'
Fri Dec 15 12:52:43 2017 [my.vps.ip.addr] Peer Connection Initiated with [AF_INET]my.vps.ip.addr:1194
Fri Dec 15 12:52:44 2017 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:1: block-outside-dns (2.4.0)
Fri Dec 15 12:52:44 2017 TUN/TAP device tun0 opened
Fri Dec 15 12:52:44 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Fri Dec 15 12:52:44 2017 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 15 12:52:44 2017 /sbin/ip addr add dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:52:44 2017 Initialization Sequence Completed
^CFri Dec 15 12:54:31 2017 event_wait : Interrupted system call (code=4)
Fri Dec 15 12:54:31 2017 /sbin/ip addr del dev tun0 local 192.168.255.6 peer 192.168.255.5
Fri Dec 15 12:54:31 2017 SIGINT[hard,] received, process exiting
estechnical commented 6 years ago

Fri Dec 15 12:52:43 2017 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1549', remote='link-mtu 1541' Fri Dec 15 12:52:43 2017 WARNING: 'cipher' is used inconsistently, local='cipher AES-256-GCM', remote='cipher BF-CBC' Fri Dec 15 12:52:43 2017 WARNING: 'auth' is used inconsistently, local='auth [null-digest]', remote='auth SHA1' Fri Dec 15 12:52:43 2017 WARNING: 'keysize' is used inconsistently, local='keysize 256', remote='keysize 128'

You should ensure that the server config and client config match for the settings mentioned in the warning.

Did you perhaps migrate old config into your client/server?

We see this "Inactivity timeout" for clients who eg shut down their laptop... Is this happening to a client who is not supposed to be disconnecting?

sajjadG commented 6 years ago

The problem was due to multiple system using the same config file in order to connect to the server. it seems the default settings doesn't allow multiple connection via the same user/config.