<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On the host, if I assign the host ip
configuration to br1, don't I need to change something about the
eno1 configuration?<br>
<br>
Michael<br>
<br>
On 10/20/2016 02:32 PM, Marat Khalili wrote:<br>
</div>
<blockquote cite="mid:95351a36-23f9-b5a0-85b0-1beab774c1e5@rqc.ru"
type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<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/network/interfaces:<br>
<blockquote type="cite">auto eth0<br>
iface eth0 inet static<br>
address 10... #container ip configuration follows<br>
</blockquote>
<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="moz-signature" cols="72">--
With Best Regards,
Marat Khalili
</pre>
<div class="moz-cite-prefix">On 20/10/16 20:33, Michael Peek
wrote:<br>
</div>
<blockquote
cite="mid:e922aad9-4d7a-3a82-a45d-887165137938@nimbios.org"
type="cite">
<meta http-equiv="content-type" content="text/html;
charset=utf-8">
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/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/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="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
lxc-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
lxc-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></pre>
</blockquote>
<br>
</body>
</html>