Unable to Connect on Home Wifi

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
RehanSaeed
OpenVpn Newbie
Posts: 4
Joined: Fri Oct 08, 2021 10:29 am

Unable to Connect on Home Wifi

Post by RehanSaeed » Fri Oct 08, 2021 10:47 am

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"

User avatar
TinCanTech
Forum Team
Posts: 9975
Joined: Fri Jun 03, 2016 1:17 pm

Re: Unable to Connect on Home Wifi

Post by TinCanTech » Fri Oct 08, 2021 1:15 pm

Try using the LAN IP of the server for --remote, not the WAN IP.

RehanSaeed
OpenVpn Newbie
Posts: 4
Joined: Fri Oct 08, 2021 10:29 am

Re: Unable to Connect on Home Wifi

Post by RehanSaeed » Fri Oct 08, 2021 2:12 pm

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

User avatar
TinCanTech
Forum Team
Posts: 9975
Joined: Fri Jun 03, 2016 1:17 pm

Re: Unable to Connect on Home Wifi

Post by TinCanTech » Fri Oct 08, 2021 3:02 pm

Then change it to your WAN IP when you go out.

RehanSaeed
OpenVpn Newbie
Posts: 4
Joined: Fri Oct 08, 2021 10:29 am

Re: Unable to Connect on Home Wifi

Post by RehanSaeed » Fri Oct 08, 2021 8:01 pm

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.

User avatar
TinCanTech
Forum Team
Posts: 9975
Joined: Fri Jun 03, 2016 1:17 pm

Re: Unable to Connect on Home Wifi

Post by TinCanTech » Fri Oct 08, 2021 8:31 pm

Have two unique profiles.

RehanSaeed
OpenVpn Newbie
Posts: 4
Joined: Fri Oct 08, 2021 10:29 am

Re: Unable to Connect on Home Wifi

Post by RehanSaeed » Mon Oct 25, 2021 10:42 am

Will the autolocal setting help do what I want?

Post Reply