[Lxc-users] Static IP in containers

Tamas Papp tompos at martos.bme.hu
Thu Nov 7 16:55:07 UTC 2013


You need to set gw manualy.

tamas

On 11/07/2013 05:47 PM, Robin Monjo wrote:
> Thank you, it does set the correct IP but I can't reach internet now. Any idea ?
>
> Regards,
> Robin
>
> On Nov 7, 2013, at 5:40 PM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
>
>> Quoting Robin Monjo (robin.monjo at applidget.com):
>>> Hello,
>>>
>>> I'm using LXC 0.7.5 on ubuntu 12.04 with the default settings (lxbr0, dnsmasq …). To have a static IP in my containers I used to add a line in the conf file, i.e:
>>>
>>> lxc.network.ipv4 = 10.0.3.4/24
>>>
>>> Unfortunately, this don't really work anymore. When I start my container I sometimes have an IP randomly set (dhcp) and sometimes the one I actually specified in the conf file.
>> What does /etc/network/interfaces in the container look like?
>> My guess is it has
>>
>> auto eth0
>> iface eth0 inet dhcp
>>
>> change that to
>>
>> auto eth0
>> iface eth0 inet manual
>
> ------------------------------------------------------------------------------
> November Webinars for C, C++, Fortran Developers
> Accelerate application performance with scalable programming models. Explore
> techniques for threading, error checking, porting, and tuning. Get the most 
> from the latest Intel processors and coprocessors. See abstracts and register
> http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>





More information about the lxc-users mailing list