tmcphee / cyberghostvpn

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

Cyberghostvpn container on NAS Synology #18

Closed thunderj27 closed 6 months ago

thunderj27 commented 6 months ago

Describe the issue

I try to make this container work on a Synology NAS but without success. Therefore i open this issue in case of anyone has managed to do so :).

Here is my docker compose:

version: '3.3'

services:
  cyberghostvpn:
    container_name: cyberghostvpn
    image: tmcphee/cyberghostvpn:latest
    restart: unless-stopped
    privileged: true
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 9090:9090 #Transmission
      - 3128:3128
    environment:
      - ACC=${MY_ID}
      - PASS=${MY_PASSWORD}
      - NETWORK=192.168.0.0/24
      - WHITELISTPORTS=9090
      - COUNTRY=CH
      - TZ=${MY_TZ}
      - FIREWALL=False
      - PROXY=True
    volumes:
      - /volume2/docker/cyberghostvpn:/home/root/.cyberghost:rw
    network_mode: bridge

Inspirered by https://drfrankenstein.co.uk/2022/09/26/qbittorrent-with-gluetun-vpn-in-docker-on-a-synology-nas/ , i have also opened the ports 53, 1194, 1195 & 51820 (https://www.cyberghostvpn.com/en_US/privacyhub/what-are-vpn-ports/)

Finally, the following command is executed when the NAS is starting (for the TUN device):

insmod /lib/modules/tun.ko

Log / Screenshots

Here are logs of the container:

CyberGhostVPN - Docker Edition
----------------------------------------------------------
    Created By: Tyler McPhee
    GitHub: https://github.com/tmcphee/cyberghostvpn
    DockerHub: https://hub.docker.com/r/tmcphee/cyberghostvpn

    Ubuntu:20.04 | CyberGhost:1.3.4 | v1.2.2
----------------------------------------------------------
**************User Defined Variables**************
    ACC: [PASSED - NOT SHOWN]
    PASS: [PASSED - NOT SHOWN]

    COUNTRY: CH
    NETWORK: 192.168.0.0/24
    WHITELISTPORTS: 9090

    PROXY: True
**************************************************
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
net.ipv4.ip_forward = 1
Firewall stopped and disabled on system startup
Logging into CyberGhost...
Allowing PORT 53 - IN/OUT
spawn sudo cyberghostvpn --setup
Setup account ...
Enter CyberGhost username and press [ENTER]: XXX (My username)
Enter CyberGhost password and press [ENTER]: XXX (My password)
Perform authentication ...
Creating a new device ...
Install completed ...
Blocking PORT 53 - IN/OUT
Adding network route...
192.168.0.0/24 routed to 172.17.0.1 on eth0
Seting up HTTP proxy on port 3128...
Stopping HTTP Proxy...
squid.service - Squid Web Proxy Server
    Loaded: loaded (/usr/lib/systemd/system/squid.service, disabled)
    Active: inactive (dead)
Allowing PORT 53 - IN/OUT
Prepare Wireguard connection ...
Select server ... zurich-s401-i34
Connecting ... 
WIREGUARD error: cannot connect to server "zurich-s401-i34.cg-dialup.net"!
Blocking PORT 53 - IN/OUT
Starting HTTP Proxy...
squid.service - Squid Web Proxy Server
    Loaded: loaded (/usr/lib/systemd/system/squid.service, enabled)
    Active: active (running)
***********CyberGhost Connection Info***********
    IP: X.X.X.X (My public IP)

    CITY: Paris
    REGION: Île-de-France

    COUNTRY: FR
    DNS: 1.1.1.1
************************************************

Troubleshooting

Many trials ...

Does someone have an idea?

Thanks in advance.

MarcBresson commented 6 months ago

I am having a similar error.

Btw, could you please use code block for your yml config and log? to use it https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks:

```

your config yaml code

```

will give:

