[Lxc-users] multiple IP-addresses

Stéphane Graber stgraber at ubuntu.com
Mon Jul 9 15:29:22 UTC 2012


On 07/09/2012 10:43 AM, "Matthias P. Würfl" wrote:
> Hello!
> 
> I habe a new container set up (precise on precise) and it works well. 
> Network configuration is:
> 
> lxc.network.type=veth
> lxc.network.link=br0
> lxc.network.flags=up
> lxc.network.hwaddr = [...]:ed:d8
> lxc.network.ipv4 = 84.16.228.72/32
> 
> if i add a second id address:
> 
> lxc.network.type=veth
> lxc.network.link=br0
> lxc.network.flags=up
> lxc.network.hwaddr = [...]:ed:d9
> lxc.network.ipv4 = 84.16.228.75/32
> 
> ...i can see this in the container (ifconfig) as eth1, but i cannot ping 
> the container from the outside using this ip-address. I think i need to 
> add a route, as the output of "route" shows nothing for eth1. What's the 
> recommended way to get this working?
> 
> Matthias

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.

To support a scenario like this one, you'll typically need some basic
source based routing rules. Try the following:

ip route add default dev eth1 table 100
ip rule add pref 100 from 84.16.228.75 table 100


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.

-- 
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/56abae6d/attachment.pgp>


More information about the lxc-users mailing list