Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Mark E. Donaldson" <markee@bandwidthco.com>
To: Payal Rathod <payal-iptables@staticky.com>,
	netfilter@lists.netfilter.org
Subject: RE: natting help needed urgently.
Date: Sat, 6 Sep 2003 12:29:35 -0700	[thread overview]
Message-ID: <DKEDJAAMDCDBHFKPBEMPCEICCIAA.markee@bandwidthco.com> (raw)
In-Reply-To: <20030907110417.GA1463@linux.local>

Here is an example for HTTP.  All the services will work the same except for
the destination port number.  This needs to be done in two stages basically:

Step 1 is to DNAT the requests from the firewall box to your internal
Windows server (prerouting):

####################################################################
# SET VARIABLES
####################################################################
WINDOWS_IP="192.168.10.3"

####################################################################
# HTTP/SHTTP
####################################################################
# send all new incoming web requests to HTTP server (HTTP & SHTTP)
if [ "$WINDOWS_HTTP_AVAILABLE" = "1" ] && [ "$HTTP_SERVER" = "1" ];
then
	$IPT -t nat -A PREROUTING -p tcp --destination-port 80 -i $FW_INET_IFACE -j
LOG --log-prefix "DNAT IN WINDOWS HTTP: "
	$IPT -t nat -A PREROUTING -p tcp --destination-port 80 -i $FW_INET_IFACE -j
DNAT --to $WINDOWS_IP:80
	$IPT -t nat -A PREROUTING -p tcp --destination-port 443 -i
$FW_INET_IFACE -j LOG --log-prefix "DNAT IN WINDOWS SHTTP: "
	$IPT -t nat -A PREROUTING -p tcp --destination-port 443 -i
$FW_INET_IFACE -j DNAT --to $WINDOWS_IP:443
fi

Step 2 is to accept the packets after they have been DNATed:

$IPT -t filter -A TCP_RULES -i $FW_INET_IFACE -d $WINDOWS_IP -p
tcp --source-port $UNPRIVPORTS --destination-port 80 -m state --state NEW -j
LOG --log-prefix "WEB ACCESS -> WINDOWS BOX: "
$IPT -t filter -A TCP_RULES -i $FW_INET_IFACE -d $WINDOWS_IP -p
tcp --source-port $UNPRIVPORTS --destination-port 80 -m state --state NEW -j
ACCEPT
$IPT -t filter -A TCP_RULES -i $FW_INET_IFACE -d $WINDOWS_IP -p
tcp --source-port $UNPRIVPORTS --destination-port 443 -m state --state
NEW -j LOG --log-prefix "SWEB ACCESS -> WINDOWS BOX: "
$IPT -t filter -A TCP_RULES -i $FW_INET_IFACE $WINDOWS_IP -p
tcp --source-port $UNPRIVPORTS --destination-port 443 -m state --state
NEW -j ACCEPT

Hope this helps.

-----Original Message-----
From: netfilter-admin@lists.netfilter.org
[mailto:netfilter-admin@lists.netfilter.org]On Behalf Of Payal Rathod
Sent: Sunday, September 07, 2003 4:04 AM
To: netfilter@lists.netfilter.org
Subject: natting help needed urgently.


Hi,
I have asked this before but nobody responded. Is this un-do-able?
I have a windows box which is on intertnal ip 192.168.10.3. I want the
outside world to access the servers (ftp, http, smtp, pop3) from it.
The scene is something like this,


+----------+       +--------------+         +---------------+
|          +---><--+ Linux        +---->--<-+win2k          |
|router    |       |  (1.2.3.4)   |         | (192.168.10.3)|
+----------+       +--------------+         +---------------+

I am not able to redirect any request for windows box from outside world
to internal machine 192.168.10.3

Please help me to solve this problem.

Waiting eagerly for any help on this.

With warm regards,
-Payal

--
"Visit GNU/Linux Success Stories"
http://payal.staticky.com
Guest-Book Section Updated.




  reply	other threads:[~2003-09-06 19:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-07 11:04 natting help needed urgently Payal Rathod
2003-09-06 19:29 ` Mark E. Donaldson [this message]
2003-09-08  4:49 ` Dharmendra.T
2003-09-09  3:19   ` Payal Rathod
2003-09-09  8:09     ` ads nat
2003-09-09 11:11       ` Payal Rathod
2003-09-09 19:15         ` Ranjeet Shetye

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=DKEDJAAMDCDBHFKPBEMPCEICCIAA.markee@bandwidthco.com \
    --to=markee@bandwidthco.com \
    --cc=netfilter@lists.netfilter.org \
    --cc=payal-iptables@staticky.com \
    /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