Page 1 of 1

Unable to Connect on Home Wifi

Posted: Fri Oct 08, 2021 10:47 am
by RehanSaeed
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.

Code: Select all

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:

Code: Select all

[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.

Code: Select all

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:

Code: Select all

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"

Re: Unable to Connect on Home Wifi

Posted: Fri Oct 08, 2021 1:15 pm
by TinCanTech
Try using the LAN IP of the server for --remote, not the WAN IP.

Re: Unable to Connect on Home Wifi

Posted: Fri Oct 08, 2021 2:12 pm
by RehanSaeed
You mean by changing my client configuration to this? Then I won't be able to connect outside my WiFi network.

Code: Select all

remote 192.168.1.1 12973

Re: Unable to Connect on Home Wifi

Posted: Fri Oct 08, 2021 3:02 pm
by TinCanTech
Then change it to your WAN IP when you go out.

Re: Unable to Connect on Home Wifi

Posted: Fri Oct 08, 2021 8:01 pm
by RehanSaeed
I want one connection that is always connected whether I'm on my home WiFi or any other network so I don't have to keep turning it on/off.

Re: Unable to Connect on Home Wifi

Posted: Fri Oct 08, 2021 8:31 pm
by TinCanTech
Have two unique profiles.

Re: Unable to Connect on Home Wifi

Posted: Mon Oct 25, 2021 10:42 am
by RehanSaeed
Will the autolocal setting help do what I want?

Re: Unable to Connect on Home Wifi

Posted: Sun Feb 20, 2022 10:49 pm
by injured
@RehanSaeed
Have you solved your problem? Because I need it too.