[lxc-users] Setting up LXC on Ubuntu 14.04

Kevin LaTona lists at studiosola.com
Mon Aug 11 10:12:32 UTC 2014


I've narrowed down the problem and it's more about how to setup the LXC network than LXC's themselves.

What is not fully clear to me is how best to define the /etc/network/interfaces file for the way I want to run the host machine.


lxcbr0 creates a 10.x.x.x for it's internal network usage needs while using the ubuntu template.

I prefer to run a 192.168.x.x for my networking purposes.

Utlimately for now at least,  I want to have a single public address that I would use iptables to route the incoming requests to the correct LXC.

As this to me seems to be the simplest way to do it.


Where I am getting stuck right now is.

What address to give the host machine on eth0 so I can still SSH into the host machine while any of the LXC's are also running.


Not sure if it's simpler to just have two NIC cards in this case.

Or create a virtual NIC.

Or to create a new bridge and call it br0 and then tie br0 and lxcbr0 together.



If I create a config some thing like this on the Host.


auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual


iface lxcbr0 inet static
   address 192.168.0.50
   netmask 255.255.255.0
   broadcast 192.168.0.255
   network 192.168.0.0
   gateway 192.168.0.1
   dns-nameservers 8.8.8.8 8.8.4.4
   bridge_ports eth0
   bridge_fd 9
   bridge_hello 2
   bridge_maxage 12
   bridge_stp off


As soon as I bring it up I no longer am able to SSH in the host machine.

I recall the last time I was testing LXC 0.6 + 12.04 it was here where I felt the big kludge came about that I did to get it all working back then.


Given how I would like to run LXC's under any one have a suggestion of how best to approach this issue?



Based on all the web blogs , wiki pages and other such documents that I've looked at while working through re-setting up this LXC test.

It's the whole issue about setting up the network side of things that becomes a huge mess given the many ways to solve it.


So many blog pages etc., get to deep into the under laying concepts about containers while that is great.

But given there are so many possible moving parts in this much larger puzzle.

I have to guess many folks just flat out get hung up on setting up and dealing with network issues.

Get fed up and move on to something like Docker or maybe Proxmox or some other solution.


So in the past year or so LXC has matured a lot.

But with so many old web pages to trip folks up with outdated information, it's just not helping current LXC usage to move forward.

Well this is how I am looking at it, based on the many hours lately traversing through lots of old outdated pages to trip new comer to LXC up with.


Any thoughts about how you would or are setting up the /etc/network/interfaces doc?


Thanks
-Kevin




On Aug 10, 2014, at 9:38 AM, Fajar A. Nugraha <list at fajar.net> wrote:

> On Sun, Aug 10, 2014 at 10:15 PM, Kevin LaTona <lists at studiosola.com> wrote:
>> 
>> 
>> Ranjib,
>> 
>> 
>> Thanks for your ideas and yes I think it would be great if at some point
>> there was "trusted" source of the latest info on LXC to help folks out.
> 
> Since you use ubuntu, the trusted source would be
> https://help.ubuntu.com/lts/serverguide/lxc.html
> 
> If it says an apt-get is enough, then an apt-get is enough.
> 
>> 
>> I've looked at Stephan's blog post and like so many other blog post there is
>> tons of really good information in it.
> 
> Yet the other blogs were not written by an lxc dev who also maintains
> lxc package at ubuntu.
> 
>> 
>> But there lays the rub for me.
>> 
>> In that there are so many subtle different ways to tweak the setup, that it
>> gets to be a huge jigsaw puzzle and really easy to get stuck without knowing
>> 100% why.
> 
> The usual will help at this point: man pages, official documentation,
> mailing list.
> 
> -- 
> Fajar



More information about the lxc-users mailing list