[lxc-users] no ping between host and lxc container

Fajar A. Nugraha list at fajar.net
Tue Dec 20 10:04:08 UTC 2016

On Tue, Dec 20, 2016 at 3:07 AM, Andrey Repin <anrdaemon at yandex.ru> wrote:

> Greetings, mierdatutis mi!
> > Hi,
> > I've configured a container with ubuntu and my host with ubuntu also. My
> > idea is that they are in same lan with statics ip's.
> > For these I've configured macvlan.
> I don't see, how did you configure macvlan on host.

How you configure mvlan0 matters.

What I did in my host, is create a macvlan interface for the host, and move
host's eth0 IP address there.

relevant sections:
### /etc/network/interfaces
auto eth0
iface eth0 inet manual
        # address moved to macvlan-0
        up ip link add link eth0 v-0 type macvlan mode bridge || true
source /etc/network/interfaces.d/*.cfg

### /etc/network/interfaces.d/v-0.cfg
allow-hotplug v-0
iface v-0 inet static
        address X.X.X.X/24
        gateway Y.Y.Y.Y
        dns-nameservers A.A.A.A B.B.B.B

### from "lxc config show container_name"
    name: eth0
    nictype: macvlan
    parent: eth0
    type: nic

So I use host eth0 (now without IP, as its ip is moved to v-0, which is a
macvlan interface) as "parent" in lxd (this should be "lxc.network.link" in
lxc). If you have problems with flockport's guide, try my setup.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20161220/25c90e05/attachment.html>

More information about the lxc-users mailing list