[Lxc-users] multiple IP-addresses

Stéphane Graber stgraber at ubuntu.com
Mon Jul 9 16:57:27 UTC 2012


On 07/09/2012 12:48 PM, "Matthias P. Würfl" wrote:
> Am 09.07.2012 17:29, schrieb Stéphane Graber:
>> This isn't LXC specific, what's happening in your case is that you're
>> contacting eth1 but getting a reply from eth0 as that's where your
>> default route is.
> 
> OK, but in "real world" (without LXC) I'd configure eth0 and eth0:1. 
> This doesn't work with LXC: ifcopnfig in the container shows everythin's 
> ok, but i cannot ping the additional IP-address.

Nothing forces you to define the IP addresses in LXC's config.
You can perfectly go with a single:

lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
lxc.network.hwaddr = [...]:ed:d8

Then define the addresses in /etc/network/interfaces in the container
with something like:
auto eth0
iface eth0 inet static
    address ...
    netmask ...
    gateway ...

auto eth0:0
iface eth0:0 inet static
    address ...
    netmask ...

>> I'm also a bit surprised that using a /32 "works well" but I'm assuming
>> you have some routes to make that all work.
> 
> What am i supposed to use instead of "/32"? With "/24" the console 
> doesn't start and i'm not able to ssh to the container.
> 
> Matthias

No idea, I don't know your network :)

-- 
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/20120709/257a1a7a/attachment.pgp>


More information about the lxc-users mailing list