your config yaml code
cyberghostvpn    | CyberGhostVPN - Docker Edition
cyberghostvpn    | ----------------------------------------------------------
cyberghostvpn    |  Created By: Tyler McPhee
cyberghostvpn    |  GitHub: https://github.com/tmcphee/cyberghostvpn
cyberghostvpn    |  DockerHub: https://hub.docker.com/r/tmcphee/cyberghostvpn
cyberghostvpn    |  
cyberghostvpn    |  Ubuntu:20.04 | CyberGhost:1.4.1 | 
cyberghostvpn    | ----------------------------------------------------------
cyberghostvpn    | **************User Defined Variables**************
cyberghostvpn    |  ACC: [PASSED - NOT SHOWN]
cyberghostvpn    |  PASS: [PASSED - NOT SHOWN]
cyberghostvpn    |  COUNTRY: RO
cyberghostvpn    |  NETWORK: 192.168.1.0/24
cyberghostvpn    |  WHITELISTPORTS: 8092,8080
cyberghostvpn    |  NAMESERVER: 8.8.8.8
cyberghostvpn    | **************************************************
cyberghostvpn    | net.ipv6.conf.all.disable_ipv6 = 1
cyberghostvpn    | net.ipv6.conf.default.disable_ipv6 = 1
cyberghostvpn    | net.ipv6.conf.lo.disable_ipv6 = 1
cyberghostvpn    | net.ipv6.conf.eth0.disable_ipv6 = 1
cyberghostvpn    | net.ipv4.ip_forward = 1
cyberghostvpn    | Firewall stopped and disabled on system startup
cyberghostvpn    | Verifying Login Auth...
cyberghostvpn    | Passed
cyberghostvpn    | Adding network route...
cyberghostvpn    | RTNETLINK answers: File exists
cyberghostvpn    | 192.168.1.0/24 routed to 192.168.1.254 on eth0
cyberghostvpn    | Disabling HTTP proxy...
cyberghostvpn    | Allowing PORT 53 - IN/OUT
cyberghostvpn    | Prepare Wireguard connection ...
cyberghostvpn    | Select server ... bucharest-s408-i03
cyberghostvpn    | Connecting ... 
cyberghostvpn    | Blocking PORT 53 - IN/OUT
cyberghostvpn    | ***********CyberGhost Connection Info***********
cyberghostvpn    |  IP: XXXXXXXXXXX
cyberghostvpn    |  CITY: Paris
cyberghostvpn    |  REGION: Île-de-France
cyberghostvpn    |  COUNTRY: FR
cyberghostvpn    |  DNS:  8.8.8.8
cyberghostvpn    | ************************************************
cyberghostvpn    | [E2] VPN Connection Lost - Attempting to reconnect....
cyberghostvpn    | Allowing PORT 53 - IN/OUT
cyberghostvpn    | Prepare Wireguard connection ...
cyberghostvpn    | Select server ... bucharest-s402-i38
cyberghostvpn    | Connecting ... 
cyberghostvpn    | Blocking PORT 53 - IN/OUT
cyberghostvpn    | ***********CyberGhost Connection Info***********
cyberghostvpn    |  IP: XXXXXXXXXXX
cyberghostvpn    |  CITY: Paris
cyberghostvpn    |  REGION: Île-de-France
cyberghostvpn    |  COUNTRY: FR
cyberghostvpn    |  DNS:  8.8.8.8
cyberghostvpn    | ************************************************
MarcBresson commented 6 months ago

Hello, I checked with the cyberghost team and they said that the wireguard protocol is not working on their cli app

The WireGuard protocol has been reported as currently not working on our CLI app. This has been reported to our development team for checking. In the meantime, we recommend using the OpenVPN protocol for your use.

tmcphee commented 6 months ago

Reference to Issue

19

tmcphee commented 6 months ago

@thunderj27 I make a OpenVPN-only docker that has the newer version of CyberGhost CLI. I hope this can help you.

OpenVPN only image available here running Cyberghost 1.4.1