Bridge container to different adapter

Post Reply
kitchenerer
Starting out
Posts: 25
Joined: Thu May 15, 2014 12:01 am

Bridge container to different adapter

Post by kitchenerer »

Hi,

I want to bridge my "hassio" container to a different network adapter in another vlan, like this:
photo_2019-05-02_09-45-56.jpg
but when I configure it from container station, I don't see the virtual adapter in its network section, wondering if I didn't anything wrong?
photo_2019-05-02_09-47-38.jpg
You do not have the required permissions to view the files attached to this post.
kitchenerer
Starting out
Posts: 25
Joined: Thu May 15, 2014 12:01 am

Re: Bridge container to different adapter

Post by kitchenerer »

turned out it's a bug in QTS.
you need to create and configure all network interfaces before install/initiate container station.
if a network interface is created after container station is enabled, the relevant interface won't show up in container's network settings
Zibiii
New here
Posts: 2
Joined: Thu Apr 16, 2020 10:56 pm

Re: Bridge container to different adapter

Post by Zibiii »

Hi,

Did you find a solution for the problem? Could you give any feedback?
I tried as you wrote:

I removed all my virtual switches and vlans
I uninstalled Container Station + deleted settings
Next I reboot QNAP
I created vlans and Virtual Switches
I installed Container station but unfortunatelly it didn't help.

Best regards,
Zibi
kitchenerer wrote: Thu May 02, 2019 9:53 pm Hi,

I want to bridge my "hassio" container to a different network adapter in another vlan, like this:
photo_2019-05-02_09-45-56.jpg
but when I configure it from container station, I don't see the virtual adapter in its network section, wondering if I didn't anything wrong?
photo_2019-05-02_09-47-38.jpg
cupples
New here
Posts: 2
Joined: Thu May 14, 2020 4:47 am

Re: Bridge container to different adapter

Post by cupples »

Im running into the same issues.
Is there a support ticket open with qnap on this/do we have an ETA a fix?
Having to blow up the full docker and/or container station config just to add a vlan makes container station almost unusable in my situation where I have a bonded link and all my networks come over vlans in a test environment. I run isolated vlans for validation and am looking for an easy way to deploy build and tear down environments (vlans) to support the hardware I am netbooting behind each, I had intended to do with with docker/the nas vs building a linux server to do this.

Edit:
I opened a support ticket on this: Q-202005-23760
kitchenerer
Starting out
Posts: 25
Joined: Thu May 15, 2014 12:01 am

Re: Bridge container to different adapter

Post by kitchenerer »

cupples wrote: Thu May 14, 2020 4:53 am Im running into the same issues.
it's a bug in Qnap software if a NIC adapter is created after container station is enabled, container station won't be able to utilize that later created NIC.
workaround is uninstall and re-install container station after all required NIC adapters are created first.
cupples
New here
Posts: 2
Joined: Thu May 14, 2020 4:47 am

Re: Bridge container to different adapter

Post by cupples »

kitchenerer wrote: Fri May 15, 2020 2:33 am
cupples wrote: Thu May 14, 2020 4:53 am Im running into the same issues.
it's a bug in Qnap software if a NIC adapter is created after container station is enabled, container station won't be able to utilize that later created NIC.
workaround is uninstall and re-install container station after all required NIC adapters are created first.
I tried this and unless I blow up full container station config it appears to stay stuck int he same state. I'm not willing to do that every time after the network changes given the way this environment needs to be used, that's significant work and for this use case it would be better to replace the nas with a linux box for file sharing and hosted containers if it a qnap release cant fix this clear bug in a reasonable amount of time.
drewy
Starting out
Posts: 12
Joined: Fri Feb 07, 2020 4:59 am

Re: Bridge container to different adapter

Post by drewy »

Do we know if this is something that is being worked on?
zqush
New here
Posts: 6
Joined: Sun Jun 03, 2018 2:08 am

Re: Bridge container to different adapter

Post by zqush »

I've just encountered the same issue. I thought I was doing something wrong, but it appears to be a problem with QNAP. I agree with what others have said, this bug pretty much makes qnap a useless nas for running containers / virtualisation unless you want to have everything on one lan. Not an option!

