2 x NIC / Container - 1 to Internet and 1 to Other Container


I have to connect three containers in such a way that A - LXC will directly connected with B - LXC and C LXC, and at the same time I need to extend Internet on A, B and C containers.

Using Ubuntu 18.04, what will the NIC setting.

To help us, please can you describe the use case and why a single bridge is not sufficient?

I am from the training background and conducting training for Aisa Pacific.

I am developing a prototype for participants to use containers rather than VM due to participants memory and ram issues.

So connect a container as mentioned, please advise.

Can anyone tell me the bridge setting to connect the containers @ mentioned topology.

You can use two veth NICs connected to different bridges. One external and one internal.

Thanks tomp.

Can you guide me how to do this !

Are you using LXC or LXD?

I am using LXC

So you can add a nic to an lxc container and connect it to a bridge (in this case lxcbr0) using a snippet of config like this:

lxc.net.0.type = veth
lxc.net.0.flags = up
lxc.net.0.link = lxcbr0
lxc.net.0.name = eth0

Then you can add another NIC connected to a different bridge as follows:

lxc.net.1.type = veth
lxc.net.1.flags = up
lxc.net.1.link = br-private
lxc.net.1.name = eth1

Configuring a bridge is explained here: https://netplan.io/examples#configuring-network-bri

Thank you Tomp.

I am able to ping the v4 and v6 interfaces.

Thank you for the support.