All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Newkirk <netfilter@newkirk.us>
To: Alexandru Coseru <alexcos@home.ro>, netfilter@lists.netfilter.org
Subject: Re: DNAT problem
Date: Sun, 30 Mar 2003 10:41:25 -0500	[thread overview]
Message-ID: <200303301041.25596.netfilter@newkirk.us> (raw)
In-Reply-To: <004701c2f6cc$d6192a90$0200a8c0@lynx>

On Sunday 30 March 2003 09:58 am, Alexandru Coseru wrote:
> hello.. I have the folowing problem...  I have a linux gateway with
> the external IP x.x.x.x  and internal Ip 192.168.0.1.    I want to
> make a DNAT and mask a conection from the external IP , forwarded to
> one of my lan's computer , and the lan computer to see it as
> 192.168.0.1 , not x.x.x.x
>
> Example:    If a packet comes from linux.org to a specific port (let's
> say 1345) ,   i want to forward it to a lan computer ( 192.168.0.5) ,
> and mask that connection in a way that 192.168.0.5 sees the packet
> comes from 192.168.0.1 , and not from linux.org      (it's exactly as
> masquarading , but in reverse way...)

Not really "in reverse way" just on a different interface.

>                                                                  Alex

iptables -t nat -A PREROUTING -i eth0 -j DNAT --to 192.168.0.5
iptables -t nat -A POSTROUTING -o eth1 -d 192.168.0.5 -j SNAT --to 
182.168.0.1

This assumes that eth0 is the external interface (with IP x.x.x.x) and 
eth1 is the internal with IP 192.168.0.1.  You will usually need to 
match the traffic type as well, IE if you're DNATting http requests you 
should add "-p tcp --dport 80" to BOTH rules. 

j



  reply	other threads:[~2003-03-30 15:41 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-30 14:58 DNAT problem Alexandru Coseru
2003-03-30 15:41 ` Joel Newkirk [this message]
     [not found] <45227670.8040702@mail.nankai.edu.cn>
2006-10-03 14:48 ` Marco Berizzi
     [not found] <4521C6A3.1040902@mail.nankai.edu.cn>
2006-10-03 10:11 ` Marco Berizzi
  -- strict thread matches above, loose matches on Subject: below --
2006-10-02  8:00 Stefan Friedel
2006-10-02  8:25 ` Marco Berizzi
2006-10-02 10:42   ` Pascal Hambourg
2006-10-02 12:01     ` Stefan Friedel
2006-10-02 12:51       ` Marco Berizzi
2006-10-02 13:14       ` Pascal Hambourg
2006-10-02 14:18         ` Stefan Friedel
2006-10-02 12:48     ` Marco Berizzi
2006-07-08 21:00 Antonio Di Bacco
2005-01-22 15:59 dnat problem Pablo Allietti
2005-01-22 19:45 ` Jason Opperisano
2005-01-23  0:26   ` Pablo Allietti
     [not found]     ` <20050125150114.GA25839@omega.lacnic.net.uy>
2005-01-25 15:24       ` Pablo Allietti
2005-01-25 15:25         ` Pablo Allietti
2004-06-10 11:03 DNAT problem Paul M. Goorskis
2004-05-29 15:25 Patrick Leslie Polzer
2004-05-29 15:36 ` Alexis
2004-05-29 16:03   ` Patrick Leslie Polzer
2004-05-30  1:00     ` Alexis
2004-04-27  5:57 [Fwd: Re: DNAT Problem] test
2004-04-27  7:20 ` DNAT Problem Rob Sterenborg
     [not found]   ` <1081.80.0.0.23.1083127867.squirrel@80.0.0.175>
     [not found]     ` <000901c42cef$68603d40$1202a8c0@admin>
2004-05-04  5:32       ` test
2004-04-19  5:07 test
2004-04-19 13:43 ` Joel Newkirk
2004-04-20  4:31   ` test
2004-04-22 10:40     ` test
2004-04-22 11:07       ` Antony Stone
     [not found]         ` <1589.80.0.0.23.1082637754.squirrel@80.0.0.175>
2004-04-22 12:47           ` Antony Stone
2004-04-22 13:06             ` test
2004-04-22 13:21               ` Antony Stone
2004-04-22 18:18                 ` test
2004-04-22 19:13                   ` Antony Stone
2004-04-23 12:22                     ` test
2002-11-27 19:28 DNAT problem Geoff Silver
2002-11-19  8:07 HCLFM
2002-11-21 21:53 ` Rahul Jadhav
2002-05-21 20:53 dnat problem support
2002-06-13 17:28 ` Antony Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200303301041.25596.netfilter@newkirk.us \
    --to=netfilter@newkirk.us \
    --cc=alexcos@home.ro \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.