OpenVPN connection does not always work for some clients
Posted: Sun Jan 16, 2011 4:46 pm
I run three OpenVPN servers on two ISP's. Two of them, which are on the same Internet connection, always accept connections from all clients. But the third one, which is on a different ISP, sometimes won't let certain clients connect all the time, even though its Internet connection is by far the fastest (10+ Mbps). It is not reliable -- sometimes a problematic client can connect but sometimes that same client cannot connect. I've been trying to find the cause for months but have not been able to.
I have set the logging level on both client and server to 6 as suggested.
I found that using the 'float' option in the client's config file helped, even though the public IP address of the server never changes even though it is technically dynamic.
Here's part of the sanitized log file from the problematic client, where you can see many RESETS at the end:
Sun Jan 16 07:28:30 2011 us=248535 remote_float = ENABLED
Sun Jan 16 07:28:30 2011 us=248569 ipchange = '[UNDEF]'
Sun Jan 16 07:28:30 2011 us=248602 bind_defined = DISABLED
Sun Jan 16 07:28:30 2011 us=248634 NOTE: --mute triggered...
Sun Jan 16 07:28:30 2011 us=248677 185 variation(s) on previous 20 message(s) suppressed by --mute
Sun Jan 16 07:28:30 2011 us=248716 OpenVPN 2.1_rc7 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] built on Dec 15 2010
Sun Jan 16 07:28:30 2011 us=248826 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Sun Jan 16 07:28:30 2011 us=249727 WARNING: file '/etc/openvpn/keys/client.key' is group or others accessible
Sun Jan 16 07:28:30 2011 us=250876 /usr/bin/openssl-vulnkey -q -b 1024 -m <modulus omitted>
Sun Jan 16 07:28:30 2011 us=516230 LZO compression initialized
Sun Jan 16 07:28:30 2011 us=516498 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Jan 16 07:28:30 2011 us=516645 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Jan 16 07:28:30 2011 us=516723 Local Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-client'
Sun Jan 16 07:28:30 2011 us=516757 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-server'
Sun Jan 16 07:28:30 2011 us=516830 Local Options hash (VER=V4): '41690919'
Sun Jan 16 07:28:30 2011 us=516883 Expected Remote Options hash (VER=V4): '530fdded'
Sun Jan 16 07:28:30 2011 us=517486 Socket Buffers: R=[110592->131072] S=[110592->131072]
Sun Jan 16 07:28:30 2011 us=517630 UDPv4 link local: [undef]
Sun Jan 16 07:28:30 2011 us=517714 UDPv4 link remote: 24.a.b.c:1194
Sun Jan 16 07:28:30 2011 us=518023 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:32 2011 us=618507 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:34 2011 us=716026 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:36 2011 us=816061 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:38 2011 us=915985 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:41 2011 us=16156 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:43 2011 us=216147 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:45 2011 us=415991 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
..................
Here's a sanitized version of client.conf:
client
dev tun
proto udp
float
remote 24.a.b.c 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/client.crt
key /etc/openvpn/keys/client.key
comp-lzo
logfile foo.log
verb 6
mute 20
....................
I considered trying TCP, but the posts said it's a bad idea.
What should I do ?
Thank yoiu.
-- NewtownGal
I have set the logging level on both client and server to 6 as suggested.
I found that using the 'float' option in the client's config file helped, even though the public IP address of the server never changes even though it is technically dynamic.
Here's part of the sanitized log file from the problematic client, where you can see many RESETS at the end:
Sun Jan 16 07:28:30 2011 us=248535 remote_float = ENABLED
Sun Jan 16 07:28:30 2011 us=248569 ipchange = '[UNDEF]'
Sun Jan 16 07:28:30 2011 us=248602 bind_defined = DISABLED
Sun Jan 16 07:28:30 2011 us=248634 NOTE: --mute triggered...
Sun Jan 16 07:28:30 2011 us=248677 185 variation(s) on previous 20 message(s) suppressed by --mute
Sun Jan 16 07:28:30 2011 us=248716 OpenVPN 2.1_rc7 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] built on Dec 15 2010
Sun Jan 16 07:28:30 2011 us=248826 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Sun Jan 16 07:28:30 2011 us=249727 WARNING: file '/etc/openvpn/keys/client.key' is group or others accessible
Sun Jan 16 07:28:30 2011 us=250876 /usr/bin/openssl-vulnkey -q -b 1024 -m <modulus omitted>
Sun Jan 16 07:28:30 2011 us=516230 LZO compression initialized
Sun Jan 16 07:28:30 2011 us=516498 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Jan 16 07:28:30 2011 us=516645 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Jan 16 07:28:30 2011 us=516723 Local Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-client'
Sun Jan 16 07:28:30 2011 us=516757 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-server'
Sun Jan 16 07:28:30 2011 us=516830 Local Options hash (VER=V4): '41690919'
Sun Jan 16 07:28:30 2011 us=516883 Expected Remote Options hash (VER=V4): '530fdded'
Sun Jan 16 07:28:30 2011 us=517486 Socket Buffers: R=[110592->131072] S=[110592->131072]
Sun Jan 16 07:28:30 2011 us=517630 UDPv4 link local: [undef]
Sun Jan 16 07:28:30 2011 us=517714 UDPv4 link remote: 24.a.b.c:1194
Sun Jan 16 07:28:30 2011 us=518023 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:32 2011 us=618507 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:34 2011 us=716026 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:36 2011 us=816061 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:38 2011 us=915985 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:41 2011 us=16156 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:43 2011 us=216147 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
Sun Jan 16 07:28:45 2011 us=415991 UDPv4 WRITE [14] to 24.a.b.c:1194: P_CONTROL_HARD_RESET_CLIENT_V2 kid=0 [ ] pid=0 DATA len=0
..................
Here's a sanitized version of client.conf:
client
dev tun
proto udp
float
remote 24.a.b.c 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/client.crt
key /etc/openvpn/keys/client.key
comp-lzo
logfile foo.log
verb 6
mute 20
....................
I considered trying TCP, but the posts said it's a bad idea.
What should I do ?
Thank yoiu.
-- NewtownGal