Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Vladimir Mosgalin <mosgalin@VM10124.spb.edu>
To: netfilter@lists.netfilter.org
Subject: Re: Dynamic change of iptables (building Wi-Fi hotspot)
Date: Sun, 4 Jul 2004 22:10:37 +0400 (MSD)	[thread overview]
Message-ID: <Pine.LNX.4.58.0407042142420.8244@localhost.localdomain> (raw)
In-Reply-To: <200407041803.40828.Antony@Soft-Solutions.co.uk>

On Sun, 4 Jul 2004, Antony Stone wrote:

AS>DNAT rules belong in the PREROUTING chain, nat table, not the FORWARD chain, 
AS>filter table :)

Ah.. yes. Well, I had an example that used my own chain, and incorrectly
changed it for simplicity before posting.

AS>Also, instead of -j DNAT --to 127.0.0.1, I think you should use -j REDIRECT.

Right. That was a quick&dirty example, I forgot about that.

AS>I see no reason not to change netfilter rules as often as you like.
AS>After all, adding one rule when a user registers, and removing one
AS>rule when they unregister or time out, is unlikely to be a large
AS>quantity of changes.

Yes, but who knows, maybe when changing tables a lot something will
overflow after a month or so, or maybe some packets will be dropped.
And I may need to add or remove two rules (one for ICMP, because ICMP
won't be just dropped or accepted, but filtered though another chain).

AS>As for whether the several scripts are a problem - that depends on
AS>how good the scripts are :)   I don't see that they need to be at all
AS>complicated - the interesting part is going to be looking up the
AS>username / password (PHP / MySQL would seem an obvious candidate for
AS>this?), and then checking at regular intervals to see whether the
AS>time has been exceeded and the user need disconnecting.

Yes, php, mysql & perl are the choosen tools, but it would be a bit more
complicated. For example, there should be ULOG rule and one of the
script will have to analyze ulogd's mysql dumps.

AS>Note, by the way, that if a user has an established connection, then
AS>neither changing the DNAT rule/s, nor removing their FORWARD rule
AS>from netfilter will result in their connection being terminated - you
AS>will need to explicitly add a DROP rule either at the top of the
AS>FORWARD chain (before the -m state --state ESTABLISHED,RELATED rule),
AS>or else in one of the mangle tables, in order to make sure the
AS>connection gets cut off.

Thanks, I'll note this.

AS>The other thing I would say is that because you are talking about
AS>doing this over a wireless link, I think you *really* should use
AS>HTTPS, not HTTP, otherwise someone else in the vicinity will simply
AS>sniff the traffic, find out a valid username & password, and use it
AS>themselves.
AS>
AS>I recommend the Apache 404 error handler redirects to an https: login
AS>page and you accept the username & password there.

Actually, that was the reason why 404 redirects to other page, not
displays login page itself ;)

-- 

Vladimir


  reply	other threads:[~2004-07-04 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-04 16:33 Dynamic change of iptables (building Wi-Fi hotspot) Vladimir Mosgalin
2004-07-04 17:03 ` Antony Stone
2004-07-04 18:10   ` Vladimir Mosgalin [this message]
2004-07-04 21:26 ` Eric Leblond

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=Pine.LNX.4.58.0407042142420.8244@localhost.localdomain \
    --to=mosgalin@vm10124.spb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox