LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 03-07-2021, 03:04 PM   #1
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Internal LXC Container Networking


I am trying to simulate my home network with LXC containers

my home network has this structure:

INTERNET
/\
|
|
\/
DSL MODEM
/\
|
|
\/
ETHERNET BRIDGE
/\
|
|
\/
/\
/..\
/.....\
WIRED ACCESS POINT .......WIRELESS ACCESS POINT
activitypub server ...................wireless guest
http server ...............................wireless guest
asterisk server.........................wireless guest


OOOPS--I just hit "post" instead of "preview", and wasn't ready to post this yet... So I tried to edit, wrote out a page of pertinent description, didn't see a preview changes, clicked "go advance" and ended up at blank new post, loosing that page of pertinent info... goofed up something, and will retype it all again shortly, after a 1 beer penalty for this infraction...

Last edited by slac-in-the-box; 03-07-2021 at 03:44 PM. Reason: hit "post" instead of "preview" and post is not ready yet
 
Old 03-07-2021, 05:32 PM   #2
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780

Original Poster
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
veth, vlan, macvlan/vepa, macvlan/bridge, macvlan/passthru -- help

Quote:
Originally Posted by slac-in-the-box View Post
I am trying to simulate my home network with LXC containers

my home network has this structure:

INTERNET
/\
|
|
\/
DSL MODEM
/\
|
|
\/
ETHERNET BRIDGE
/\
|
|
\/
/\
/..\
/.....\
WIRED ACCESS POINT .......WIRELESS ACCESS POINT
activitypub server ...................wireless guest
http server ...............................wireless guest
asterisk server.........................wireless guest


OOOPS--I just hit "post" instead of "preview", and wasn't ready to post this yet... So I tried to edit, wrote out a page of pertinent description, didn't see a preview changes, clicked "go advance" and ended up at blank new post, losing that page of pertinent info: goofed something, and will retype all shortly, after a 1 beer penalty for this infraction...
OK... belch... sorry about that, back on track:

From man page for lxc, I've read about network types none, empty, veth, vlan, and macvlan, the latter which is then subdivided into mavlan/vepa, macvlan/bridge, macvlan/passthru. The LXC networking examples that I've seen thus far are creating bridges on lxc host, and then connecting containers via the container networking type veth. However, I haven't seen too many examples using macvlan, and believe that it will be needed to achieve the simulation of my home network.

To simulate my home network's ethernet bridge, I believe I will need a container with three virtual interfaces, all of type macvlan/bridge: one to connect to the bridge on the lxc-host, and the other to connect to both the wired and wireless gateway containers. (I wrote "access point" in my first diagram, but a gateway and an access point are the same thing, imho, with gateway being more accurate from technical pov)

For each gateway, I will need containers with two virtual interfaces, one to connect to ethernet bridge container, and other to connect to their respective wired or wireless virtual lans. Will these interfaces in these gateway containers need networking type macvlan/passthru?

And finally, I will need containers to simulate the wired servers or wireless guests, and I believe those containers will only need single virtual interfaces with type macvlan/passthru.

So here's a diagram of what I'm going to try, a network of lxc containers simulating my home network, with each container's virtual interface labeled by network type:
Code:
INTERNET /\ | | \/ LXC HOST lxc-host's-bridge /\ | | \/ macvlan/bridge ETHERNET BRIDGE CONTAINER macvlan/bridge ....... macvlan/bridge /\ ............................ /\ | ............................. | | ............................. | | ............................. | \/ ............................ \/ veth...........................veth WIRED GATEWAY .......WIRELESS GATEWAY macvlan/passthru ....................macvlan/passthru /\ ....................................... /\ | ........................................ | | ........................................ | | ........................................ | ACTIVITYPUB <-macvlan/passthru-> | ........................................ | <-macvlan/passthru-> GUEST0 ......... ..... HTTP <-macvlan/passthru-> | ....................................... | <-macvlan/passthru-> GUEST1 ASTERISK <-macvlan/passthru-> | ....................................... | <-macvlan/passthru-> GUEST2 ...
Questions that arise:
  1. Are the container networking types correct as labelled in this diagram above?
  2. Would the gateway containers actually need 4 virtual interfaces: one upstream, and three downstream?
  3. What's the syntax, in a container configuration file, to tell a macvlan/passthru interface about which passthru interface of which container the "other end" is connected to? (Imagining a virtual pass-thru ethernet cable as having ends)

Fwiw, I'm trying this simulation on lxc-4.0.3 on a slackware15-alpha host; but figured this question would apply to lxc in all distros, and posted here instead of in the slackware or networking forums, as the macvlan bridge/vesa/passthru seems specific to lxc networking.

Last edited by slac-in-the-box; 03-07-2021 at 07:38 PM. Reason: put diagram in code blocks to enable scrolling on small screens
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXC Container: sound Not working charlie101 Linux - Virtualization and Cloud 11 04-14-2020 01:15 AM
[SOLVED] "lxc list" vs "lxc-ls" yknivag Linux - Virtualization and Cloud 1 03-09-2017 05:53 AM
[SOLVED] Outputting X display from inside an LXC Container charlie101 Linux - Virtualization and Cloud 1 02-04-2013 09:41 PM
script to get a lxc-container like iso of current. cod_liver_0il Slackware 1 09-10-2012 11:12 AM
How to end a Linux Container (LXC) from within? Skaperen Linux - Virtualization and Cloud 0 06-14-2011 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 08:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration