PSA - A custom docker network using bond0 issue

I am running all my dockers off my NAS right now. It does a good job running them. I noticed an interesting situation when creating docker networks using the docker network cli on the NAS.

docker network create -d qnet --opt=iface=bond0--ipam-driver=qnet --ipam-opt=iface=bond0 --subnet 192.168.1.0/23 --gateway 192.168.1.1  qnet-static-bond0-custom

The above command creates a docker network using my LAG Bonded 10GB network. I then assign various Docker applications to the network.

The issue comes when I run that command, it creates a virtual switch under the networking adapter for my bonded 10GB and then the virtual switch takes the ip info that was assigned to adapter.

When this happens, you are not able to use the network and switch app in NAS GUI to change adapter info. All you can do is remove the docker network, then remove the virtual switch to get it back to original state.

That above command works fine if you tie it into a single adapter like eth0.

I dont know if this is a limitation of the network and switch app, or just non approved setup. It would be nice to be able to use my bonded 10GB as base for my docker apps, but for now standard eth0 is working.

Figure I share in case others are running more complex docker apps on their qnap nas.

Can’t you just do this in the Container Station GUI? I always select the network adapter I want to use for a particular container. You should be able to select the bonded adapter.

yeah you can use the normal GUI if you are doing a simple container pull deployment. That actually works fairly well.

But if you are doing a docker compose file with more advance networking needs, you can define a docker network in the file or via command line. So that how I found this out. I was creating the network so i can set various network parameters for a docker app.

In the docker compose file you can use the new docker networking by adding something like the below.

# under the app section add-
services:
  app:
    networks:
    qnet-static-bond0-custom:
      mac_address: xx:xx:xx:xx:xx:xx
      ipv4_address: 192.168.1.112

#end of compose file add
networks:
  qnet-static-bond0-custom:
    external: true

Yes, I do that in some of my YAML scripts. Does adding the bonded port via YAML not work right then?

i can use the setup with the bond0 and the docker app will work right. It just sets the networking up where the Network&Switch app in NAS GUI does not know how to display it correctly and then causes issues with if you need to change the adapter settings later. The docker app also shows up with missing adapter warning in the Network&Switch app. So just to make sure everything works, i just ended up using the eth0 when creating the docker networking and everything works as expected.

I dont know if the issue with Networking&Switch is due to not coding for that variance or what.

Even though the NAS supports bond0 setup, doesnt seem like all the apps make use of it correctly. Over time I had many tickets opened to get QNAP to fix using the bond0 network.

1 Like

Hi, thanks for your feedback! I’ll pass this along to our internal team to look into it and perform an analysis. Thank you!