[lxc-users] Changing ip address

BB eeg5auquaephoo5j at gmail.com
Sat Dec 27 20:13:05 UTC 2014


Hi,

it depends on your template how address assigning is done (via DHCP,
statically, not at all, ...) but normally in the standard case the
containers get their IP addresses from the dnsmasq process that is running
on the containers' host system.

You can either...
1) Assign IP addresses yourself via the containers' config files, e.g.,
/var/lib/lxc/$CONTAINER_NAME/config by using the option lxc.network.ipv4  -
see "man lxc.container.conf, but you probably will have to set further
parameters to make this fully work
2) or you enable "LXC_DHCP_CONFILE=/etc/lxc/dnsmasq.conf"
in /etc/default/lxc-net and then assign IP addresses to hostnames
statically in /etc/lxc/dnsmasq.conf
3) or you statically set the particular IP address in the containers rootfs
- /etc/network/interfaces (at least for Debian/Ubuntu/...)

You probably should try the second option.

Kind regards,

BB

On Sat, Dec 27, 2014 at 8:16 PM, Thouraya TH <thouraya87 at gmail.com> wrote:

> Hello,
>
> Please, i have created these two containers:
>
> NAME     STATE    IPV4        IPV6  AUTOSTART
> ---------------------------------------------
> worker   RUNNING  *10.0.3.238*  -     NO
> worker1  RUNNING  *10.0.3.68*   -     NO
> root at parapluie-8:~# brctl show
> bridge name    bridge id        STP enabled    interfaces
>
> *lxcbr0        8000.fe7cb6d68210    no        veth4FEW6P
>                                                vethCCMR1U*
>
>
>
> How can i modify the two ip address (which are in the same bridge):
> i have used inside the container:
>
>                            container1: ifconfig eth0 192.168.1.2
>                            container2: ifconfig eth0 192.168.1.3
>
>
> this works but when i restart the containers, i can't find the new
> adresses !
>
> Have you an idea please ?
>
> Thanks a lot.
>
> Best Regards.
>
>
>
> _______________________________________________
> 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/20141227/18ca7398/attachment.html>


More information about the lxc-users mailing list