Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info about openvpn server #3

Closed
swimer-girl opened this issue Oct 14, 2022 · 14 comments
Closed

Info about openvpn server #3

swimer-girl opened this issue Oct 14, 2022 · 14 comments
Labels
documentation Improvements or additions to documentation

Comments

@swimer-girl
Copy link

Hello!
In continuation of my question. I made a few changes.
Installed vpn through Pivpn script.
Launched the container according to your instructions from this https://github.com/bnhf/pivpn-tap-web-ui.
But I don't see server version information and information about connected users("Fix your configuration")
May be I can see some log about this problem.

@bnhf
Copy link
Owner

bnhf commented Oct 14, 2022

@swimer-girl

What OS are you using (Raspbian, Debian, Ubuntu) and what version (Buster, Bullseye, etc)?

Are you launching the container via Portainer Stacks (as shown below), and have you set your environment variables?

Please login through a terminal, and post the output of pivpn -d

image

@swimer-girl
Copy link
Author

OS: Ubuntu 16.04 xenial
Yes, I launch the container via Portainer Stacks. I use the environment variables as you used

  • PIVPN_SERVER=vpn_ac01d026-c0d2-4203-9441-bd9e1e35b5a3
  • PIVPN_CONF=server.conf

debug.log

@bnhf
Copy link
Owner

bnhf commented Oct 14, 2022

@swimer-girl

Looks like the issue is here, based on your debug log:

Oct 14 15:35:45 vpn ovpn-server[4583]: MANAGEMENT: Socket bind failed on local address [AF_INET]REDACTED:2080: Address already in use (errno=98)
Oct 14 15:35:45 vpn ovpn-server[4583]: Exiting due to fatal error

So PiVPN isn't running, and even if it were the port we need to use for the management interface isn't open. I believe the problem may be your use of 127.0.0.1 instead of 0.0.0.0 for the IP of the host. My recollection is that in a Docker environment, 127.0.0.1 refers to the container, and 0.0.0.0 to the host. It's also possible you're already using port 2080 for something else, but I think my first explanation is more likely.

Edit your settings file in the WebUI to match the Management setting shown below and reboot, and of course, make sure that all the other OpenVPN server settings are the way you want them:

image

@swimer-girl
Copy link
Author

I checked everything and made changes.
Here is the result of the command again pivpn -d
debug.log

@bnhf
Copy link
Owner

bnhf commented Oct 14, 2022

@swimer-girl

OK, PiVPN is running now and listening on the management port. Is the WebUI showing you status information on the Home page now? OPENVPN VERSION, OPERATING SYSTEM, ARCHITECTURE and the like?

@swimer-girl
Copy link
Author

I see only this.
2022-10-14_21-42-43

@bnhf
Copy link
Owner

bnhf commented Oct 14, 2022

@swimer-girl

How do you have your settings page configured in the UI? You may need to use the IP address of your host computer rather than the hostname -- which may or may not resolve depending on your network setup. Hostname is used in this example, but just replace it with the LAN IP of your host:

image

@bnhf
Copy link
Owner

bnhf commented Oct 14, 2022

@swimer-girl

Just to clarify I'm talking about the "Management interface address" field. Try using the IP address of the host with a :2080 after.

@swimer-girl
Copy link
Author

I understood you, I just wrote the answer and tried to realize my epic-fail.
I spent a lot of time thinking about this setting. Only did it in the wrong context.
I tried to specify different options: localhost, 0.0.0.0 and 127.0.0.1.
But I never had an idea to put exactly the host-IP of the machine on my local network.
Now everything works for me.
Mega giant thanks for your help.
You are amazing!!!
2022-10-14_22-02-36

@swimer-girl
Copy link
Author

While I was tinkering with the code, I found where you can make other changes for me. For example, fix config files and other points related specifically to the openvpn server.
But what IP to use in this setting, I did not guess

@bnhf
Copy link
Owner

bnhf commented Oct 14, 2022

@swimer-girl

Out of curiosity, how are you handling reaching your external (public) IP from an OpenVPN client? Do you have a static IP, or are you using a Dynamic DNS service to give you a reliable hostname?

@swimer-girl
Copy link
Author

I have port forwarding configured from the firewall to my openvpn server for client. Server has static IP.

@bnhf
Copy link
Owner

bnhf commented Oct 14, 2022

@swimer-girl

So in that same Settings page, there's a field for "Server Address (external)". This refers to the IP address you get from your Internet provider, if it's a static address you can use that directly. If not, you're going to want to sign-up with a DDNS service so that you have a hostname you can use that will keep track of an occasionally changing Internet IP address from that ISP.

@swimer-girl
Copy link
Author

In this field I used my external IP from my Internet provider, yes.

@bnhf bnhf added the documentation Improvements or additions to documentation label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants