I’m trying to setup a VPN client on my balena.io powered Raspberry Pi 4 from my local network to a remote network who has an OpenVPN server container set.
The aim is to set an eclipse-mosquitto mqtt in my local network and let is subscribe to a remote eclipse-mosquitto mqtt instance to get securely remote Unraid server statistics and display results in my local Home Assistant dashboard.
I’m using the following OpenVPN client.
The issue I encounter, is that my local mqtt instance doesn’t start when I add the network_mode: service:openvpn. It is stuck in “Installed” state in my Balena dashboard.
Logs only output the following
Killed service 'mqtt sha256:f8cc37202c41ee18edc5b7fae15a3abece48175ec591a4cb8e7e4b731f8e6026'
Installing service 'mqtt sha256:f8cc37202c41ee18edc5b7fae15a3abece48175ec591a4cb8e7e4b731f8e6026'
Installed service 'mqtt sha256:f8cc37202c41ee18edc5b7fae15a3abece48175ec591a4cb8e7e4b731f8e6026'
Starting service 'mqtt sha256:f8cc37202c41ee18edc5b7fae15a3abece48175ec591a4cb8e7e4b731f8e6026'
Starting service 'mqtt sha256:f8cc37202c41ee18edc5b7fae15a3abece48175ec591a4cb8e7e4b731f8e6026'
I’ve also tried with network_mode: container:openvpn. No container logs are thrown helping me to discover the root cause.
Trying with another container like nginx seems to result with the same issue.
I’ve tried to follow the Container stuck in status downloaded/installed solution, but it doesn’t change anything.
The OpenVPN client seem to correctly connect to the remote network as I am able to SSH into the container and ping my remote mqtt instance or other devices.
When I remove the network_mode on the container, it starts as expected.
My compose file:
version: "2.1"
volumes:
mqtt_config:
vpn_config:
services:
openvpn:
image: ghcr.io/wfg/openvpn-client:latest
cap_add:
- net_admin
restart: unless-stopped
environment:
- KILL_SWITCH= iptables
- HTTP_PROXY=on
- SOCKS_PROXY=on
- SUBNETS=192.168.178.0/24
- VPN_CONFIG_FILE=configfilename.ovpn
ports:
- 11883:1883
- 19001:9001
devices:
- "/dev/net/tun:/dev/net/tun"
volumes:
- vpn_config:/data/vpn
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
mqtt:
image: eclipse-mosquitto
network_mode: container:openvpn
volumes:
- mqtt_config:/mosquitto/config
restart: unless-stopped
depends_on:
- openvpn
Has anyone encountered this kind of issue, using network_mode with Balena?
Thank you.
Best regards,