# Large ipwhitelist with dynamic configuration

**URL:** <https://community.traefik.io/t/large-ipwhitelist-with-dynamic-configuration/4779>\
**Category:** Traefik v2\
**Tags:** docker, middleware\
**Created:** [March 5, 2020, 7:58pm UTC](https://community.traefik.io/t/large-ipwhitelist-with-dynamic-configuration/4779 "2020-03-05T19:58:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karramba](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/karramba/32/1687_2.png) [@Karramba](https://community.traefik.io/u/Karramba)\
**Post date:** [March 5, 2020, 7:58pm UTC](https://community.traefik.io/t/large-ipwhitelist-with-dynamic-configuration/4779/1 "2020-03-05T19:58:21Z")

</div>

Hello.

I decided to use dynamic configurations with labels, but now I'm struggling with the ipwhitelist middleware. I have to handle a large amount (about 20-30) different IPs.

Any best practise on how to handle that with dynamic configuration labels?

Thanks,  
Karramba

PS: Same question with multiple basicauth users.

---

<div class="post-metadata">

**Author:** ![Karramba](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/karramba/32/1687_2.png) [@Karramba](https://community.traefik.io/u/Karramba)\
**Post date:** [March 8, 2020, 7:43pm UTC](https://community.traefik.io/t/large-ipwhitelist-with-dynamic-configuration/4779/2 "2020-03-08T19:43:27Z")

</div>

Any ideas here? Sorry for pushing.

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [March 8, 2020, 10:47pm UTC](https://community.traefik.io/t/large-ipwhitelist-with-dynamic-configuration/4779/3 "2020-03-08T22:47:22Z")

</div>

Hello,

ipwhitelist middleware support CIDR, maybe you can reduce the number of IP by using it.

for basicauth you can use file: [https://docs.traefik.io/v2.1/middlewares/basicauth/#usersfile](https://docs.traefik.io/v2.1/middlewares/basicauth/#usersfile)

---

<div class="post-metadata">

**Author:** ![Karramba](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/karramba/32/1687_2.png) [@Karramba](https://community.traefik.io/u/Karramba)\
**Post date:** [March 9, 2020, 6:30am UTC](https://community.traefik.io/t/large-ipwhitelist-with-dynamic-configuration/4779/4 "2020-03-09T06:30:14Z")

</div>

Thanks, usersfile will help. Totally missed that in the docs. CIDR won't help, because the IPs are totally random and not groupabe by ranges.
