Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
network interfaces are 'up' automatically #2063
Comments
|
That's been done by default for all LXC containers for the past 4 years or so (at least). We've replicated the logic in LXD as a bunch of LXC containers based on busybox or similar seem to expect it. |
|
Is this behavior causing some kind of problem for you? |
that is the default config that 'lxc launch xenial' will render. but if the user provides something that says 'name' of 'en0' then cloud-init wants to do what the user said and rename that device to 'en0'. it seems like "layering violation" of sorts for lxd to bring network devices up. |
|
Well, I suspect the reason to bring it up in the first place was for containers that didn't run cloud-init or in fact any kind of network configuration tool. In such case, the interface would be brought up and get a functional IPv6 address + link-local address from the kernel. I don't think special-casing containers in cloud-init is the right answer, but maybe you can bring the interface down for rename if it doesn't have any manually configured address yet? You can check that (properly ignores automatic addresses and link local) with:
This would also cover the case where on a normal system, something in the initrd brought the interface up and didn't bring it back down before switching to init (I don't believe we have such a thing in default Ubuntu, but it's not impossible). |
pushed a commit
to henrysher/cloud-init
that referenced
this issue
Jun 3, 2016
stgraber
closed this
Jun 7, 2016
|
For later reference, cloud-init now will feel free to take an interface down if the only addresses it has are as listed above and it needs to rename the interface. If it took it down, it will bring it back up. |
smoser commentedMay 31, 2016
•
Edited 1 time
-
smoser
May 31, 2016
why is my network device 'up' when nothing in my init system has configured it so?
i've attached lxc-chroot, it just does a container without a real init system to avoid booting the system but still look around inside.
lxc-chroot.txt