Need an advice about docker networking. reddit / selfhosted ---------------------------------------------------------------------- Spuxilet · 2023-10-03 20:51 So i have built custom docker image that is based on wg-easy. I added multiple vpn clients to it. When i connect to wg-easy server from laptop or phone i can connect to devices through those vpn client connections. It's very cool. But i also have services cloudbeaver (managing databases) and guacamole (SSH, RDP). How are these two services supposed to connect to devices which are accessible only on those vpn client connections without connecting to wireguard server? ---------------------------------------------------------------------- GolemancerVekk · 2023-10-03 21:55 Use a docker image that contains a wireguard client and connect it to your wireguard server. Then [define a docker network](https://www.redd it.com/r/selfhosted/comments/16uy51b/jellyfin_behind_ngrok_on_docker_g iving_issues/k2qiwhc/) and use it to connect the wireguard client container to other containers that need it. ---------------------------------------------------------------------- Spuxilet · 2023-10-03 22:45 So i setup wireguard client container and then put `network_mode: service:wireguard` In my cloudbeaver compose file, but now i can't access my cloudbeaver from traefik. I do not even see ip address of cloudbeaver in portainer ---------------------------------------------------------------------- GolemancerVekk · 2023-10-04 12:30 See this: https://docs.docker.com/engine/reference/run/#network- settings `network_mode: service:` is an alias for `network_mode: container:`. It makes cloudbeaver use the exact same network as wireguard, so they will both map their ports on the same interface. `network_mode: bridge` with `networks: ` makes them see the same interface and additionally offers DNS resolution. This is useful when you have multiple services who attempt to use the same ports, and it makes it easier for them to refer to each other by name if you define the `hostname:` option. Second variant needs more options to work correctly, perhaps you missed one of them, or are addressing the service by port only. ---------------------------------------------------------------------- Spuxilet · 2023-10-04 12:34 >network\_mode: service: I can only use this if i have both in the same compose file. I tried setting up wireguard client isolated and putting that container and cloudbeaver in the same network by using networks: option in compose file but this way it does not work. It only works if i use network\_mode: service: option. But this way i need to configure multiple wireguard clients for each service that i want to be able to reach thos devices in vpns. For cloudbeaver in it's compose file, for guacamole it's own wireguard and so on. Multiple wireguard clients. How can i make it work with only one wireguard client container and use it as a gateway for other containers?