Adding container networking using macvtap


Recommended Posts

I'm migrating back to Unraid. It had been a while since I used it, and unsurprisingly, it was outdated. My distro was on 6.10, missing out on ZFS and the new networking approach to container networking, which I found out about skimming the release notes.

 

I keep a file of my (successful) docker run commands that (re)deploys my containers as if they never stopped running when migrated. No need for compose — I kind of loathe compose. =P

 

I digress, now running 6.12, on the macvtap thing, I deployed a random container to see what syntax would present Unraid so I could use it to adapt my notes/script my file to accordingly, but the only difference is the network; now goes by the Linux's interface name rather than the custom name I had defined networks with. Below is the syntax I used pre-Unraid 6.12 to deploy containers.

 

containerName=fxn
docker stop "$containerName" ; docker rm "$containerName" ; docker run \
--detach \
--restart 'always' \
--name "$containerName" \
--network 'z0a00' \
--ip '10.10.0.44' \
--ip6 '2001:db8:db9:a00::2c' \
--mac-address '00:50:56:0a:00:2c' \
--hostname 'fxn.proxy.domain.tld' \
--cpus '1' \
--memory '2048MB' \
--ulimit 'nofile=65536:65536' \
-v "/mnt/user/containerbridge/$containerName/config":"/config" \
-v "/mnt/user/containerbridge/$containerName/data":"/data" \
-v "/mnt/user/fxn":"/mnt/user/fxn" \
-v "/netvol/zx0_one/":"/one" \
-v "/netvol/zx0_dtwo":"/two" \
-v "/netvol/zx0_three":"/three" \
-v "/netvol/zx0_four":"/four" \
-e 'TZ=America/New York' \
-e 'PUID=2088' \
-e 'PGID=35538' \
fxn/fxn

 

On 6.12, z0a00 was changed for bond0.10, --network was also shortened to --net, or perhaps it's just auto-completing it, sort of like the ip command does.

containerName=fxn
docker stop "$containerName" ; docker rm "$containerName" ; docker run \
--detach \
--restart 'always' \
--name "$containerName" \
--net 'bond0.10' \
--ip '10.10.0.44' \
--ip6 '2001:db8:db9:a00::2c' \
--mac-address '00:50:56:0a:00:2c' \
--hostname 'fxn.proxy.domain.tld' \
--cpus '1' \
--memory '2048MB' \
--ulimit 'nofile=65536:65536' \
-v "/mnt/user/containerbridge/$containerName/config":"/config" \
-v "/mnt/user/containerbridge/$containerName/data":"/data" \
-v "/mnt/user/fxn":"/mnt/user/fxn" \
-v "/netvol/zx0_one/":"/one" \
-v "/netvol/zx0_dtwo":"/two" \
-v "/netvol/zx0_three":"/three" \
-v "/netvol/zx0_four":"/four" \
-e 'TZ=America/New York' \
-e 'PUID=2088' \
-e 'PGID=35538' \
fxn/fxn

 

When I tried it, I got errors with both, one of them I sort of expected, the other I'm not sure I understand:

 

With the new syntax:

WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.

 

With the old syntax (and old network)

docker: Error response from daemon: network z0a00 not found.

 

There were also -l options, but it seemed to be related to metadata of the container so Unraid would pick them up for management in its GUI.

-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.webui=…
-l net.unraid.docker.icon=…

and:

-e HOST_OS=…
-e HOST_HOSTNAME=…
-e HOST_CONTAINERNAME=…

Doesn't seem related to networking at all …maybe HOSTNAME, but it's a stretch.

 

How is networking added to containers now (via the CLI)??

Thanks.

 

 

 

Edited by vitaprimo
typos
Link to comment
  • vitaprimo changed the title to Adding container networking using macvtap

Never mind,

 

Just as I posted this I realized I was referencing a MAC address in the container definition, however, that wasn't even it. It was IPv6.

There's full IPv6 support in the network, including containers, there has always been, but somehow despite each of Unraid's interfaces being dual stacked, and all of the IPv6 information appears in the Docker section of the settings; it's not working.

 

I also got again the "WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap." message, but at least it deploys the containers now.

 

I'll look it up later, I need some sleep. =/ Thanks anyway!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.