# How to create static routes using labels or commands

**URL:** <https://community.traefik.io/t/how-to-create-static-routes-using-labels-or-commands/6733>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [July 2, 2020, 5:07am UTC](https://community.traefik.io/t/how-to-create-static-routes-using-labels-or-commands/6733 "2020-07-02T05:07:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptr727](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ptr727/32/2251_2.png) [@ptr727](https://community.traefik.io/u/ptr727)\
**Post date:** [July 2, 2020, 5:07am UTC](https://community.traefik.io/t/how-to-create-static-routes-using-labels-or-commands/6733/1 "2020-07-02T05:07:04Z")

</div>

How can I create routes to external services using traefik v2 container label or command settings, not using an external configuration file?

---

<div class="post-metadata">

**Author:** ![darkweak](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/darkweak/32/4131_2.png) [@darkweak](https://community.traefik.io/u/darkweak)\
**Post date:** [July 2, 2020, 11:48am UTC](https://community.traefik.io/t/how-to-create-static-routes-using-labels-or-commands/6733/2 "2020-07-02T11:48:19Z")

</div>

Hi @ptr727  
I don't understand exactly what you want to achieve. IMO it's not possible if there not in one of traefik network. you can try `- traefik.http.services.my-container-service.loadbalancer.server.url=http://yoururl` but it's not sure

---

<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:** [July 2, 2020, 12:30pm UTC](https://community.traefik.io/t/how-to-create-static-routes-using-labels-or-commands/6733/3 "2020-07-02T12:30:31Z")

</div>

Hi @ptr727

The only way i have found this to be possible is by using the file provider to define an external service. The docker provider appears to able to use another service with a router ` - "traefik.http.routers.router1.service=foobar"` if it were define in the file provider you would use `foobar@file` as service name.

---

<div class="post-metadata">

**Author:** ![ptr727](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ptr727/32/2251_2.png) [@ptr727](https://community.traefik.io/u/ptr727)\
**Post date:** [July 2, 2020, 1:34pm UTC](https://community.traefik.io/t/how-to-create-static-routes-using-labels-or-commands/6733/4 "2020-07-02T13:34:41Z")

</div>

I see, that is unfortunate, I was hoping I could define static services using e.g. commands, similar to how entrypoints are defined.  
I build my containers using Ansible, and it is much easier to change the configuration of the container, vs. writing configuration to a file and then mounting the file.

Do you know if there is an open feature request for static routes in commands or labels, if so I'll add my voce of support?
