[Lxc-users] Mixing public and private IPs for guests - network configuration?

Benjamin Kiessling mittagessen at l.unchti.me
Sat May 21 23:48:12 UTC 2011


Hi,

Indeed this is not a virtualization specific problem. You want your host to operate as a router for
the other two IP addresses and, depending on the configuration of OVH, ARP-Proxy the whole stuff.
Assuming you want have PUB-IP1 on the host and want to assign PUB-IP2 to the container (lets say
with veths).
Just assign PUB-IP1 to your host (ip addr a PUB-IP1 dev ethN), add the route for PUB-IP2 to the
veth of the container on the host (ip r a PUB-IP2 dev vethN), add PUB-IP2 to the interface in the
container (ip addr a PUB-IP2 dev vethContainer) and set a default route over PUB-IP1 in the
container (ip r a PUB-IP1/32 dev vethContainer && ip r a default via PUB-IP1 dev vethContainer).
Enable Routing (/proc/sys/net/ipv4/ip_forward) and if OVH uses reverse path filtering proxy-arp
(/proc/sys/net/ipv4/conf/$DEV/proxy_arp) on the host.
That should do it. You could use a bridge and still reach all containers (the bridge would have the
address PUB-IP1 and would include all veths and the physical device) but it'll complicate the setup
if NAT is required for certain containers. Just set the routes explicitly for each container veth.

Regards,
Benjamin Kiessling
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20110522/1523b673/attachment.pgp>


More information about the lxc-users mailing list