[Lxc-users] container hostname not visible to host, ubuntu 12.04

Stéphane Graber stgraber at ubuntu.com
Fri Jul 6 13:48:28 UTC 2012


On 07/06/2012 04:09 AM, Ben Butler-Cole wrote:
> [back on-list]
> 
> On 6 July 2012 08:59, Li, Zeyang <a.banknote at gmail.com
> <mailto:a.banknote at gmail.com>> wrote:
> 
>     "I also see that you seem to be running the LXC network inside the
>     guest as well as on the host (it too has an lxcbr0 bridge network). Is
>     this intentional?"
>     This is not intentional, but I don't remember ever setting it up so
>     frankly I don't know why it showed. It does have any adverse effect?
> 
> 
> I think it will appear automatically if you have installed the lxc
> package on the guest (which should not be necessary unless you are
> trying to nest containers). I don't know of any adverse effect, but I
> don't have a good understanding of networking.
> 
> -Ben

Well, it's actually creating a relatively big mess :)

When you have lxcbr0 on both your host and your container, you'll have
the following case:
 - host lxcbr0: 10.0.3.1/24
 - container eth0: 10.0.3.X/24
 - container lxcbr0: 10.0.3.1/24

So when you're pining 10.0.3.1 from the container, you're not pinging
the host at all, you're pinging the container on its lxcbr0 interface.

In short, installing lxc in the container will in most cases cut you
from the outside world completely.

You have a few ways of fixing this:
 - If you want to use lxcbr0 in that container, then edit
/etc/default/lxc in the container to change the subnet to something else
than 10.0.3.0/24, then reboot your container.
 - If you don't want lxcbr0 in the container, also edit /etc/default/lxc
in the container and set USE_LXC_BRIDGE to false, then reboot the container.


After that, all should be back to normal.

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20120706/32f1a955/attachment.pgp>


More information about the lxc-users mailing list