# File Provider Network

**URL:** <https://community.traefik.io/t/file-provider-network/11395>\
**Category:** Traefik v2\
**Tags:** docker, file\
**Created:** [August 9, 2021, 9:28pm UTC](https://community.traefik.io/t/file-provider-network/11395 "2021-08-09T21:28:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanW](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DanW](https://community.traefik.io/u/DanW)\
**Post date:** [August 9, 2021, 9:28pm UTC](https://community.traefik.io/t/file-provider-network/11395/1 "2021-08-09T21:28:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [August 10, 2021, 12:08pm UTC](https://community.traefik.io/t/file-provider-network/11395/2 "2021-08-10T12:08:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanW](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DanW](https://community.traefik.io/u/DanW)\
**Post date:** [August 12, 2021, 8:21am UTC](https://community.traefik.io/t/file-provider-network/11395/3 "2021-08-12T08:21:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [August 12, 2021, 3:24pm UTC](https://community.traefik.io/t/file-provider-network/11395/4 "2021-08-12T15:24:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanW](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DanW](https://community.traefik.io/u/DanW)\
**Post date:** [August 24, 2021, 5:23pm UTC](https://community.traefik.io/t/file-provider-network/11395/5 "2021-08-24T17:23:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DanW](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DanW](https://community.traefik.io/u/DanW)\
**Post date:** [August 24, 2021, 5:44pm UTC](https://community.traefik.io/t/file-provider-network/11395/6 "2021-08-24T17:44:29Z")

</div>

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.
