Hello fellows,
i am currently experiencing a strange behavior of either my VPS server or my iPhone.
I recently setup a new VPS and used this script to setup a OpenVPN server. The VPS runs a standard installation of debian 10 and, for testing purposes, no firewall is active.
I can connect effortlessly by uploading the config file to my ASUS DSL-AC68U router.
But i cannot connect to the VPN using my iPhone. The server does not recognize any incoming connections and the OpenVPN app is caught in an event(wait) loop.
However, what astonishes me is that i am in fact able to connect once i try to initiate a ssh (login attempt is enough) prior to connecting to the VPN itself. Of course both services on the same server:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
openvpn 654 nobody 6u IPv4 22381 0t0 UDP xx.xx.xx.xx:123
sshd 682 root 3u IPv4 22740 0t0 TCP *:22 (LISTEN)
Apps:
-OpenVPN for VPN
-WebSSH for SSH
When i reboot the phone, i always have to initiate the ssh connection (attempt) before connecting to the vpn. I also tried it on another iPhone. Same Problem.
I have no problem connecting to other VPN servers, neither by using PIAs native VPN app nor by using the same OpenVPN app with custom configs for e.g. my home server. So i guess my cellular provider is not blocking anything.
Any suggestions on this? Any help is appreciated!
Server config:
Client config:
UNsuccessful connection attempt using OpenVPN iOS app:
Successful connection attempt using OpenVPN iOS app after ssh login attempt using WebSSH iOS app:
Incoming connection to VPS after ssh login attempt:
i am currently experiencing a strange behavior of either my VPS server or my iPhone.
I recently setup a new VPS and used this script to setup a OpenVPN server. The VPS runs a standard installation of debian 10 and, for testing purposes, no firewall is active.
I can connect effortlessly by uploading the config file to my ASUS DSL-AC68U router.
But i cannot connect to the VPN using my iPhone. The server does not recognize any incoming connections and the OpenVPN app is caught in an event(wait) loop.
However, what astonishes me is that i am in fact able to connect once i try to initiate a ssh (login attempt is enough) prior to connecting to the VPN itself. Of course both services on the same server:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
openvpn 654 nobody 6u IPv4 22381 0t0 UDP xx.xx.xx.xx:123
sshd 682 root 3u IPv4 22740 0t0 TCP *:22 (LISTEN)
Apps:
-OpenVPN for VPN
-WebSSH for SSH
When i reboot the phone, i always have to initiate the ssh connection (attempt) before connecting to the vpn. I also tried it on another iPhone. Same Problem.
I have no problem connecting to other VPN servers, neither by using PIAs native VPN app nor by using the same OpenVPN app with custom configs for e.g. my home server. So i guess my cellular provider is not blocking anything.
Any suggestions on this? Any help is appreciated!
Server config:
Code:
local xx.xx.xx.xx (remote ip)
port 123
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS xx.xx.xx.xx"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
verb 3
crl-verify crl.pem
explicit-exit-notify
Client config:
Code:
client
dev tun
proto udp
remote xx.xx.xx.xx 123
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3
<ca>
-----BEGIN CERTIFICATE-----
xxx
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
xxx
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
xxx
-----END PRIVATE KEY-----
</key>
<tls-crypt>
-----BEGIN OpenVPN Static key V1-----
xxx
-----END OpenVPN Static key V1-----
</tls-crypt>
UNsuccessful connection attempt using OpenVPN iOS app:
Code:
2021-03-12 16:47:02 1
2021-03-12 16:47:02 ----- OpenVPN Start -----
OpenVPN core 3.git::58b92569 ios arm64 64-bit
2021-03-12 16:47:02 OpenVPN core 3.git::58b92569 ios arm64 64-bit
2021-03-12 16:47:02 Frame=512/2048/512 mssfix-ctrl=1250
2021-03-12 16:47:02 UNUSED OPTIONS
4 [resolv-retry] [infinite]
5 [nobind]
6 [persist-key]
7 [persist-tun]
11 [ignore-unknown-option] [block-outside-dns]
12 [block-outside-dns]
13 [verb] [3]
2021-03-12 16:47:02 EVENT: RESOLVE
2021-03-12 16:47:02 Contacting [xx.xx.xx.xx]:123/UDP via UDP
2021-03-12 16:47:02 EVENT: WAIT
2021-03-12 16:47:02 Connecting to [xxx.xxx.com]:123 (xx.xx.xx.xx) via UDPv4
2021-03-12 16:47:13 Server poll timeout, trying next remote entry...
2021-03-12 16:47:13 EVENT: RECONNECTING
2021-03-12 16:47:13 Contacting [xx.xx.xx.xx]:123/UDP via UDP
2021-03-12 16:47:13 EVENT: WAIT
2021-03-12 16:47:13 Connecting to [xx.xxx.com]:123 (xx.xx.xx.xx) via UDPv4
Successful connection attempt using OpenVPN iOS app after ssh login attempt using WebSSH iOS app:
Code:
2021-03-12 16:45:40 ----- OpenVPN Start -----
OpenVPN core 3.git::58b92569 ios arm64 64-bit
2021-03-12 16:45:40 OpenVPN core 3.git::58b92569 ios arm64 64-bit
2021-03-12 16:45:40 Frame=512/2048/512 mssfix-ctrl=1250
2021-03-12 16:45:40 UNUSED OPTIONS
4 [resolv-retry] [infinite]
5 [nobind]
6 [persist-key]
7 [persist-tun]
11 [ignore-unknown-option] [block-outside-dns]
12 [block-outside-dns]
13 [verb] [3]
2021-03-12 16:45:40 EVENT: RESOLVE
2021-03-12 16:45:40 Contacting [xx.xx.xx.xx]:123/UDP via UDP
2021-03-12 16:45:40 EVENT: WAIT
2021-03-12 16:45:40 Connecting to [xxxx.xxxx.com]:123 (xx.xx.xx.xx) via UDPv4
2021-03-12 16:45:41 EVENT: CONNECTING
2021-03-12 16:45:41 Tunnel Options:V4,dev-type tun,link-mtu 1601,tun-mtu 1500,proto UDPv4,cipher AES-256-CBC,auth SHA512,keysize 256,key-method 2,tls-client
2021-03-12 16:45:41 Creds: UsernameEmpty/PasswordEmpty
2021-03-12 16:45:41 Peer Info:
IV_VER=3.git::58b92569
IV_PLAT=ios
IV_NCP=2
IV_TCPNL=1
IV_PROTO=2
IV_IPv6=0
IV_AUTO_SESS=1
IV_GUI_VER=net.openvpn.connect.ios_3.2.3-3760
IV_SSO=openurl
2021-03-12 16:45:41 VERIFY OK: depth=1, /CN=ChangeMe
2021-03-12 16:45:41 VERIFY OK: depth=0, /CN=server
2021-03-12 16:45:41 SSL Handshake: CN=server, TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
2021-03-12 16:45:41 Session is ACTIVE
2021-03-12 16:45:41 EVENT: GET_CONFIG
2021-03-12 16:45:41 Sending PUSH_REQUEST to server...
2021-03-12 16:45:41 OPTIONS:
0 [redirect-gateway] [def1] [bypass-dhcp]
1 [dhcp-option] [DNS] [xx.xx.xx.xx]
2 [route-gateway] [10.8.0.1]
3 [topology] [subnet]
4 [ping] [10]
5 [ping-restart] [120]
6 [ifconfig] [10.8.0.2] [255.255.255.0]
7 [peer-id] [1]
8 [cipher] [AES-256-GCM]
9 [block-ipv6]
2021-03-12 16:45:41 PROTOCOL OPTIONS:
cipher: AES-256-GCM
digest: NONE
compress: NONE
peer ID: 1
2021-03-12 16:45:41 EVENT: ASSIGN_IP
2021-03-12 16:45:41 NIP: preparing TUN network settings
2021-03-12 16:45:41 NIP: init TUN network settings with endpoint: xx.xx.xx.xx
2021-03-12 16:45:41 NIP: adding IPv4 address to network settings 10.8.0.2/255.255.255.0
2021-03-12 16:45:41 NIP: adding (included) IPv4 route 10.8.0.0/24
2021-03-12 16:45:41 NIP: redirecting all IPv4 traffic to TUN interface
2021-03-12 16:45:41 NIP: adding DNS xx.xx.xx.xx
2021-03-12 16:45:41 NIP: blocking all IPv6 traffic
2021-03-12 16:45:41 Connected via NetworkExtensionTUN
2021-03-12 16:45:41 EVENT: CONNECTED xxx.xxx.com:123 (xx.xx.xx.xx) via /UDPv4 on NetworkExtensionTUN/10.8.0.2/ gw=[/]
2021-03-12 16:45:43 EVENT: DISCONNECTED
2021-03-12 16:45:43 Raw stats on disconnect:
BYTES_IN : 3619
BYTES_OUT : 3942
PACKETS_IN : 11
PACKETS_OUT : 17
TUN_BYTES_IN : 300
TUN_PACKETS_IN : 5
2021-03-12 16:45:43 Performance stats on disconnect:
CPU usage (microseconds): 69208
Tunnel compression ratio (downlink): inf
Network bytes per CPU second: 109250
Tunnel bytes per CPU second: 4334
Incoming connection to VPS after ssh login attempt:
Code:
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 TLS: Initial packet from [AF_INET]xx.xxx.xxx.xx:24917, sid=c375a3cd 9eccbdd1
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 VERIFY OK: depth=1, CN=ChangeMe
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 VERIFY OK: depth=0, CN=r
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_VER=3.git::58b92569
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_PLAT=ios
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_NCP=2
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_TCPNL=1
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_PROTO=2
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_IPv6=0
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_AUTO_SESS=1
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_GUI_VER=net.openvpn.connect.ios_3.2.3-3760
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 peer info: IV_SSO=openurl
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
Mar 12 16:41:01 server openvpn[654]: xx.xxx.xxx.xx:24917 [r] Peer Connection Initiated with [AF_INET]xx.xxx.xxx.xx:24917
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 MULTI_sva: pool returned IPv4=10.8.0.2, IPv6=(Not enabled)
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 MULTI: Learn: 10.8.0.2 -> r/xx.xxx.xxx.xx:24917
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 MULTI: primary virtual IP for r/xx.xxx.xxx.xx:24917: 10.8.0.2
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 PUSH: Received control message: 'PUSH_REQUEST'
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 SENT CONTROL [r]: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS xx.xxx.xx.xx,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 120,ifconfig 10.8.0.2 255.255.255.0,peer-id 1,cipher AES-256-GCM' (status=1)
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 Data Channel: using negotiated cipher 'AES-256-GCM'
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Mar 12 16:41:01 server openvpn[654]: r/xx.xxx.xxx.xx:24917 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Mar 12 16:41:04 server openvpn[654]: r/xx.xxx.xxx.xx:24917 SIGTERM[soft,remote-exit] received, client-instance exiting