Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Martijn Lievaart <m@rtij.nl>
To: Francisco Morales <francisco.morales.lopez.de.gamarra@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Howto capture first connection and redirect ???
Date: Thu, 24 Jan 2008 00:29:47 +0100	[thread overview]
Message-ID: <4797CDEB.40502@rtij.nl> (raw)
In-Reply-To: <59420160801231521n2f7d1459i9edf07c2d8c1a54a@mail.gmail.com>

Francisco Morales wrote:
> Hello, I would like to know if does it possible to capture just the
> first connection og one user with a iptables rule and redirect to a
> specific ip/port address.
>
> I have a intranet with a proxy machine with squid on debian for to out
> to internet, and I would like that when I user connect for first time,
> a iptable rule redirect it to a welcome page.... but just the first
> time ..
>
> Does it possible to do this with a iptable rule??
>
> Thanks a lot
> -
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>   

This is probably possible with the recent match. Somthing along these 
lines (untested!):

-t mangle -A PREROUTING -p tcp -dport 80 ! -m recent --update --seconds 
3600 -j REDIRECT --to <welcome-page>

HTH,
M4


      reply	other threads:[~2008-01-23 23:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <59420160801231515j3e5f71dao58d8a5f89c7114ec@mail.gmail.com>
2008-01-23 23:21 ` Howto capture first connection and redirect ??? Francisco Morales
2008-01-23 23:29   ` Martijn Lievaart [this message]

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=4797CDEB.40502@rtij.nl \
    --to=m@rtij.nl \
    --cc=francisco.morales.lopez.de.gamarra@gmail.com \
    --cc=netfilter@vger.kernel.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