# Traefik to external IP instead of internal

**URL:** <https://community.traefik.io/t/traefik-to-external-ip-instead-of-internal/23317>\
**Category:** Traefik v3 (latest)\
**Tags:** docker\
**Created:** [June 24, 2024, 7:15pm UTC](https://community.traefik.io/t/traefik-to-external-ip-instead-of-internal/23317 "2024-06-24T19:15:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruubie](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ruubie/32/8940_2.png) [@Ruubie](https://community.traefik.io/u/Ruubie)\
**Post date:** [June 24, 2024, 7:15pm UTC](https://community.traefik.io/t/traefik-to-external-ip-instead-of-internal/23317/1 "2024-06-24T19:15:20Z")

</div>

Im trying to set up Traefik. The problem i have is that i have some docker containers that go directly to my LAN. So the IP they have is for example: 10.0.0.6. How do i configure Traefik in a way that it will go to 10.0.0.6:8080 instead of 172.20.0.5:8080

Compose.yml

```auto
services:

### qBittorrent #####################################################

  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    networks:
      VPN:
        ipv4_address: 10.0.0.6
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - WEBUI_PORT=8080
      - TORRENTING_PORT=6881
    volumes:
      - /ZFSSD/qbittorrent/appdata:/config
      - /ZFSSD/qbittorrent/downloads:/downloads
    ports:
      - 8080:8080
      - 6881:6881
      - 6881:6881/udp
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.qbittorrent.rule=Host(`qbit. *****.eu`)"
      - "traefik.http.routers.qbittorrent.entrypoints=websecure"
      - "traefik.http.routers.qbittorrent.tls=true"
      - "traefik.http.routers.qbittorrent.tls.certresolver=myresolver"

### Traefik #####################################################

  traefik:
    image: "traefik:latest"
    container_name: "traefik"
    command:
      #- "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      #- "--providers.docker.useBindPortIP=true"
      - "--entrypoints.web.address=:80"
      - "--entryPoints.websecure.address=:443"
      - "--certificatesresolvers.myresolver.acme.tlschallenge=true"
      - "--certificatesresolvers.myresolver.acme.email=traefik@ *****.eu"
      - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
    ports:
      - "8080:8080"
      - "80:80"
      - "443:443"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./letsencrypt:/letsencrypt"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.rule=Host(`traefik. *****.eu`)"
      - "traefik.http.routers.traefik.entrypoints=websecure"
      - "traefik.http.routers.traefik.tls=true"
      - "traefik.http.routers.traefik.tls.certresolver=myresolver"
      - "traefik.http.services.traefik.loadbalancer.server.port=8080"

### WhoAmI #####################################################

  whoami:
    image: "traefik/whoami"
    container_name: "simple-service"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`whoami. *****.eu`)"
      - "traefik.http.routers.whoami.entrypoints=websecure"
      - "traefik.http.routers.whoami.tls=true"
      - "traefik.http.routers.whoami.tls.certresolver=myresolver"

```

It works fine with WhoAmI but it doesnt work with qBittorrent. Can someone help? I would like to do it all within the compose file if possible, because my server is not yet in a final state and want to be able to just run compose to roll almost everything out.

TL:DR how do I make Traefik go to 10.0.0.6

Im aware 10.0.0.6 is still an internal IP just didnt know how to call it otherwise

---

<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:** [June 24, 2024, 8:15pm UTC](https://community.traefik.io/t/traefik-to-external-ip-instead-of-internal/23317/2 "2024-06-24T20:15:15Z")

</div>

When using labels, the Traefik Docker Configuration Discovery will automatically use the container IP. If you want to proxy to an external service, you need to use a dynamic config file, loaded by `providers.file` in static config. Check [simple Traefik external example.](https://github.com/bluepuma77/traefik-best-practice/tree/main/traefik-external-forward)

---

<div class="post-metadata">

**Author:** ![Ruubie](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ruubie/32/8940_2.png) [@Ruubie](https://community.traefik.io/u/Ruubie)\
**Post date:** [June 24, 2024, 8:36pm UTC](https://community.traefik.io/t/traefik-to-external-ip-instead-of-internal/23317/3 "2024-06-24T20:36:12Z")

</div>

oke so if im understanding correctly it should just grab the 10.0.0.6 IP? if thats the case why doesnt it

---

<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:** [June 25, 2024, 6:40am UTC](https://community.traefik.io/t/traefik-to-external-ip-instead-of-internal/23317/4 "2024-06-25T06:40:46Z")

</div>

What does `docker inspect <container-id>` tell you about the IPs of the container? Are multiple present?
