All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Taylor, Grant" <gtaylor@riverviewtech.net>
To: netfilter@lists.netfilter.org
Subject: Re: captive web system using DNAT and SNAT
Date: Thu, 05 May 2005 21:27:41 -0500	[thread overview]
Message-ID: <427AD61D.2050709@riverviewtech.net> (raw)
In-Reply-To: <1115323918.21170.65.camel@localhost.localdomain>

> # catch all redirects to registration server
> iptables -t nat -A PREROUTING -i eth1 -p tcp -dport 80 -j DNAT
> --to-destination ${REGISTRATION_SERVER}
> 
> iptables -t nat -A POSTROUTING -o eth0 -p tcp -dport 80 -j SNAT
> --to-source ${EXTERNAL_ADDRESS}
> 
> iptables -t nat -A PREROUTING -i eth1 -p tcp -dport 80 -j DNAT
> --to-destination ${REGISTRATION_SERVER}
> 
> iptables -t nat -A POSTROUTING -o eth0 -p tcp -dport 80 -j SNAT
> --to-source ${EXTERNAL_ADDRESS}

Did you mean to post the same rules twice?  Or am I really just missing something?

> what i want to do is if i type in ${REGISTRATION_SERVER} in my address
> bar on the client system, then i dont want the firewall to do any DNAT
> or SNAT. what is the best way to accomplish this?

Try changing your DNAT rule to be like the following:

iptables -t nat -A PREROUTING -i eth1 -p tcp -d ! ${REGISTRATION_SERVER} -dport 80 -j DNAT --to-destination ${REGISTRATION_SERVER}

As this will DNAT any traffic that is not going to your ${REGISTRATION_SERVER} directly.



Grant. . . .


  reply	other threads:[~2005-05-06  2:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 20:11 captive web system using DNAT and SNAT Matt Zagrabelny
2005-05-06  2:27 ` Taylor, Grant [this message]
2005-05-06 13:21   ` Matt Zagrabelny
  -- strict thread matches above, loose matches on Subject: below --
2005-05-11  5:39 Dave Cinege
2005-05-11 18:36 ` Taylor, Grant
2005-05-11 18:49   ` Jason Opperisano
2005-05-11 21:25 Dave Cinege

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=427AD61D.2050709@riverviewtech.net \
    --to=gtaylor@riverviewtech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.