[lxc-users] sticky ethernet device order in container

Janjaap Bos janjaapbos at gmail.com
Thu Jun 4 19:26:04 UTC 2015


They are on different bridges. The config only has the additional nic,
which should be eth1, and usually is.
The eth0 nic is defined in the default profile, which is referred to in the
config.

I will test further, just to rule out confusion at my side. It is good to
know that the order should be as in the config. Maybe it is related to
applying the profile to the config.


2015-06-04 17:26 GMT+02:00 Serge Hallyn <serge.hallyn at ubuntu.com>:

> Quoting Janjaap Bos (janjaapbos at gmail.com):
> > When using multiple nics in the container, the order sometimes changes
> > after a restart.
> > So eth0 becomes eth1, vice versa.
>
> That really shouldn't happen.  lxc adds the nics in a specific order
> (according to the config).  Are eth0 and eth1 on different bridges?
> Or perhaps I should ask - how do you determine that they've "switched
> order"?
>
> > when using LXD, how is this order determined?
> > There is no entry for eth0 in the config, since that is a standard lxc
> > network device.
> > Only the additional network device is added in the container config:
> > e.g.
> >
> > name: c1
> > profiles:
> > - default
> > config:
> >   raw.lxc: |
> >     lxc.mount.entry = /var/lib/lxd/lxc/c1/devices/net/tun dev/net/tun
> none
> > bind,create=file 0 0
> >     lxc.mount.entry = /var/lib/lxd/lxc/c1devices/kvm dev/kvm none
> > bind,create=file 0 0
> >     lxc.mount.entry = /var/lib/lxd/lxc/c1/devices/fuse dev/fuse none
> > bind,create=file 0 0
> >   volatile.baseImage:
> > a4066a730e6b3d8021dcc7d0c59f2c37624ffdb60d10f1e09c336e4e1631915c
> >   volatile.eth0.hwaddr: 00:16:3e:33:3c:c2
> >   volatile.br0.hwaddr: 00:16:3e:5b:4f:19
> > devices:
> >   br0:
> >     parent: br0
> >     type: nic
> > ephemeral: false
> >
> >
> > Both nics have a volatile entry (done by lxc or lxd ?)
> >
> > Sometime after a restart the nics have switched order in the container.
> > This of course messes up the network config in the container.
> >
> > How can I make the eth0 and eth1 order stick?
> >
> > Thanks for your help!
> >
> > -Janjaap
>
> > _______________________________________________
> > lxc-users mailing list
> > lxc-users at lists.linuxcontainers.org
> > http://lists.linuxcontainers.org/listinfo/lxc-users
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150604/ec21fe3f/attachment.html>


More information about the lxc-users mailing list