Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Joel Newkirk <netfilter@newkirk.us>
To: Magnus Solvang <magnus@solvang.net>, netfilter@lists.netfilter.org
Subject: Re: lan users surfing on lan webserver
Date: Mon, 3 Mar 2003 08:59:45 -0500	[thread overview]
Message-ID: <200303030859.45430.netfilter@newkirk.us> (raw)
In-Reply-To: <20030303133701.GD7199@first.knowledge.no>

On Monday 03 March 2003 08:37 am, Magnus Solvang wrote:

> I have moved a webserver behind my iptables-firewall.

> However, the clients on the LAN cannot use the external URL to surf to
> this machine, they have to use its internal ip-address (I know I could
> set up Bind on the inside, but I'm trying to avoid this).

> I have this relevant FORWARD chain:
> $IPTABLES -A INPUT -i $EXTIF -m state --state NEW,ESTABLISHED,RELATED
> \ -p tcp -d $EXTWEBSERVER1 --dport 80 -j ACCEPT

FORWARD or INPUT?  It should be:

$IPTABLES -A FORWARD -p tcp -d $INTWEBSERVER1 --dport 80
-m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

FORWARD because after DNAT has done its job this traffic is no longer 
addressed to the firewall box.  $INTWEBSERVER1 for the same reason.  And 
skip the "-i $EXTIF" to ensure it matches connections from the LAN as 
well as 'outside' clients.

> PREROUTING:
> $IPTABLES -t nat -A PREROUTING -i $EXTIF -d $EXTWEBSERVER1 -p tcp \
> --dport 80 -j DNAT --to $INTWEBSERVER1

Again, you might want to drop the "-i $EXTIF" part...

> $IPTABLES -t nat -A POSTROUTING -d $INTWEBSERVER1 -s $INTRANET -p tcp
> \ --dport 80 -j SNAT --to-source 192.168.1.20

This part looks fine as-is.

j



  reply	other threads:[~2003-03-03 13:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-25 21:53 lan users surfing on lan webserver Magnus Solvang
2003-02-27 12:35 ` Magnus Solvang
2003-02-27 13:51   ` Problem with string hare ram
2003-02-27 13:48     ` Problem with string (remove References-line in mailhead) Magnus Solvang
2003-02-27 14:37       ` Joel Newkirk
2003-02-27 15:01         ` Magnus Solvang
2003-02-27 14:36     ` Problem with string Raymond Leach
2003-03-03 13:37   ` lan users surfing on lan webserver Magnus Solvang
2003-03-03 13:59     ` Joel Newkirk [this message]
2003-03-03 14:47       ` Magnus Solvang
  -- strict thread matches above, loose matches on Subject: below --
2003-02-26  1:37 Andrej Ricnik

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=200303030859.45430.netfilter@newkirk.us \
    --to=netfilter@newkirk.us \
    --cc=magnus@solvang.net \
    --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