<div dir="ltr"><div>You cannot have a macvlan bridge on an bridge interface, only on a real ethernet device, like eth0, eth1, etc. <br></div>if you want to use a bridge, then use<br><br>lxc.network.type = veth<br>lxc.network.flags = up<br>lxc.network.link = br0<br><a href="http://lxc.network.name">lxc.network.name</a>= eth1<br>lxc.network.hwaddr = 00:de:f0:ca:d4:32<br>lxc.network.ipv4 = <a href="http://0.0.0.0/24">0.0.0.0/24</a><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 22, 2014 at 6:51 PM, Erik Haller <span dir="ltr"><<a href="mailto:erik.haller@gmail.com" target="_blank">erik.haller@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Here is my production configuration:<br><br><div style="margin-left:40px"><span class="">lxc.network.type = macvlan<br>lxc.network.macvlan.mode = bridge<br>lxc.network.flags = up<br></span>lxc.network.link = eth0 <br>lxc.network.ipv4 = <a href="http://192.168.7.70/16" target="_blank">192.168.7.70/16</a><br>lxc.network.ipv4.gateway = 192.168.7.1<br># ...# mounts point<br><br>lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0<br>lxc.mount.entry = sysfs sys sysfs defaults  0 0<br><br></div><div style="margin-left:40px"># /lib/modules is needed for iptables/ufw<br></div><div style="margin-left:40px">lxc.mount.entry = /lib/modules /var/lib/lxc/lemon/rootfs/lib/modules none ro,bind 0 0<br></div><div style="margin-left:40px"># Nice to mount host home directories<br></div><div style="margin-left:40px">lxc.mount.entry = /home /var/lib/lxc/lemon/rootfs/home none rw,rbind 0 0<br><br># network interface name is limited to 16 chars<br>lxc.hook.pre-start = /bin/sh -c "exec mount -n -o remount,rw /var/lib/lxc/lemon/rootfs" <br>lxc.hook.pre-start = /bin/sh -c "ip link add link eth0 name lemon type macvlan mode bridge && ip link set lemon up"<br>lxc.hook.pre-start = /bin/sh -c "ip route add 192.168.7.70 dev lemon || true"<br><br>lxc.hook.post-stop = /bin/sh -c "ip route del 192.168.7.70 || true"<br>lxc.hook.post-stop = /bin/sh -c "ip link set lemon down && ip link del lemon"<br>lxc.hook.post-stop = /bin/sh -c "exec mount -n -o remount,rw /var/lib/lxc/lemon/rootfs"<br></div><br></div><font face="arial,helvetica,sans-serif">Couple of notes:<br></font><ol><li><font face="arial,helvetica,sans-serif">This a Debian lxc </font>0.9.0-aplha3 system. Works fine with lxc-stop|lxc-start. It's been in production ~ year.<br></li><li>Hostname: lemon, change hostname throughout.<br></li><li>Disable br0 bridge. Reboot. Try the above setup and get it running. macvlan and older bridging may be incompatible in linux.<br></li><li>Change your lxc.network.link to eth0, do not use br0.</li><li>Don't enable ip_forward. I don't have it enabled.</li><li>Don't set the mac address. Remove lxc.network.hwaddr</li><li>Note: macvlan takes 10-30 seconds of pinging from a different host after lxc-start. This is normal.<br></li></ol><div><div><div style="margin-left:40px"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Sep 22, 2014 at 7:43 AM, Chris Kloiber <span dir="ltr"><<a href="mailto:ckloiber@cedardoc.com" target="_blank">ckloiber@cedardoc.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Trying to wrap my mind around the lxc networking. I need to configure each container with it’s own static IP on the same subnet as the host. I
<span style="font-weight:bold">think</span> that requires a “macvlan/bridge” setup like this:</div>
<div><br>
</div>
<div>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
lxc.network.type = macvlan</p>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
lxc.network.macvlan.mode = bridge</p>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
lxc.network.flags = up</p>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
lxc.network.link = br0</p>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
lxc.network.ipv4 = <a href="http://10.0.0.11/24" target="_blank">10.0.0.11/24</a> 10.0.0.255</p>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
lxc.network.ipv4.gateway = 10.0.0.1</p>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
<a href="http://lxc-network.name" target="_blank">lxc-network.name</a> = eth0</p>
</div>
<p style="margin:0px;font-size:13px;font-family:'Lucida Console';color:rgb(245,245,245);background-color:rgb(0,0,0)">
lxc.network.mtu = 1500</p>
<div><span style="background-color:rgb(0,0,0);color:rgb(245,245,245);font-family:'Lucida Console';font-size:13px">lxc.network.hwaddr= 00:16:3e:97:81:42</span></div>
<div><br>
</div>
<div>But this goes nowhere. The host does have a properly configured br0 device (this is an ol6 system, btw) and <span style="background-color:rgb(0,0,0);color:rgb(245,245,245);font-family:'Lucida Console';font-size:13px">net.ipv4.ip_forward =</span><span style="background-color:rgb(0,0,0);color:rgb(245,245,245);font-family:'Lucida Console';font-size:13px"> 1</span> Is
 enabled. The host iptables are disabled. </div>
<div><br>
</div>
<div>I’ve been beating my head against this for a week now. Please help, or tell me what other information I can provide. Thank you.</div>
<div><br>
</div>
<div><br>
</div>
<div>— </div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt"><b><font color="#0433ff"><i>Chris Kloiber</i></font></b></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt"><b>CEDAR Document Technologies<u></u><u></u></b></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt">One Ravinia Drive, Suite 200<u></u><u></u></p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt">Atlanta, GA 30346</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt"><a href="tel:1%28404%29436-2470" value="+14044362470" target="_blank">1(404)436-2470</a> (office)</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt"><a href="tel:1%28678%29512-9636" value="+16785129636" target="_blank">1(678)512-9636</a> (cell)</p>
<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt"><br>
</p>
</div>
</div>
<div><img src="cid:B1F380DE-0953-4EB2-A8B5-270AD86DD288" type="image/png"></div>
</div>
</div>

<br></div></div>_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br></blockquote></div><br></div>