Quote:
Originally Posted by slac-in-the-box
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:
- Are the container networking types correct as labelled in this diagram above?
- Would the gateway containers actually need 4 virtual interfaces: one upstream, and three downstream?
- 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.