File Provider Network

Hi all,

Is it possible at all define the network for a file provider similarly to how a network is defined for docker provider in the static configuration? I would like Traefik to proxy to file provider services from a separate network to that of my default docker network. I have looked around for documentation on this and cannot seem to this anywhere and having tried this myself it did not seem to work. Any help would be greatly appreciated.

Hi @DanW

If you're not proxying a docker container this feature is not much use. If it is not working you may have to investigate your host networking.

Thanks @cakiwi. The thing is it works but the thing is I have multiple docker networks with Traefik in them all so it can proxy to containers in different networks. When proxying to a file provided service it seems to pick a particular network from which to proxy (I discovered this when I was playing with my firewall settings and realised I had to allow Traefik's IP from a particular docker network to my file provided services). Surely there must be a way then to control which network Traefik proxies from?

Hopefully a contributor can correct me if I am wrong here. The docker network option is a filter to return the networks of the container that match the value, it is to help prevent an unroutable address being returned to traefik. So this option cannot apply to another provider.

Beyond that standard network routing occurs in the traefik container and beyond.

If traefik is not routing how you expect then it could be your docker networks in conflict with the host networking ? Or possibly the routing table on the docker host needs updating.

So for the file provided service: host resolution -> container netns route table likely that will go to the container netns default gateway and the be routed via the docker hosts route table.

Right, I get what you are saying - but what I am saying is that I my traefik container is part of three docker networks. When proxying via a file provider it goes to the containers netns default gateway of one particular docker network and never the other two. I am certain of this because if a block the firewall rule of that particular docker network, the file provider proxying stops working, I don't want it to route from this particular netns, I want it to route from another. I am not sure why it has picked this netns at all. There has surely got to be a way to change this behaviour?

Right, so I have just figured out why.... I have exec-ed into my traefik container to check the route rules and it appears that the default gateway is the one belonging to the particular docker network I just mentioned that it always proxies file providers through... it would be a matter of seeing if I can change the default gateway and make it persistent.