Hilscher Forum
Generate VLAN interfaces in container - Printable Version

+- Hilscher Forum (https://forum.hilscher.com)
+-- Forum: netPI - Ruggedized Raspberry Pi with Industrial Ethernet (https://forum.hilscher.com/Forum-netPI-Ruggedized-Raspberry-Pi-with-Industrial-Ethernet)
+--- Forum: Software (https://forum.hilscher.com/Forum-Software)
+--- Thread: Generate VLAN interfaces in container (/Thread-Generate-VLAN-interfaces-in-container)



Generate VLAN interfaces in container - FrankJacob - September-19th-2019

Hey there,

is it possible to create several vlan interfaces in a conainer to set up a multicast-relay?

Regards Frank


RE: Generate VLAN interfaces in container - Patrick@netPI - September-19th-2019

Hi Frank,

our Docker Runtime supports the "macvlan" driver.
https://docs.docker.com/v17.09/engine/userguide/networking/get-started-macvlan/

You can define this kind of interfaces with the preinstalled docker management tool Portainer.
https://www.portainer.io/2018/09/using-macvlan-portainer-io/

Best Regards
Patrick


RE: Generate VLAN interfaces in container - FrankJacob - September-24th-2019

OK but i think this is not what i mean. We have serveral VLANs in our Network and i need a container that can connect to some of these VLANs. So the LAN port of the netPi has to be trunk and i have to configure the vlan settings on the netPi. Is this possible?


RE: Generate VLAN interfaces in container - Armin@netPI - September-24th-2019

I have one question. Do you succeed to setup this scenario on a standard Raspberry Pi before? I mean without the usage of Docker, just plain Raspbian OS?

Thx
Armin


RE: Generate VLAN interfaces in container - FrankJacob - September-24th-2019

Yes, i configured serveral virtual network interfaces with parent device eth0. The virtual devices are eth0.10 eth0.20 and so on. They have access to the several vlans. The problem i think is that it is not possible to configure these vlan devices for the docker host and therfor in my opinion it is not possible to get access to a vlan from a container.

What i want to do is something like this:
[Image: multi_tenant_8021q_vlans.png]

Can i use a USB/LAN adapter and configure all network parameters in a container? So that i don't have to use the eth0 interface of the netPi.


RE: Generate VLAN interfaces in container - Armin@netPI - September-24th-2019

Ok I see.

Let me repeat what I have understood:

a.) till today you realized everything on the Raspberry Pi under Raspbian - which works fine -. I suppose you are using the "apt-get install vlan" command to install vlan support on your standard Raspberry Pi, right?

b.) and you did not repeat the same test on your Raspberry Pi using a Docker container yet? I am asking cause your picture shows a Docker Host and several containers, so have you realized the very same setup already on your Raspberry Pi using this setup and Docker techniques successfully?

Sorry for asking these questions  .. you see we do not have any experience collected yet used vlan tagging.

I can confirm that using a USB to LAN adapter like based on Realtek chip RTL8153 works on netPI since the chip driver is included in the netPI host Linux. Once you plug it in you have a eth1, eth2 ... port instantly.

Thx
Armin


RE: Generate VLAN interfaces in container - FrankJacob - September-25th-2019

(September-24th-2019, 04:16 PM)Armin@netPI Wrote: Ok I see.

Let me repeat what I have understood:

a.) till today you realized everything on the Raspberry Pi under Raspbian - which works fine -. I suppose you are using the "apt-get install vlan" command to install vlan support on your standard Raspberry Pi, right?

b.) and you did not repeat the same test on your Raspberry Pi using a Docker container yet? I am asking cause your picture shows a Docker Host and several containers, so have you realized the very same setup already on your Raspberry Pi using this setup and Docker techniques successfully?

Sorry for asking these questions  .. you see we do not have any experience collected yet used vlan tagging.

I can confirm that using a USB to LAN adapter like based on Realtek chip RTL8153 works on netPI since the chip driver is included in the netPI host Linux. Once you plug it in you have a eth1, eth2 ... port instantly.

Thx
Armin

a.) Yes it is working fine with a standard RaspberryPi and Raspbian. Yes i used the vlan package to set up the system.

b.) I tried to use the vlan package in a docker container but this is not working. The configuration parameters are stored normaly in /etc/network/interfaces.d/ and this folder is missing in a container. These parameter have to be loaded on startup and i don't know how to do this without the network deamon in the container.

I tried a USB/LAN adapter and i can see the eth1 in the control panel. But it is the same as with the eth0, i can not configure it in the container...


RE: Generate VLAN interfaces in container - Armin@netPI - September-26th-2019

Hi there, I checked VLAN with netPI and it works.

My notebook network card and my netPI are in the same office network. My netPI eth0 official ip address is 10.11.5.13 received through the office dhcp server and my my notebook network card I configured to 172.20.10.129 which is totally out of scope of the office network.

Fitting to this 172.20.10.129 address then I setup corresponding VLAN configuration

[attachment=133]

and then a netPI VLAN network as next

[attachment=134]

and finally I started a container with this network setup on my netPI.

[attachment=133]

Immediately after the container deployment I was able to ping the container at 172.20.10.128 from my notebook since the container got member of the configured VLAN network running on netPI across eth0 (which physically has 10.11.10.13 as IP address)

Thx
Armin