Subject: Re: [vserver] Loopback issues
From: Gustavo <lungpu@gmail.com>
Date: Fri, 31 Aug 2007 09:57:08 -0300
Fri, 31 Aug 2007 09:57:08 -0300
On 8/30/07, Jeff Williams <jeffw@globaldial.com> wrote:
>
> Philippe Teuwen wrote:
> >
> >> I added the rule:
> >>
> >> iptables -t nat -A PREROUTING -i eth0 -d 4.3.2.1 -j DNAT --to 1.2.3.5
> >>
> > Drop the interface option, internal vserver traffic doesn't come from
> > eth0.
> >
> > iptables -t nat -A PREROUTING -d 4.3.2.1 -j DNAT --to 1.2.3.5
> Phil,
>
> This is what I am trying to achieve:
>
> Two vservers 1.2.3.4 and 1.2.3.5. Also an alias IP 4.3.2.1 for the
> 1.2.3.5 server.


Ok, and how did you setup those ip's on the vservers? which interface are
using?

(1) Traffic from external to 4.3.2.1 should go to 1.2.3.5.


Note here that if you haven't two real network interfaces on the vserver
host machine, you are really assigning different ips to the same interface.
The command ip addr list on the host machine can show you this.

(2) Traffic from 1.2.3.4 to 4.3.2.1 should routed out to the default
> gateway.


which one you're using as your default gw?

in my case, the host is the gateway, I have the host on a subnet, and the
vservers in other, and the host is the gateway for them.



On 8/30/07, Jeff Williams <jeffw@globaldial.com> wrote:
Philippe Teuwen wrote:
>
>> I added the rule:
>>
>> iptables -t nat -A PREROUTING -i eth0 -d 4.3.2.1 -j DNAT --to 1.2.3.5
>>
> Drop the interface option, internal vserver traffic doesn't come from
> eth0.
>
> iptables -t nat -A PREROUTING -d 4.3.2.1 -j DNAT --to 1.2.3.5
Phil,

This is what I am trying to achieve:

Two vservers 1.2.3.4 and 1.2.3.5. Also an alias IP 4.3.2.1 for the
1.2.3.5 server.

Ok, and how did you setup those ip's on the vservers? which interface are using?

(1) Traffic from external to 4.3.2.1 should go to 1.2.3.5.

Note here that if you haven't two real network interfaces on the vserver host machine, you are really assigning different ips to the same interface. The command ip addr list on the host machine can show you this.

(2) Traffic from 1.2.3.4 to 4.3.2.1 should routed out to the default
gateway.

which one you're using as your default gw?

in my case, the host is the gateway, I have the host on a subnet, and the vservers in other, and the host is the gateway for them.