From: Joel Newkirk <netfilter@newkirk.us>
To: "PiSiC..." <pisic@service.agress.ro>, richardo@start-global.com
Cc: netfilter@lists.netfilter.org
Subject: Re: possibly annoing ...
Date: Fri, 28 Feb 2003 02:48:43 -0500 [thread overview]
Message-ID: <200302280248.43412.netfilter@newkirk.us> (raw)
In-Reply-To: <001301c2de8c$263cc620$c80da8c0@service.agress.ro>
On Thursday 27 February 2003 01:14 pm, PiSiC... wrote:
> First of all thanks for help ...
> but i'm kinda new with iptables and i want to show you the big
> picture :
>
> - i heard something about static NAT and dynamic NAT (not source or
> destination NAT) and i'm not sure i fully understand what is the
> aplicability on my situation.
Static is a static IP, Dynamic with a Dynamic IP. Source NAT is where
you change the source IP on an outbound packet so it appears to
originate at the firewall, instead of a private IP 'behind' it.
Destination NAT is where you change the destination of an (usually)
incoming packet to send it elsewhere, usually used to send traffic
coming to a public IP to a machine 'behind' the firewall with a private
IP address. For SNAT (Source NAT) netfilter offers two flavors - SNAT
uses a single static IP, and MASQUERADE checks the IP of the interface
to make sure it uses the correct IP in a Dynamic IP setup.
> the situation is this :
>
> i have a radio link with only one staticaly allocated IP
> (aaa.bbb.ccc.ddd) which is connected on my linux machine on eth1
> eth0 on the same machine is connected on LAN.
> I have up and running Webserver,SMTP,FTP and POP3.
> I want to run now 2 webservers one on external and one on
> internal(that is easy with binding on their interfaces).
> But i want also to allow access from the world to a third webserver
> which runs on 192.168.13.199:80 which will be accesibile on port 33333
> on my external ip.
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 33333 -d DNAT
--to 192.168.13.199:80
Along with FORWARD rules to allow port 80 traffic going to 192.168.13.199
and to allow return traffic. Likely return traffic will already get
through if your iptables box is allowing internet access from machines
on the LAN right now, but this would do it if not:
iptables -A FORWARD -i eth1 -m state --state ESTABLISHED,RELATED -j
ACCEPT
The inbound would be allowed with:
iptables -A FORWARD -d 192.168.13.199 -p tcp --dport 80 -j ACCEPT
j
next prev parent reply other threads:[~2003-02-28 7:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <OFBFE62721.93AFC0AB-ON80256CDA.005ECFD9@start-global.com>
2003-02-27 18:14 ` possibly annoing PiSiC...
2003-02-28 4:18 ` Matt Hellman
2003-02-28 11:42 ` PiSiC...
2003-02-28 7:48 ` Joel Newkirk [this message]
2003-02-27 14:47 PiSiC...
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=200302280248.43412.netfilter@newkirk.us \
--to=netfilter@newkirk.us \
--cc=netfilter@lists.netfilter.org \
--cc=pisic@service.agress.ro \
--cc=richardo@start-global.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