Hello,
I have ISP modem NETIS EP8101G which is a back-box for me. It's connected to TP-Link TL-WR1043N/ND v1 with LEDE Reboot 17.01.4 r3560-79f57e422d / LuCI lede-17.01 branch (git-17.290.79498-d3f0685).
On router
Gateway: 172.16.20.1
LAN: IPv4: 192.168.7.1/24
On router I installed OpenVPN by this guide:
https://openwrt.org/docs/guide-user/services/vpn/openvpn/server.setup
I'm using
http://freedns.afraid.org/.
Looks like on server side it's working, but when I'm trying to connect from Android phone via cellular network it stacks at "waiting for server" and than fails after timeout (10 sec).
config openvpn 'vpnserver'
option enabled '1'
option dev_type 'tun'
option dev 'ovpns0'
option port '1194'
option topology 'subnet'
option tls_server '1'
option mode 'server'
option server '192.168.200.0 255.255.255.0'
option route_gateway 'dhcp'
option compress 'lz4'
option keepalive '10 120'
option persist_key '1'
option persist_tun '1'
option ca '/etc/openvpn/ca.crt'
option cert '/etc/openvpn/my-server.crt'
option key '/etc/openvpn/my-server.key'
option dh '/etc/openvpn/dh2048.pem'
option tls_auth '/etc/openvpn/tls-auth.key 0'
option log '/tmp/openvpn.log'
list push 'topology subnet'
list push 'redirect-gateway def1'
list push 'route-gateway dhcp'
list push 'route 192.168.200.0 255.255.255.0'
list push 'dhcp-option DNS 192.168.7.1'
list push 'compress lz4'
list push 'persist-key'
list push 'persist-tun'
option proto 'tcp'
client
dev tun
proto udp
fast-io
remote xXx.mooo.com 1194
remote-cert-tls server
nobind
persist-key
persist-tun
compress lz4
verb 5
key-direction 1
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4097 (0x1001)
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=GB, ST=London, O=WWW Ltd.
Validity
Not Before: Jul 18 20:08:06 2018 GMT
Not After : Jul 15 20:08:06 2028 GMT
Subject: CN=my-client
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (4096 bit)
Modulus:
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Key Usage:
Digital Signature
X509v3 Extended Key Usage:
TLS Web Client Authentication
Signature Algorithm: sha256WithRSAEncryption
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-auth>
Log from Android:
- 10:24:14.245 -- ----- OpenVPN Start -----
10:24:14.246 -- EVENT: CORE_THREAD_ACTIVE
10:24:14.253 -- Frame=512/2048/512 mssfix-ctrl=1250
10:24:14.265 -- UNUSED OPTIONS
3 [fast-io]
6 [nobind]
7 [persist-key]
8 [persist-tun]
10 [verb] [7]
10:24:14.266 -- EVENT: RESOLVE
10:24:14.274 -- Contacting @.@.@.@:1194 via TCP
10:24:14.274 -- EVENT: WAIT
10:24:24.278 -- Server poll timeout, trying next remote entry...
10:24:24.305 -- EVENT: RECONNECTING
10:24:24.312 -- EVENT: RESOLVE
10:24:24.334 -- EVENT: CONNECTION_TIMEOUT
10:24:24.339 -- EVENT: DISCONNECTED
10:24:24.355 -- EVENT: CORE_THREAD_INACTIVE
10:24:24.357 -- Tunnel bytes per CPU second: 0
10:24:24.359 -- ----- OpenVPN Stop -----
Log from server:
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(bap80)[5411]: OpenVPN 2.4.4 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(sample_server)[5410]: OpenVPN 2.4.4 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(bap80)[5411]: library versions: OpenSSL 1.0.2o 27 Mar 2018, LZO 2.10
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(bap80)[5411]: Diffie-Hellman initialized with 2048 bit key
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(sample_server)[5410]: library versions: OpenSSL 1.0.2o 27 Mar 2018, LZO 2.10
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(sample_server)[5410]: Diffie-Hellman initialized with 2048 bit key
Fri Jul 20 11:47:30 2018 daemon.err openvpn(bap80)[5411]: OpenSSL: error:02001002:lib(2):func(1):reason(2)
Fri Jul 20 11:47:30 2018 daemon.err openvpn(bap80)[5411]: OpenSSL: error:2006D080:lib(32):func(109):reason(128)
Fri Jul 20 11:47:30 2018 daemon.err openvpn(bap80)[5411]: OpenSSL: error:140AD002:lib(20):func(173):reason(2)
Fri Jul 20 11:47:30 2018 daemon.err openvpn(sample_server)[5410]: OpenSSL: error:02001002:lib(2):func(1):reason(2)
Fri Jul 20 11:47:30 2018 daemon.err openvpn(bap80)[5411]: Cannot load certificate file /etc/openvpn/server.crt
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(bap80)[5411]: Exiting due to fatal error
Fri Jul 20 11:47:30 2018 daemon.err openvpn(sample_server)[5410]: OpenSSL: error:2006D080:lib(32):func(109):reason(128)
Fri Jul 20 11:47:30 2018 daemon.err openvpn(sample_server)[5410]: OpenSSL: error:140AD002:lib(20):func(173):reason(2)
Fri Jul 20 11:47:30 2018 daemon.err openvpn(sample_server)[5410]: Cannot load certificate file /etc/openvpn/server.crt
Fri Jul 20 11:47:30 2018 daemon.notice openvpn(sample_server)[5410]: Exiting due to fatal error
Fri Jul 20 11:47:32 2018 daemon.err openvpn(custom_config)[5412]: Options error: In [CMD-LINE]:1: Error opening configuration file: openvpn-custom_config.conf
Fri Jul 20 11:47:32 2018 daemon.warn openvpn(custom_config)[5412]: Use --help for more information.
Fri Jul 20 11:47:33 2018 daemon.notice openvpn(sample_client)[5413]: OpenVPN 2.4.4 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
Fri Jul 20 11:47:33 2018 daemon.notice openvpn(sample_client)[5413]: library versions: OpenSSL 1.0.2o 27 Mar 2018, LZO 2.10
Fri Jul 20 11:47:33 2018 daemon.warn openvpn(sample_client)[5413]: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Fri Jul 20 11:47:33 2018 daemon.err openvpn(sample_client)[5413]: OpenSSL: error:02001002:lib(2):func(1):reason(2)
Fri Jul 20 11:47:33 2018 daemon.err openvpn(sample_client)[5413]: OpenSSL: error:2006D080:lib(32):func(109):reason(128)
Fri Jul 20 11:47:33 2018 daemon.err openvpn(sample_client)[5413]: OpenSSL: error:140AD002:lib(20):func(173):reason(2)
Fri Jul 20 11:47:33 2018 daemon.err openvpn(sample_client)[5413]: Cannot load certificate file /etc/openvpn/client.crt
Fri Jul 20 11:47:33 2018 daemon.notice openvpn(sample_client)[5413]: Exiting due to fatal error