Frustrating!!!
Hank Moody
New here
Posts: 6
Joined: Tue Jun 27, 2017 8:26 pm

Re: Bridge container to different adapter

Post by Hank Moody »

Lost a day on it/ TS-853A FW 4.5.1
kitchenerer wrote: Mon May 06, 2019 9:51 pm turned out it's a bug in QTS.
you need to create and configure all network interfaces before install/initiate container station.
if a network interface is created after container station is enabled, the relevant interface won't show up in container's network settings
Had 17 containers running gracefully, deleted CS and all network settings, rebooted.

My (again) setup of Adapter&Virtual Switches
Image
Image
..you do know how long it actually takes qnap-fw to just rename a vSwitch..?

Installed CS.. aaand found this, what a pleasure!
Image

Impossible via cli either
docker network create VL30 --driver qnet --ipam-driver qnet --ipam-opt iface=eth3 --subnet=10.1.30.0/24 --gateway=10.1.30.254

Choosing the adapter and creating the container with fixed-ip will result in a newly created virtual switch that gets an ip of the adapter itself (which actually hasn't a real ip cause the vlan interfaces (if I'm right)).
Image

With macvlan you would have those options
docker network create VL30 --driver macvlan --subnet=10.1.30.0/24 --gateway=10.1.30.254 -o parent=eth2

BUT NO!, you have to use the qnet driver, and as long as support won't step in no chance. Ticket submitted.

Currently setting up a proxmox box.

