[deleted]
Hi
After a lot of googling and forum searching and trying and failing, any help would be really appreciated!
My VPN is up and running nicely - my Android phone connects to my OpenVpn server. But I can't get my Android client to see shares on the machine running OpenVpn. I had this setup working with FreeNAS, but now on Ubuntu 16.04 I can't figure out what I have done wrong. Hopefully the following info is helpful for troubleshooting. Any insights very much appreciated.
Setup
Android client ------------------------ modem/router ---------------------------- server
10.8.0.4------------------xxx.xxx.xxx.xxx / 172.19.14.254---------------172.19.14.114 / 10.8.0.1
port 443
proto tcp
dev tun
ca ...
cert ...
key ...
dh dhparam4096.pem
auth-nocache
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 172.19.14.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
keepalive 10 120
tls-auth ta.key 0
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status-443.log
client
dev tun
proto tcp
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca ...
cert ...
key ...
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-CBC
auth SHA256...
connection log
20:54:25.007 -- ----- OpenVPN Start -----
20:54:25.010 -- EVENT: CORE_THREAD_ACTIVE
20:54:25.064 -- Frame=512/2048/512 mssfix-ctrl=1250
20:54:25.065 -- UNUSED OPTIONS
4 [resolv-retry] [infinite]
5 [nobind]
6 [user] [nobody]
7 [group] [nogroup]
8 [persist-key]
9 [persist-tun]
18 [verb] [3]
19 [mute] [20]
20:54:25.066 -- EVENT: RESOLVE
20:54:25.074 -- Contacting xxx.xxx.xxx.xxx:443 via TCP
20:54:25.075 -- EVENT: WAIT
20:54:26.038 -- Connecting to [xxx.xxx.xxx.xxx]:443 (xxx.xxx.xxx.xxx) via TCPv4
20:54:26.053 -- EVENT: CONNECTING
20:54:26.071 -- Tunnel Options:V4,dev-type tun,link-mtu 1571,tun-mtu 1500,proto TCPv4_CLIENT,keydir 1,cipher AES-256-CBC,auth SHA256,keysize 256,tls-auth,key-method 2,tls-client
20:54:26.072 -- Creds: UsernameEmpty/PasswordEmpty
20:54:26.073 -- Peer Info:
IV_GUI_VER=OC30Android
IV_VER=3.2
IV_PLAT=android
IV_NCP=2
IV_TCPNL=1
IV_PROTO=2
IV_AUTO_SESS=1
20:54:26.176 -- VERIFY OK : depth=x
cert. version :
serial number :
issuer name :
subject name :
issued on :
expires on :
signed using :
RSA key size :
basic constraints :
cert. type :
key usage :
ext key usage :
20:54:28.266 -- SSL Handshake: TLSv1.2/TLS-DHE-RSA-WITH-AES-256-GCM-SHA384
20:54:28.267 -- Session is ACTIVE
20:54:28.269 -- EVENT: GET_CONFIG
20:54:28.282 -- Sending PUSH_REQUEST to server...
20:54:28.306 -- OPTIONS:
0 [route] [172.19.14.0] [255.255.255.0]
1 [redirect-gateway] [def1] [bypass-dhcp]
2 [dhcp-option] [DNS] [208.67.222.222]
3 [dhcp-option] [DNS] [208.67.220.220]
4 [route-gateway] [10.8.0.1]
5 [topology] [subnet]
6 [ping] [10]
7 [ping-restart] [120]
8 [ifconfig] [10.8.0.4] [255.255.255.0]
20:54:28.308 -- PROTOCOL OPTIONS:
cipher: AES-256-CBC
digest: SHA256
compress: NONE
peer ID: -1
20:54:28.313 -- EVENT: ASSIGN_IP
20:54:28.391 -- Connected via tun
20:54:28.391 -- EVENT: CONNECTED info='@xxx.xxx.xxx.xxx:443 (xxx.xxx.xxx.xxx) via /TCPv4 on tun/10.8.0.4/ gw=[10.8.0.1/]' trans=TO_CONNECTED
Status: active
Logging: on (medium)
Default: deny (incoming), allow (outgoing), allow (routed)
New profiles: skip
To--------------------------Action----------From
443/tcp on tun0-------------ALLOW IN-----Anywhere
443/tcp on enp1s0----------ALLOW IN-----Anywhere
111------------------------ALLOW IN------10.8.0.4
2049-----------------------ALLOW IN------10.8.0.4
34876---------------------ALLOW IN------10.8.0.4
I added the tun0 and enp1s0 rules using:
user@exterior:$ sudo iptables -I FORWARD -i tun0 -o enp1s0 -s 10.8.0.0/24 -d 172.19.14.0/24 -m conntrack --ctstate NEW -j ACCEPT
user@exterior:$ sudo iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
I have just got to this point and it occurs to me that perhaps my Android is trying to connect via SMB and I've only got my NFS ports open. Against that, I did drop my firewall as a test and still didn't get a connection, so I suspect the fault is not here. What was a bit unusual was that the Android usually takes ages of 'waiting circle going round' before it says 'network connection problem' , but with the firewall down that error came back immediately. Don't know what to make of that.
Network destination 10.8.0.0
Subnet mask 255.255.255.0
Gateway 172.19.14.114
Interface LAN
Port forwarding on ModemRouter
443 to 172.19.14.114 443 TCP
/etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/media/music 10.8.0.0/29(rw,sync,no_subtree_check)
/etc/sysctl
net.ipv4.ip_forward=1
user@exterior:$ ping 10.8.0.4
64 bytes from 10.8.0.4: icmp_seq=31 ttl=64 time=3.82 ms
^C
--- 10.8.0.4 ping statistics ---
31 packets transmitted, 31 received, 0% packet loss, time 30058ms
rtt min/avg/max/mdev = 3.795/257.529/1603.545/365.090 ms, pipe 2
Phone IP address]
whatismyip shows local as 10.8.0.4
Android solidexplorer config
remote host 10.8.0.1
Port number 443
Path /media/music
user@exterior:$ ifconfig
enp1s0 Link encap:Ethernet HWaddr nn:nn:nn:nn:nn:nn
inet addr:172.19.14.114 Bcast:172.19.14.255 Mask:255.255.255.0
inet6 addr: nnnn::nnnn:nnnn:nnnn:nnnn/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27182134 errors:0 dropped:0 overruns:0 frame:0
TX packets:19728012 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:33520685906 (33.5 GB) TX bytes:2441947880 (2.4 GB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2412 errors:0 dropped:0 overruns:0 frame:0
TX packets:2412 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:147456 (147.4 KB) TX bytes:147456 (147.4 KB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.1 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:12398 errors:0 dropped:0 overruns:0 frame:0
TX packets:13813 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1391348 (1.3 MB) TX bytes:9379693 (9.3 MB)
uname -a
Linux exterior 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Again, many thanks for any help / advice.
Paul