<div dir="ltr"><div class="gmail_default" style="font-size:small">macvlan does not require router support. I use it everyday.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 2:32 PM, Marat Khalili <span dir="ltr"><<a href="mailto:mkh@rqc.ru" target="_blank">mkh@rqc.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>Hello,</p>
<p>I use lxc (not lxd!) with static IP addresses. Here's my config
(Ubuntu 16.04):</p>
<p>/etc/network/interfaces:<br>
</p><blockquote type="cite">auto br1<br>
iface br1 inet static<br>
bridge_ports eno1<br>
bridge_fd 0<br>
address 10... # host ip configuration follows<br>
</blockquote>
/etc/lxc/default.conf:<br>
<blockquote type="cite">lxc.network.type = veth<br>
lxc.network.link = br1<br>
lxc.network.flags = up<br>
lxc.network.hwaddr = 00:16:3e:xx:xx:xx<br>
</blockquote>
/var/lib/lxc/test/rootfs/etc/<wbr>network/interfaces:<br>
<blockquote type="cite">auto eth0<br>
iface eth0 inet static<br>
address 10... #container ip configuration follows<br>
</blockquote>
<p></p>
<p>You seem to use macvlan. It is explicitly designed to prevent
containers from talking to each other (they can only talk via
external router), and it complicates things, e.g. requires router
support (which might be a problem in your case). Unless you
specifically need this feature you may have better results (and
performance) with bridge like above.</p>
<p>Unfortunately, many places on the web teach people to configure
macvlan with containers without really explaining why.<br>
</p>
<pre class="m_-6437365352006919643moz-signature" cols="72">--
With Best Regards,
Marat Khalili
</pre><div><div class="h5">
<div class="m_-6437365352006919643moz-cite-prefix">On 20/10/16 20:33, Michael Peek wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
Hi gurus,<br>
<br>
I'm scratching my head again. I'm using the following commands to
create an LXC container with a static IP address:<br>
<br>
<blockquote># lxc-create -n my-container-1 -t download -- -d
ubuntu -r xenial -a amd64<br>
<br>
# vi /var/lib/lxc/my-container-1/<wbr>config<br>
<br>
Change:<br>
# Network configuration<br>
# lxc.network.type = veth<br>
# lxc.network.link = lxcbr0<br>
# lxc.network.flags = up<br>
# lxc.network.hwaddr = 00:16:3e:0d:ec:13<br>
lxc.network.type = macvlan<br>
lxc.network.link = eno1<br>
<br>
# vi /var/lib/lxc/my-container-1/<wbr>rootfs/etc/network/interfaces<br>
<br>
Change:<br>
#iface eth0 inet dhcp<br>
iface eth0 inet static<br>
address xxx.xxx.xxx.4<br>
netmask 255.255.255.0<br>
network xxx.xxx.xxx.0<br>
broadcast xxx.xxx.xxx.255<br>
gateway xxx.xxx.xxx.1<br>
dns-nameservers xxx.xxx.0.66 xxx.xxx.128.66 8.8.8.8<br>
dns-search my.domain<br>
<br>
# lxc-start -n my-container-1 -d<br>
</blockquote>
<br>
It failed to work. I reviewed my notes from past posts to the
list but found no discrepancies. So I deleted the container and
tried it on another host -- and it worked. Next I deleted that
container and went back to the first host, and it failed. Lastly,
I tried the above steps on multiple hosts and found that it works
fine on some hosts, but not on others, and I have no idea why. On
hosts where this fails there are no error messages, but the
container can't access the network, and nothing on the network can
access the container.<br>
<br>
Is there some step that I'm missing?<br>
<br>
Thanks for any help,<br>
<br>
Michael Peek<br>
<br>
<fieldset class="m_-6437365352006919643mimeAttachmentHeader"></fieldset>
<br>
</div></div><span class=""><pre>______________________________<wbr>_________________
lxc-users mailing list
<a class="m_-6437365352006919643moz-txt-link-abbreviated" href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.<wbr>linuxcontainers.org</a>
<a class="m_-6437365352006919643moz-txt-link-freetext" href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.<wbr>org/listinfo/lxc-users</a></pre>
</span></blockquote>
<br>
</div>
<br>______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.<wbr>linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.<wbr>org/listinfo/lxc-users</a><br></blockquote></div><br></div>