[lxc-users] Stop all containers to get static ip work for new container?

Qiang (James) Li shijialee at gmail.com
Mon Aug 22 07:31:17 UTC 2016


Hello,

I have trying out lxc 1.0.8 on ubuntu 14.04 based on the doc from
https://help.ubuntu.com/14.04/serverguide/lxc.html

To setup static IP for container I edit /etc/lxc/dnsmasq.conf

dhcp-host=base_os,10.0.3.4
dhcp-host=app1,10.0.3.6
dhcp-host=app2,10.0.3.7

The container is created by issuing lxc-clone -o old -n new -s -B overlayfs

It seems that I have to stop all running containers,  restart lxc-net
service, then start the newly cloned one to get it assigned the static IP.

the closest question I found is this one
https://lists.linuxcontainers.org/pipermail/lxc-users/2015-March/008843.html

Just wondering is there a better way to do it?

Thanks

James.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160822/89feafb3/attachment-0001.html>


More information about the lxc-users mailing list