Subject: Re: [vserver] Using loopback for guest-guest and guest-host communication but still remapping
From: Gordan Bobic <gordan@bobich.net>
Date: Wed, 29 Feb 2012 11:43:14 +0000

Fiedler Roman wrote:
> Hi,
> 
> I'm trying to configure networking on a machine, where we cannot use any private network
for internal communication because I might need to receive traffic from that network.
 So I can only use loopback, one private IP-Range IP (server external IP) and I do not
want to grab one public IP-range for internal communication if avoidable.
> 
> Is this configuration with special combination of nflags and dev settings possible
(CAVEAT: network prefixes atypical)?
> 
> * Guest ctx=3: Inside guest bind and connect to 127.0.0.1/24 is remapped to 127.0.3.1
and stays inside guest
> * Guest ctx=4: Inside guest bind and connect to 127.0.0.1/24 is remapped to 127.0.4.1
and stays inside guest
> 
> * Guest ctx=3: Inside guest connect to 127.0.4.1/24 goes to guest ctx=4 network stack
(inter-guest comm)
> * Guest ctx=4: Inside guest connect to 127.0.3.1/24 goes to guest ctx=3 network stack
(inter-guest comm)
> 
> * Guest ctx=3,4: Inside guest connects to any loopback IP-Range not bound to any guest
goes to host, e.g. 127.255.255.1 (if something is listening on host on that IP/port)
> 
> 
> If not, would a special nflags, dev config configuration together with a modification
of vserver patch (change 127.0.0.0/8 to 127.0.0.0/24 somewhere) be sufficient?

I solved that problem by using a dummy interface for each internal-only 
network. You set up a dummy interface on the host, and give the guests 
an IP on that interface.

Gordan