Traefik Container Network Access to External Network


Recommended Posts

I have been toying around with Docker and Docker Compose lately and I finally got Traefik setup to reverse proxy all my containers to their own docker network. However, I have one container I was not able to put into the docker container network and sits outside of the docker network. It looks like I can still use Traefik to forward traffic to this container but when the request comes in the traefik container logs state "no route to host". 

 

I assume this is because the internal docker networks do not see other networks and are isolated. My questions is, how do it expose the docker networks to other non-docker networks?

Link to comment

The problem container is traefik, which is connected to t2_proxy network with all the other containers, except for unifi. The unifi container needs to be on the main network br0. From what I can tell from the logs, traefik is trying to route requests to my unifi container but there are no routes.

Screen Shot 2020-04-27 at 12.38.28 PM.png

Link to comment

yes and traefik chokes and doesnt start back up. I have to disconnect the network from traefik for it work again. I maybe remove all these network i dont use anymore since i moved everything into docker.

 

Ideally i would have 192.168.0.0/16 and then the docker networks and that would be it.

Link to comment

I originally had it on t2_proxy and then all my unifi devices lost access to the controller. So i moved it back to br0 and the devices connected again. Very strange behavior. I recently moved it back thinking that now I was done reconfiguring everything that it would be fine in t2_proxy. But l traefik still couldn't connect, but gave a 404 error this time and with no log data. 

Link to comment

One other thing you can try is using a static traefik config for your ubiquity container specifying the ip of your unraid server and the exposed ports of the container on br0. I do something similar for my Netdata container which has to be on the Host network to work properly. I use a file based configuration for that container only.

Link to comment

Its not that Netdata wont work on other networks, but there are a few metrics (its been so long i dont remember off hand which) that it can only collect if it shares the host's network namespace.

 

See the limitations section under the link below. I am not certain it still applies to the netdata/netdata container but i havent bothered to check.

https://github.com/titpetric/netdata

Edited by primeval_god
Link to comment
  • 2 weeks later...

Nope, others kept telling me to add a route on the host but couldn't figure out how to do it and no one really wanted to help. Then work got a little busy. I moved it to the docker network again but the unifi devices didn't like that it couldn't see the controller so i moved it back to the main network. So not sure what is up.

Link to comment
  • 3 months later...

How do you get started with this?

My docker-compose file gets hung up on ports 80/443 are the GUI listens to those ports on 0.0.0.0. I tried using a vlan, br0.50, and I get a bit farther, but not much.

Any anyone share their compose file or however they did this. please?

Link to comment

@daze I dont use docker-compose myself, I just run a traefik container and add the appropriate labels to the containers i want passed through (using unRAIDs dockerman templates). As for the port issue, I am not using port 80/443 for my traefik container. I chose another unused port pair as the entrypoint for my reverse proxy. Something like 9080/9443 which i mapped to ports 80/443 in the traefik docker container. 

 

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.