Error when trying to connect to openvpn server/Unable to connect outside LAN

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
Bossman
OpenVpn Newbie
Posts: 8
Joined: Wed May 05, 2021 9:55 pm

Error when trying to connect to openvpn server/Unable to connect outside LAN

Post by Bossman » Wed May 05, 2021 10:08 pm

I went through the setup for OpenVPN and that went fine. After the reboot of my Raspberry Pi, I made a profile. Though when I try to connect to that profile with my Android phone, it says "There was an error attempting to connect to the selected server." When I tried to find the problem I came upon an article called "Troubleshooting client VPN tunnel connectivity" and I tried to get the logs. When I typed: "/var/log/openvpn.log" it said: "Permission denied."
I haven't been able to find any solution to this problem online by googling so I hope someone here can help me.
Last edited by Bossman on Thu May 06, 2021 12:15 pm, edited 1 time in total.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Error when trying to connect to openvpn server

Post by TinCanTech » Wed May 05, 2021 10:13 pm

Login as root ..

Bossman
OpenVpn Newbie
Posts: 8
Joined: Wed May 05, 2021 9:55 pm

Re: Error when trying to connect to openvpn server

Post by Bossman » Thu May 06, 2021 7:49 am

TinCanTech wrote:
Wed May 05, 2021 10:13 pm
Login as root ..
I logged in as root and it still reads "permission denied"

Bossman
OpenVpn Newbie
Posts: 8
Joined: Wed May 05, 2021 9:55 pm

Re: Error when trying to connect to openvpn server

Post by Bossman » Thu May 06, 2021 11:00 am

Bossman wrote:
Wed May 05, 2021 10:08 pm
Though when I try to connect to that profile with my Android phone, it says "There was an error attempting to connect to the selected server."
This problem seems to be resolved (at least the devices connect inside my house). I still cannot access openvpn.log even when logged in as root. How can I resolve this?
Thanks for the help.

Bossman
OpenVpn Newbie
Posts: 8
Joined: Wed May 05, 2021 9:55 pm

Re: Error when trying to connect to openvpn server

Post by Bossman » Thu May 06, 2021 12:18 pm

Bossman wrote:
Thu May 06, 2021 11:00 am
Bossman wrote:
Wed May 05, 2021 10:08 pm
Though when I try to connect to that profile with my Android phone, it says "There was an error attempting to connect to the selected server."
This problem seems to be resolved (at least the devices connect inside my house).
It seems that my devices only connect to the VPN server when connected to the same network. How can I solve this issue? Thanks for the help.

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Error when trying to connect to openvpn server/Unable to connect outside LAN

Post by openvpn_inc » Fri Jul 02, 2021 7:33 am

Hello Bossman,

As root you should be able to access all files. It is very odd that you are not able to.

Regarding the issue that you cannot connect to your VPN server outside of your network, most commonly that is because you have mistakenly configured the client to connect to the private IP address of the server. That will work as long as you are in the same network where that server is, but it will not work outside of your network. To solve this you need to open the necessary ports on your router using port forwarding or NATting, whichever your router prefers to call it, so that a connection started by the client on the public IP address of the router will be sent through to your VPN server. You then need to ensure the VPN client contacts that public IP address. People often use a DNS address for this like vpn.mycompany.com which resolves to that public IP.

Kind regards,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

jigs
OpenVpn Newbie
Posts: 12
Joined: Wed Jul 22, 2020 3:03 pm

Re: Error when trying to connect to openvpn server/Unable to connect outside LAN

Post by jigs » Sun Aug 08, 2021 8:08 pm

openvpn_inc wrote:
Fri Jul 02, 2021 7:33 am
Hello Bossman,

As root you should be able to access all files. It is very odd that you are not able to.

Regarding the issue that you cannot connect to your VPN server outside of your network, most commonly that is because you have mistakenly configured the client to connect to the private IP address of the server. That will work as long as you are in the same network where that server is, but it will not work outside of your network. To solve this you need to open the necessary ports on your router using port forwarding or NATting, whichever your router prefers to call it, so that a connection started by the client on the public IP address of the router will be sent through to your VPN server. You then need to ensure the VPN client contacts that public IP address. People often use a DNS address for this like vpn.mycompany.com which resolves to that public IP.

Kind regards,
Johan
This is a good help... I was also having this issue

Post Reply