WHAT AN INCREDIBLE WASTE OF TIME. THANKS QNAP! :`)
TruthBeTold
First post
Posts: 1
Joined: Thu Jan 02, 2020 6:09 am

Re: Bridge container to different adapter

Post by TruthBeTold »

After reading everything I could find and attempting to configure this myself for a Pi-hole container I was still unsuccessful. I opened a support ticket with QNAP to specifically ask if a VLAN address could be connected to a container as the only addressable interface. First QNAP diverted the question by responding that they do not support third party apps. After explaining the issue is not app specific and was actually part of the QTS setup QNAP replied that this could not be done. My device is running QTS 4.5.1.1495. If anyone has been able to find a work around please post that solution.

"Unfortunately, a VLAN address couldn't be assigned to a container station." QNAP 1/19/21
thisbeef
New here
Posts: 2
Joined: Thu Feb 04, 2021 4:19 am

Re: Bridge container to different adapter

Post by thisbeef »

I ran into the same issue too. Took me a day to find a sol.
So here is what I did.
SSH to your NAS
1. find the adapter you want to connect to. Mine is on eth4 vlan 30

Code: Select all

ifconfig

eth4.30 Link encap:Ethernet HWaddr
UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1
RX packets:1443 errors:0 dropped:0 overruns:0 frame:0
TX packets:720 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:377824 (368.9 KiB) TX bytes:144399 (141.0 KiB)

2. Create the network using docker command and named it "qnet-static-eth4-30"

Code: Select all

docker network create --driver=qnet --ipam-driver=qnet --ipam-opt=iface=eth4.30 --subnet 192.168.30.0/24 --gateway 192.168.30.1 qnet-static-eth4-30
3. Check if the network is created.

Code: Select all

docker network ls
NETWORK ID NAME DRIVER SCOPE
.....
0ce973ce9b43 qnet-static-eth4-30 qnet local

4. Create the docker using docker compose. I will use unifi controller as example.

Code: Select all

version: "2.1"
services:
  unifi-controller-test:
    networks:
      iot-docker:
        ipv4_address: 192.168.30.123

    image: ghcr.io/linuxserver/unifi-controller
    container_name: unifi-controller-test
    environment:
      - PUID=1000
      - PGID=1000
      - MEM_LIMIT=1024M #optional
    volumes:
      - /share/C/unifi:/config
      - /share/C/data:/var/run/unifi
    ports:
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 8443:8443
      - 1900:1900/udp #optional
      - 8843:8843 #optional
      - 8880:8880 #optional
      - 6789:6789 #optional
      - 5514:5514 #optional
    restart: unless-stopped
networks:
    iot-docker:
        external:
            name: qnet-static-eth4-30
Your container should be bridged to the VLAN. :)
thisbeef
New here
Posts: 2
Joined: Thu Feb 04, 2021 4:19 am

Re: Bridge container to different adapter

Post by thisbeef »

123.png
Here is the network diagram.
You do not have the required permissions to view the files attached to this post.
aoecv38a
First post
Posts: 1
Joined: Sun Mar 07, 2021 4:36 am

Re: Bridge container to different adapter

Post by aoecv38a »

I've been having the same issue with my qnap 230. I tried out the previous instructions via docker-compose without much luck. What I tried:

Code: Select all

ssh admin@192.168.1.87

ifconfig

...
wlan0     Link encap:Ethernet  HWaddr 34:0A:33:BA:84:85
          inet addr:192.168.1.87  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::360a:33ff:feba:8485%900610000/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26127963 errors:0 dropped:28 overruns:0 frame:0
          TX packets:13439910 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:27963212039 (26.0 GiB)  TX bytes:7880468837 (7.3 GiB)
...

docker network create --driver=qnet --ipam-driver=qnet --ipam-opt=iface=wlan0 --subnet 192.168.1.0/24 --gateway 192.168.1.1 qnet-static-wlan0
f9535f42d0d5cd7f4b60a2ce09972943d8186a8775212ecdf681302646273dd8
My docker-compose.yml:

Code: Select all

version: "2.1"
services:
  pihole:
    networks:
      pihole-docker:
        ipv4_address: 192.168.1.99

    image: pihole/pihole:latest
    container_name: pihole
    environment:
      TZ: 'America/United_States'
      WEBPASSWORD: asthecrowflies!
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    cap_add:
      - NET_ADMIN
networks:
    pihole-docker:
        external:
            name: qnet-static-wlan0
What happens when I try to bring it up:

Code: Select all

docker-compose up -d
Recreating pihole ... error

ERROR: for pihole  Cannot start service pihole: NetworkDriver.Join: list index out of range

ERROR: for pihole  Cannot start service pihole: NetworkDriver.Join: list index out of range
ERROR: Encountered errors while bringing up the project.
Anybody have any idea how I can debug this further?
elglatzico
New here
Posts: 2
Joined: Sun Mar 28, 2021 3:46 pm

Re: Bridge container to different adapter

Post by elglatzico »

Used the approach from user thisbeef (THX!) successfully (viewtopic.php?f=354&t=148328#p779221) to navigate around this bug with my QNAP TS-131P where like to have my pihole container connected to a VLAN.
This saves my the hassle of having to start from scratch with container station every time I like to add another VLAN.

First created the network as described, for me it was

Code: Select all

docker network create --driver=qnet --ipam-driver=qnet --ipam-opt=iface=eth0.10 --subnet 192.168.5.0/24 --gateway 192.168.5.1 qnet-static-eth0-10
Then created new folder in /share/CACHEDEV1_DATA/Container/container-station-data/lib/docker/containers where i put the yaml file.
Navigated to that folder and run docker-compose -up

Here is the adapted yaml for my pihole container (note that the correct name of the image is lexw ixlabs/pihole-pizero ...without the space, for some reason this is parsed wrong here)

Code: Select all

version: "2"
services:
  pihole-pizero-ExpressVPNNYv:
    networks:
      pihole-pizero-ExpressVPNNY:
        ipv4_address: 192.168.5.104

    image: lexwixlabs/pihole-pizero
    container_name: upihole-pizero-ExpressVPNNYv
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      TZ: 'America/Chicago'
      WEBPASSWORD: 'admin'
    volumes:
      - './etc-pihole/:/etc/pihole/'
      - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    cap_add:
      - NET_ADMIN
    restart: unless-stopped
networks:
    pihole-pizero-ExpressVPNNY:
        external:
            name: qnet-static-eth0-10
elglatzico
New here
Posts: 2
Joined: Sun Mar 28, 2021 3:46 pm

Re: Bridge container to different adapter

Post by elglatzico »

Add-on: although this is not the latest pihole version this one worked for me. Had to find one that works with arm32 due to my QNAP TS-131P. Other images gave me the infamous 'negative Values on Block list' error
Post Reply

Return to “Container Station”