<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks a lot Fajar,<div class=""><br class=""></div><div class="">I did :</div><div class=""><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> lxc config device add welcome-lemur eth1 nic nictype=bridged parent=brvlan3904 name=eth1</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">And ‘brctl show' shows the interface </span>‘<font face="Monaco" size="2" class="">veth41aa07e1’ </font>was added to the brvlan3904 bridge.</div></div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">What I don’t get is where to find the documentation for this. I thought I had to look to in “man lxc.container.conf” but I don’t find any reference to network type ‘bridge' (found macvlan, veth,…) …</div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">But it works.</div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">Thanks</div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255);" class="">Michel</div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div><blockquote type="cite" class=""><div class="">On 16 Jun 2017, at 13:14, Fajar A. Nugraha <<a href="mailto:list@fajar.net" class="">list@fajar.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 16, 2017 at 5:01 PM, Michel Jansens <span dir="ltr" class=""><<a href="mailto:michel.jansens@ulb.ac.be" target="_blank" class="">michel.jansens@ulb.ac.be</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class="">Thanks a lot Stéphane for this information,<div class=""><br class=""></div><div class="">I succeeded in attaching a bridge device from a specific vlan following your advise from <a href="https://github.com/lxc/lxd/issues/2551" target="_blank" class="">https://github.com/lxc/<wbr class="">lxd/issues/2551</a></div><div class="">command I used is: <span style="font-family:Monaco;font-size:10px;background-color:rgb(255,255,255)" class="">lxc config device add welcome-lemur eth1 nic nictype=macvlan parent=brvlan3904 name=eth1</span></div><div class=""><span style="font-family:Monaco;font-size:10px;background-color:rgb(255,255,255)" class=""><br class=""></span></div><div class="">In /etc/network/interfaces I added:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">#vlan 3904 interface on enp1s0f0</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">auto vlan3904</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">iface vlan3904 inet manual</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">        vlan_raw_device enp1s0f0</span></div></div><div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><div style="font-family:Monaco;font-size:10px;margin:0px;line-height:normal" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">#add a bridge for vlan3904</span></div><div style="font-family:Monaco;font-size:10px;margin:0px;line-height:normal" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">auto brvlan3904</span></div><div style="font-family:Monaco;font-size:10px;margin:0px;line-height:normal" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">iface  brvlan3904 inet  manual</span></div><div style="font-family:Monaco;font-size:10px;margin:0px;line-height:normal" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">       bridge_ports vlan3904</span></div><div style="font-family:Monaco;font-size:10px" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><br class=""></span></div><div style="font-family:Monaco;font-size:10px" class=""><span style="font-family:Helvetica;font-size:12px" class=""><br class=""></span></div><div class="">I managed to add the brvlan3904 to multiple containers, but this doesn’t create an interface for each container in the brvlan3904 bridge, </div></span></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">That's what macvlan does. It works for some usecase (and can be easier, since you DON'T need to create a bridge), but can cause some problems (e.g. host can't connect to container's macvlan interface).</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><div class="">and I don’t know what the security consequences are… </div><div class="">Is This OK like this?</div><div style="font-family:Monaco;font-size:10px" class=""><span style="font-family:Helvetica;font-size:12px" class=""><br class=""></span></div><div style="font-family:Monaco;font-size:10px" class=""><span style="font-family:Helvetica;font-size:12px" class=""><br class=""></span></div></span></div><div class="">Alternatively, to mimic how lxc br0 bridge looks (one interface for each container with vethXXXXXX like names), I tried to add more ports to the bridge,with dummy interfaces: </div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">ip link add welcomelemur type dummy</span></div></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">brctl addif brvlan3904 welcomelemur</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">ifconfig welcomelemur up</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">lxc config device add welcome-lemur eth1 nic nictype=macvlan parent=brvlan3904 name=eth1</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""><span style="font-family:Helvetica;font-size:12px" class=""><br class=""></span></span></div><div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)" class=""><span style="font-variant-ligatures:no-common-ligatures" class="">But this gave me: </span><span style="font-family:Monaco;font-size:10px" class="">error: Failed to create the new macvlan interface: exit status 2</span></div><div class="">I tried using nictype=veth instead of mtacvlan but got '<span style="font-family:Monaco;font-size:10px;background-color:rgb(255,255,255)" class="">error: Bad nic type: veth</span><font face="Monaco" size="2" class="">’</font> </div><div class=""><br class=""></div><div class="">How should I do this properly?</div><div class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Did you want "nictype=bridged"?</div><div class=""><br class=""></div><div class=""><a href="https://github.com/lxc/lxd/blob/master/doc/containers.md#type-nic" class="">https://github.com/lxc/lxd/blob/master/doc/containers.md#type-nic</a><br class=""></div><div class=""><br class=""></div><div class="">-- </div><div class="">Fajar</div></div></div></div>
_______________________________________________<br class="">lxc-users mailing list<br class=""><a href="mailto:lxc-users@lists.linuxcontainers.org" class="">lxc-users@lists.linuxcontainers.org</a><br class="">http://lists.linuxcontainers.org/listinfo/lxc-users</div></blockquote></div><br class=""></div></body></html>