[Lxc-users] Regarding connecting containers to vlan

Fajar A. Nugraha list at fajar.net
Wed Oct 31 12:48:31 UTC 2012


On Wed, Oct 31, 2012 at 7:11 PM, Kalyana sundaram <kalyanceg at gmail.com> wrote:
> Thanks Fajar. Atlast I got the vlan thingy working
> I added 2 vlans to eth0 (eth0.211 and eth0.103) and connected them to bridge

You assigned eth0 (the trunk) to the bridge, right?

Just checking. Cause if you DON'T assign the trunk, but rather BOTH
vlan interface (eth0.211 AND eth0.103) to the SAME bridge, bad things
WILL happen :)

> br0 and used br0 as a link to container(veth)
> To reach the host I used another interface eth1

That's the easy way.

> (probably assigning ip to
> bridge br0 would have solved that problem)

If eth0 is the trunk, and you assign it on br0, you should be able to
create a vlan interface (e.g. br0.100) and put ip on that vlan
interface instead. Note that if you use this approach, you should NOT
create a vlan interface on top of the bridge using the vlan that you
pass thru to the container. That is, you must NOT create br0.211 and
br0.103.

There are ways around this though. For example, by creating another
veth pair, assigining one to the bridge, and create vlan on the pair
interface. It's somewhat a hassle, but should work.

Confused? Welcome to linux bridge :D

Openvswitch should be able to work around this cleanly, if you can
master the interface (don't rely on linux bridge compatibility code).

-- 
Fajar




More information about the lxc-users mailing list