tmcphee / cyberghostvpn

CyberGhost VPN Client
GNU Affero General Public License v3.0
34 stars 16 forks source link

VPN connects, but is forced to NYC regardless of COUNTRY variable value #7

Closed Greeyui closed 1 year ago

Greeyui commented 1 year ago

I've been trying to set Cyberghost up on my Unraid NAS and have eventually gotten it "working", however it only connects to NYC despite COUNTRY=RO. I have tested with COUNTRY=DE and obtained the same result -- being forced to NYC with one instance of being switched to a Dallas server. Cyberghost will connect to a server in Bucharest, establish a connection, and then seemingly switch over to NYC.

I have only gotten the container to function via pasting code directly into the terminal; attempting to add the container through DockerHub or adding the container and setting the variables/path manually doesn't seem to work for some reason. I should note that editing the container takes the server offline. No clue how this is happening. Specifically, editing the container will first result in the container icon not registering in the Docker tab, but changes will be applied successfully. Attempting to edit the container a second time will disconnect the NAS from the local network, requiring a manual reboot and container deletion to fix.

I've attached the exact code I pasted into the terminal to run the container as well as the log with sensitive info redacted. I'd appreciate any help you can give since this container seems much better than the Gluetun alternative.

tmcphee_cyberghost_forcedNYC_log.txt tmcphee_cyberghost_console_install_command.txt

Greeyui commented 1 year ago

I found a solution from analyzing the start.sh script, specifically line 85. Creating an environmental variable "NAMESERVER" with value "1.1.1.1" allows the VPN to connect to Romania. Still have no idea what is/was causing the crashes, but it is functional at the very least.

tmcphee commented 1 year ago

I'm glad you were able to find the solution with the location issue. Yes the Nameserver should be set to 1.1.1.1 in that case. In reference the Issue here had the same problem with location. Which I will make easier in the next update.

As per your crashing it could be due to sysctl being read-only on your machine. I see in the log that ipv4 forwarding couldn't be set.

sysctl: setting key "net.ipv6.conf.all.disable_ipv6": Read-only file system sysctl: setting key "net.ipv6.conf.default.disable_ipv6": Read-only file system sysctl: setting key "net.ipv6.conf.lo.disable_ipv6": Read-only file system sysctl: setting key "net.ipv6.conf.eth0.disable_ipv6": Read-only file system sysctl: setting key "net.ipv4.ip_forward": Read-only file system

vperas commented 1 year ago

Hi, I have the same errors in the log but the client is connecting and working.

EDIT: The container needs to be run in "Privileged mode" and the errors go away.

Kind regards

tmcphee commented 1 year ago

Thank You @vperas for figuring that out. I will update the documentation.

tmcphee commented 1 year ago

New release v1.1.4. Fixed the DNS issue. Default now CloudFlare. Added privileged flag to documentation