Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "ISC Jorge Ceron Galvan" <jorgec@acerlandslp.com.mx>
To: /dev/rob0 <rob0@gmx.co.uk>, netfilter@lists.netfilter.org
Subject: Re: Source NAT
Date: Sat, 03 Sep 2005 14:28:26 -0500	[thread overview]
Message-ID: <WorldClient-F200509031428.AA28260029@acerlandslp.com.mx> (raw)
In-Reply-To: <200508310637.33322.rob0@gmx.co.uk>


-----Original Message-----
From: /dev/rob0 <rob0@gmx.co.uk>
To: netfilter@lists.netfilter.org
Date: Wed, 31 Aug 2005 06:37:33 -0500
Subject: Re: Source NAT

> On Wednesday 2005-August-31 06:18, Jimmy wrote:
> > I currently have a situation that I am hoping iptables can resolve.
> > The issue is that I need to NAT the source address based on the
> > destination address. Is that possible with IPTables ?
> 
> Trivial.
> 
> > if dst = 1.1.1.1 src = 10.1.1.1
> 
> iptables -vt nat -A POSTROUTING -d 1.1.1.1 -j SNAT -to 10.1.1.1


why -vt?  

this rule confused me, I'm a begginer;  

what about

iptables -t nat -A POSTROUTING -s 10.1.1.1/24 -j SNAT --to 1.1.1.1

or

iptables -t nat -A POSTROUTING -o eth0 -s 10.1.1.1/24 -j SNAT --to 1.1.1.1


> 
> > Can anyone give me any advice on completing that?
> 
> "man iptables"
> 
> Order matters. If you have a catchall SNAT rule before the specific 
> destination ones, the catchall is the one used.
> 
> NAT != routing. If your SNAT'ed IP addresses need to go out different
> interfaces, this won't work. See the LARTC HOWTO.
> -- 
>     mail to this address is discarded unless "/dev/rob0"
>     or "not-spam" is in Subject: header



  reply	other threads:[~2005-09-03 19:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-31 11:18 Source NAT Jimmy
2005-08-31 11:31 ` Stéphane BENOLIEL
2005-08-31 11:33   ` Stéphane BENOLIEL
2005-08-31 11:37 ` /dev/rob0
2005-09-03 19:28   ` ISC Jorge Ceron Galvan [this message]
2005-09-03 20:29     ` /dev/rob0
  -- strict thread matches above, loose matches on Subject: below --
2004-07-06 18:49 Michael Forrest

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=WorldClient-F200509031428.AA28260029@acerlandslp.com.mx \
    --to=jorgec@acerlandslp.com.mx \
    --cc=netfilter@lists.netfilter.org \
    --cc=rob0@gmx.co.uk \
    /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