From: "Fabrizio Regalli" <fabreg@gmail.com>
To: netfilter@vger.kernel.org
Subject: DNAT and SNAT
Date: Wed, 3 Sep 2008 16:02:50 +0200 [thread overview]
Message-ID: <43d295de0809030702i1d42b404w36483608498a6fcc@mail.gmail.com> (raw)
Hi list.
I have a router "closed" and I can't using PAT but I need to forward
the ssh port to another external port (50002)
My router is 192.168.1.1
My server is 192.168.1.2
My client is 192.168.1.3
In other words I need to forward the ssh port of 192.168.1.3 to server ip:50002
For PREROUTING rule I suppose this is right:
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 50002 -j DNAT
--to-destination 192.168.1.3:22
For POSTROUTING rule, I need an help. I'm trying in this way:
iptables -t nat -A POSTROUTING -p tcp -m tcp -d 192.168.1.2 --dport 22
-j SNAT --to-source 192.168.1.2:50002
But unfortunately it doesn't work.
Could please someone give me a suggest for POSTROUTING rule?
Thanks in advance.
next reply other threads:[~2008-09-03 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-03 14:02 Fabrizio Regalli [this message]
2008-09-03 14:43 ` DNAT and SNAT Fabrizio Regalli
2008-09-04 10:41 ` ArcosCom Linux User
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=43d295de0809030702i1d42b404w36483608498a6fcc@mail.gmail.com \
--to=fabreg@gmail.com \
--cc=netfilter@vger.kernel.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