# Is there a way to specify the network in a label without including the stack name?

**URL:** <https://community.traefik.io/t/is-there-a-way-to-specify-the-network-in-a-label-without-including-the-stack-name/29667>\
**Category:** Traefik v3 (latest)\
**Tags:** docker-swarm\
**Created:** [February 14, 2026, 7:57am UTC](https://community.traefik.io/t/is-there-a-way-to-specify-the-network-in-a-label-without-including-the-stack-name/29667 "2026-02-14T07:57:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddean](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@ddean](https://community.traefik.io/u/ddean)\
**Post date:** [February 14, 2026, 7:57am UTC](https://community.traefik.io/t/is-there-a-way-to-specify-the-network-in-a-label-without-including-the-stack-name/29667/1 "2026-02-14T07:57:16Z")

</div>

In Traefik 2.x, we were able to use the unqualified network name in Traefik labels. With Traefik 3.x, I’m finding that doesn’t work and the stack name needs to be included in the label for Traefik to select the right IP.

Does anyone know a better way to do this? I don’t want to make my compose files depend on a particular stack name.

Traefik 2.x version:

```yaml
services:
  echo:
    networks:
      - lb
      - private
    deploy:
      labels:
        - "traefik.docker.network=lb"

```

Traefik 3.x equivalent:

```yaml
services:
  echo:
    networks:
      - lb
      - private
    deploy:
      labels:
        - "traefik.swarm.network=mystack_lb"

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [February 14, 2026, 8:01am UTC](https://community.traefik.io/t/is-there-a-way-to-specify-the-network-in-a-label-without-including-the-stack-name/29667/2 "2026-02-14T08:01:15Z")

</div>

Are you sure it’s Traefik and not a new Swarm and compose setup? We usually name the networks ([example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-swarm-traefik)), then you don’t have project prefix issues:

```auto
networks:
  proxy:
    name: proxy
    driver: overlay
    attachable: true

```
