All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Zagrabelny <mzagrabe@d.umn.edu>
To: netfilter@lists.netfilter.org
Subject: captive web system using DNAT and SNAT
Date: Thu, 05 May 2005 15:11:58 -0500	[thread overview]
Message-ID: <1115323918.21170.65.camel@localhost.localdomain> (raw)

hello,

i am working on a captive web system and am using DNAT and SNAT to
accomplish this. things are going well, but i am have hit a road block.

currently our router is configured (via next hop routing) to send
traffic to the firewall for certain vlans on our network. thus i am
dealing with an asymmetrical route map. traffic coming from a vlan is
sent to the firewall, but traffic destined for the same vlan does not
pass through the firewall. this is fine, but it does make the problem a
little more challenging.

so in order to make the system captive, i am using DNAT. since it is an
asymmetrical route map, i am using SNAT.

DNAT ensures that web traffic goes to the box i want, and SNAT ensures
that the web talks back to firewall instead of directly to the original
client (who is not expecting to be getting traffic from *that* web
server).

the problem is that if the client has traffic destined for the captive
web server, then i dont want the firewall to DNAT or SNAT the traffic, i
just want to let it go peacefully.

here is my small firewall script that accomplishes the captive part:

# 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}

so the above works for me. on my client machine i go to google.com the
firewall redirects me to the registration server (${REGISTRATION_SERVER}
and all is good.

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?

thanks, 

matt zagrabelny



             reply	other threads:[~2005-05-05 20:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05 20:11 Matt Zagrabelny [this message]
2005-05-06  2:27 ` captive web system using DNAT and SNAT Taylor, Grant
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=1115323918.21170.65.camel@localhost.localdomain \
    --to=mzagrabe@d.umn.edu \
    --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.