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

Secondary Container Doesn't Regain Network when OpenVPN Restarts #418

Open
bosonrolo opened this issue Dec 29, 2022 · 1 comment
Open

Secondary Container Doesn't Regain Network when OpenVPN Restarts #418

bosonrolo opened this issue Dec 29, 2022 · 1 comment

Comments

@bosonrolo
Copy link

I am using this OpenVPN image with transmission. Normally it works great. However, if the OpenVPN container restarts (and maybe if it simply loses connection), transmission will become inaccessible, even after OpenVPN is back up and running. I confirm this with docker exec -it transmission ping 192.168.1.1 , which shows Network Unreachable for any address outside of 127.0.0.0/8.

The problem seems to stem from losing the eth0 and tun0 interfaces when OpenVPN goes down, and not regaining them until transmission is restarted with OpenVPN up. Normally transmission has lo, eth0, and tun0; when OpenVPN goes down it has only lo.

I'm glad transmission doesn't leak my IP when the VPN goes down, but I sure would like it to fix itself when the problem is resolved. I sometimes have issues with a simple reboot of my machine.

Am I doing something wrong here? Any suggestions?

docker-compose.yml:

version: "3"
services:

  openvpn:
    image: dperson/openvpn-client:latest
    container_name: openvpn
    cap_add:
      - net_admin
    devices:
      - /dev/net/tun
    environment:
      - TZ=CST6CDT
      - VPNPORT=36811  # transmission
    volumes:
      - ./vpn:/vpn
    ports:
      - 9955:9091  # transmission HTTP
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
    restart: unless-stopped

  transmission:
    image: ghcr.io/linuxserver/transmission
    container_name: transmission
    depends_on:
      - openvpn
    network_mode: service:openvpn
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Chicago
      - TRANSMISSION_WEB_HOME=/combustion-release/
      - UMASK_SET=022
    volumes:
      - ./transmission/config:/config
      - ./transmission/media:/media
      - ./transmission/watch:/watch
    restart: unless-stopped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@bosonrolo and others