Link to home
Create AccountLog in
Avatar of beatified
beatifiedFlag for United States of America

asked on

Docker container conneced to 802.11Q Network

This one is really getting to me. I would like to run most of my docker containers by connecting them to a vlan on my Ubiquiti network but cant seem to get it working. although admittedly I don't know much about docker and I'm still very new to it.

I have tried creating a macvlan for one of the networks and that seems to be alright but I cant seem to get my containers connected to it.

I would like to connect to my vlan at 192.168.20.0/24 just doing that with an nginx container or something would be a great example for me to go by.

Thanks in advance for your help.

Stuart
Avatar of noci
noci

802.11q does not exist....

it is 802.11  (which is WiFi) a carrier for signals

of 802.1 (a method for data transfer using a variety of carriers), 802.3 for ethernet, 802.4 for token bus, 802.5 for tokern ring, 802.11 for wireless).


802.1q is a standard for 802.1 to multiplex multiple "networks" across one cable. (and thus allow multiple virtual lans to exist in a network).

802.1q adds 4 bytes to each packet, 2 bytes indicate that it is a 802.1q tag and 2 bytes carrying the priority & vlan "tag"


MACvlan is something else completely It's more like a bridge done differently, and besides the host doing the separation the network is one mixed pool of packet no separation.


The following article may help a bit:

https://sreeninet.wordpress.com/2016/05/29/macvlan-and-ipvlan/



Avatar of beatified

ASKER

Thanks for correcting me on my misunderstanding. Having read the article you shared I believe what I would like to try to use is MACvlan


root@ubuntu_server:/home/beatified# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
07ebf1438c44        bridge              bridge              local
531f76dbf73a        hassio              bridge              local
84518888339f        home-macvlan        macvlan             local
ea325f18008d        host                host                local
fe61df62865e        none                null                local

Open in new window

root@ubuntu_server:/home/beatified# docker network inspect home-macvlan
[
    {
        "Name": "home-macvlan",
        "Id": "84518888339f9f25ceca2120ae6611b0407687190640d55dddd18656fa12854c",
        "Created": "2020-02-06T21:37:54.348743211Z",
        "Scope": "local",
        "Driver": "macvlan",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.20.0/24",
                    "Gateway": "192.168.20.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {
            "parent": "ens160.20"
        },
        "Labels": {}
    }
]


Open in new window

This is what I've got at this point. I dont know if its correct at all but your advise would be very welcomed. For the time being attaching a simple nginx instance to this network would teach me what I need to know.


If you can help me further I would be very grateful.


Thanks

You seem to have a 802.1q vlan with tag 20 (derived from the name of the interface:  ens160.20 )


Did you configure VLAN 20 anywhere else on the link to ens190?

If not then better drop the .20...

No I didn't but the idea was to connect it to vlan 20. Is this possible?

ok VLAN 20 can be used,  you need vlan 20 on all the equipment connected to this device.

And this vlan 20 needs to be the the 192168.20.0/24 address range and the default gateway in the network needs to be: 192.168.20.1 ( and is not your docker host, but the router that connects to the other networks.).


So I have VLAN 20 configured on the network but ens190 is not configured to use that vlan specifically. It is available on the wire but the nic is not connected via that vlan. Does this nic need to be configured on vlan 20 first? If so I will just buy some pcie nics and add some capability to my server.

The fact you specified ens190.20 (the .20) makes docker create the needed VLAN on the interface.

You can interact with ens190.20 if your switch produces a taged vlan20 on the other end of the cable.

Most modern adapter can handle VLANs (which are >1500 byte packets. )


So as of right now its not working and I wonder if it has to do with the fact that Docker is running on Ubuntu Server as a VM on ESXi 6.7. Could that be an issue?

ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I think I had to specifiy a driver this was likely my issue all along. On top of the fact that I needed to learn more about how to spin up containers and the possible switches and arguments.

The issue seems to be resolved.

Thanks for your help.
No problem, good luck.