From: "Paul F. Bernal B. - EasyTeck" <pbernal@easyteck.com>
To: netfilter@lists.netfilter.org
Subject: NAT question (forwarding with subdomains)
Date: Thu, 13 May 2004 12:52:21 -0500 (ECT) [thread overview]
Message-ID: <55621.200.107.22.222.1084470741.squirrel@www.easyteck.com> (raw)
In-Reply-To: <20040513172702.17791.51996.Mailman@vishnu.netfilter.org>
Hi!,
I got an internal 192.168.0.0/24 LAN with about 5 web servers including
the one which has iptables running and internet output ...
in the firewall script:
* INTERNALIF="eth1"
* INTERNALNET="192.168.0.0/24"
* INTERNALBCAST="192.168.0.255"
* EXTERNALIF="eth0"
* MYADDR="200.107.XXX.XXX"
got a rule that works fine that forwards the mail packets to the
192.168.0.2 machine:
$IPTABLES -A PREROUTING -t nat -i $EXTERNALIF -p tcp -d $MYADDR --dport 25 \
-j DNAT --to 192.168.0.2:25
$IPTABLES -A FORWARD -i $EXTERNALIF -p tcp -d 192.168.0.2 --dport 25 -j
ACCEPT
I have a couple subdomains pointing to MYADDR sub1.mydomain.com,
sub2.mydomain.com, etc...
What I need to do is:
When someone in the Internet asks for http://sub1.mydomain.com/ respons
the 192.168.0.3 machine (wich has a web server running port 80)
When someone in the Internet asks for http://sub2.mydomain.com/ responds
the 192.168.0.4 machine (wich has a web server running port 80)
etc., etc., etc...
I've tried something like this, but doesn't works !!!
$IPTABLES -A PREROUTING -t nat -i $EXTERNALIF -p tcp -d sub1.mydomain.com
--dport 80 \
-j DNAT --to 192.168.0.3:80
$IPTABLES -A FORWARD -i $EXTERNALIF -p tcp -d 192.168.0.3 --dport 80 -j
ACCEPT
Pliz give me a hand on this, thanks in advance ...
----------
don pool
next parent reply other threads:[~2004-05-13 17:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040513172702.17791.51996.Mailman@vishnu.netfilter.org>
2004-05-13 17:52 ` Paul F. Bernal B. - EasyTeck [this message]
2004-05-13 18:08 ` NAT question (forwarding with subdomains) Antony Stone
2004-05-13 19:24 ` Paul F. Bernal B. - EasyTeck
2004-05-13 18:17 ` John A. Sullivan III
2004-05-13 20:06 ` Alistair Tonner
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=55621.200.107.22.222.1084470741.squirrel@www.easyteck.com \
--to=pbernal@easyteck.com \
--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