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


Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to