I have an Open VPN server setup on my Netgear Wifi Router and am able to connect to it successfully from my phone over a mobile network but when I'm on the home wifi, the Open VPN client is unable to connect. How can I get the client to connect on Wifi and mobile networks?
Below is my ovpn configuration file.
client
dev tun
proto udp
sndbuf 393216
rcvbuf 393216
push "sndbuf 393216"
push "rcvbuf 393216"
remote example.mynetgear.com 12973
resolv-retry infinite
nobind
persist-key
persist-tun
cipher AES-128-CBC
comp-lzo yes
verb 0
<ca>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
</key>
From my Netgear router I get the following in the logs:
[OpenVPN, connection fail] from reomote IP address:192.168.1.12 Friday, Oct 08,2021 11:45:33
I have heard about the autolocal setting, so I tried adding the following variations to my client configuration above but couldn't get it to work.
redirect-gateway autolocal
redirect-gateway autolocal def1
redirect-gateway autolocal def1 bypass-dhcp
I also think I discovered that the Open VPN server configuration where I note that autolocal has not been added:
dh /tmp/openvpn_run/dh1024.pem
ca /tmp/openvpn_run/ca.crt
cert /tmp/openvpn_run/server.crt
key /tmp/openvpn_run/server.key
dev tun
server 192.168.254.0 255.255.255.0
proto udp
port 12973
keepalive 10 120
sndbuf 393216
rcvbuf 393216
push "sndbuf 393216"
push "rcvbuf 393216"
verb 0
mute 5
log-append /tmp/openvpn_log_tun
status /tmp/openvpn-status_tun.log
writepid /tmp/openvpnd_tun.pid
mtu-disc yes
topology subnet
script-security 2
cipher AES-128-CBC
auth sha1
tls-server
client-to-client
duplicate-cn
comp-lzo
fast-io
push "route 192.168.1.0 255.255.255.0"
push "redirect-gateway"
push "dhcp-option DNS 192.168.254.1"