dperson / openvpn-client

GNU Affero General Public License v3.0
1.05k stars 585 forks source link

Container unhealthy and working intermittently #413

Open BlaiseLebreton opened 1 year ago

BlaiseLebreton commented 1 year ago

Hello !

Using the following docker-compose :

version: "3.4"
services:
  vpn:
    container_name: vpn
    image: dperson/openvpn-client:latest
    cap_add:
      - net_admin # required to modify network interfaces
    restart: unless-stopped
    volumes:
      - /dev/net:/dev/net:z # tun device
      - ${ROOT}/config/vpn:/vpn # OpenVPN configuration
    security_opt:
      - label:disable
    command: '-f "" -r 192.168.1.0/24' # enable firewall and route local network traffic

I'm having mixed results. Sometimes it works perfectly for a few days and then for some reasons it stops working for another few days.

The logs are here : _vpn_logs.txt

The container is marked as unhealthy : curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to api.ipify.org:443

However I can curl the api without https : image

Any idea what is happening ?

BlaiseLebreton commented 1 year ago

I just realized that I can't ping anything from inside the container :

bash-5.1# ping google.com
PING google.com (216.58.214.174): 56 data bytes
^C
--- google.com ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

bash-5.1# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.254.128.1    128.0.0.0       UG    0      0        0 tun0
default         192.168.144.1   0.0.0.0         UG    0      0        0 eth0
10.254.128.0    *               255.255.128.0   U     0      0        0 tun0
128.0.0.0       10.254.128.1    128.0.0.0       UG    0      0        0 tun0
192.168.1.0     192.168.144.1   255.255.255.0   UG    0      0        0 eth0
192.168.144.0   *               255.255.240.0   U     0      0        0 eth0
195.181.167.226 192.168.144.1   255.255.255.255 UGH   0      0        0 eth0