Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Anders Fugmann <afu@fugmann.dhs.org>
To: Antony Stone <Antony@Soft-Solutions.co.uk>
Cc: netfilter@lists.netfilter.org, michael@insulin-pumpers.org
Subject: Re: one to one NAT
Date: Tue, 10 Sep 2002 08:29:26 +0200	[thread overview]
Message-ID: <3D7D9146.3080905@fugmann.dhs.org> (raw)
In-Reply-To: 20020910002200.VICK295.mta06-svc.ntlworld.com@there

Antony Stone wrote:
> On Tuesday 10 September 2002 2:10 am, Michael wrote:
>>I want to map 1.2.3.5 to a single address behind the linux box
>>1.2.3.5 is mapped to eth1:0
 >
> iptables -A PREROUTING -a nat -d 1.2.3.5 -j DNAT --to 192.168.1.19
> iptables -A FORWARD -d 192.168.1.19 -j ACCEPT
> 
This only takes care of the ingoring part. Outgoing would be solved
by using SNAT:
$ iptables -A POSTROUTING -t nat -s 1.2.3.5 -j SNAT \
	--to-source 192.168.1.19
$ iptables -A FORWARD -s 192.168.1.19 -j ACCEPT

(Antony made a small typo - it should have been '-t nat' and not '-a 
nat', unless Im mistaken)

I would suggest that you apply network interface names, where possible.

Regards
Anders Fugmann

-- 
Author of FIAIF
FIAIF Is An Intelligent/Iptables Firewall
http://fiaif.fugmann.dhs.org



  reply	other threads:[~2002-09-10  6:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-10  1:10 one to one NAT Michael
2002-09-10  0:21 ` Antony Stone
2002-09-10  6:29   ` Anders Fugmann [this message]
2002-09-10  6:50     ` Anders Fugmann
2002-09-10  8:09     ` Antony Stone
     [not found] ` <200209100119.g8A1J0r9027893@ns2.is.bizsystems.com>
2002-09-10  8:03   ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2002-09-24  0:13 Brennan, JosephX M
2002-09-27 21:04 ` Antony Stone
2003-02-05 18:27 One to One NAT EricRyd
2003-02-08 18:24 ` Joel Newkirk

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=3D7D9146.3080905@fugmann.dhs.org \
    --to=afu@fugmann.dhs.org \
    --cc=Antony@Soft-Solutions.co.uk \
    --cc=michael@insulin-pumpers.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox