/* HINT: Search archives @ http://www.indyramp.com/masq/ before posting! 
/* ALSO: Don't quote this header. It makes you look lame :-) */

Joerg Peters <[EMAIL PROTECTED]> wrote:
>
> I have a server with an ip 1.2.3.4
> If a request on port 80 from ip 2.2.2.2 come, i want to redirect it to
> 1.2.3.5 on Port 80 but allthoug i want to change the ip to 1.2.3.4
> And all back coming data for the request must be redirected to the ip
> 2.2.2.2.

Is this what you want?

    iptables -t nat -A PREROUTING -p tcp \
        -s 2.2.2.2 -d 1.2.3.4 --dport 80 \
        -j DNAT --to 1.2.3.5

This says, essentially, if a TCP connection arrives from 2.2.2.2,
destined for 1.2.3.4, port 80, the destination will be NAT'd to 1.2.3.5,
port 80.

Once the connection tracking is established, the replies and other
messages will be correctly handled.

This assumes that you have a FORWARD chain that permits this traffic to
pass, in both directions.

-- 
   [EMAIL PROTECTED] (Fuzzy Fox)     || "Good judgment comes from experience.
sometimes known as David DeSimone  ||  Experience comes from bad judgment."
_______________________________________________
Masq maillist  -  [EMAIL PROTECTED]
Admin requests can be handled at http://www.indyramp.com/masq-list/ -- 
THIS INCLUDES UNSUBSCRIBING!
or email to [EMAIL PROTECTED]

PLEASE read the HOWTO and search the archives before posting.
You can start your search at http://www.indyramp.com/masq/
Please keep general linux/unix/pc/internet questions off the list.

Reply via email to