From: "R. Sterenborg" <rsterenborg@xs4all.nl>
To: 'NetFilter Mailing List' <netfilter@lists.samba.org>
Subject: RE: SNAT?
Date: Tue, 29 Oct 2002 14:17:27 +0100 [thread overview]
Message-ID: <001901c27f4d$87579af0$0401000a@robbysan.org> (raw)
In-Reply-To: <003f01c27f47$60e06740$c800640a@grooverider>
> The thing is, is there any way to SNAT a individual computer on my
> internal network to a different public ip address?
Sure.
> All my internal network is masqueraded as the x.x.x.98/24 ip
> address. I
> want to SNAT my internal IP address 10.100.0.200 to
> x.x.x.99/24 Is that
> possible?
Create the rules in this order :
# iptables -t nat -A POSTROUTING -s 10.100.0.200 -j SNAT --to-source
x.x.x.99
# iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -j SNAT --to-source
x.x.x.98
# iptables -A FORWARD -s 10.100.0.200 -d x.x.x.99 -j ACCEPT
# iptables -A FORWARD -s 10.100.0.0/24 -d x.x.x.98 -j ACCEPT
When the first rule is matched, it is executed.
So your PC on 10.100.0.200 hits first its own rule so never hits the
subnet rule.
The other PC's don't hit the specific rule and match the subnet rule.
Of course the PC would have to have a static IP address, because
otherwise another PC could be 10.100.0.200...
Rob
prev parent reply other threads:[~2002-10-29 13:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-29 12:33 SNAT? Svavar Örn Eysteinsson
2002-10-29 13:07 ` SNAT? Antony Stone
2002-10-29 13:17 ` R. Sterenborg [this message]
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='001901c27f4d$87579af0$0401000a@robbysan.org' \
--to=rsterenborg@xs4all.nl \
--cc=netfilter@lists.samba.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